Commit 640910b7 authored by Cyril Dangerville's avatar Cyril Dangerville

* Fixing more issues reported by findBugs/PMD

parent fe9eb69f
......@@ -10,3 +10,4 @@
/.settings/org.sonar.ide.eclipse.core.prefs
*.log
/.pmd
/.eclipse-pmd
This diff is collapsed.
/**
*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
* AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
* AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
* WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use in
* the design, construction, operation or maintenance of any nuclear facility.
* You acknowledge that this software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
*/
package com.sun.xacml.cond;
package com.sun.xacml;
import java.util.List;
......@@ -39,13 +29,14 @@ import javax.xml.bind.JAXBElement;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType;
import com.thalesgroup.authzforce.core.EvaluationContext;
import com.thalesgroup.authzforce.core.Expression;
import com.thalesgroup.authzforce.core.IndeterminateEvaluationException;
import com.thalesgroup.authzforce.core.PdpExtension;
import com.thalesgroup.authzforce.core.StatusHelper;
import com.thalesgroup.authzforce.core.XACMLBindingUtils;
import com.thalesgroup.authzforce.core.func.FunctionCall;
import org.ow2.authzforce.core.EvaluationContext;
import org.ow2.authzforce.core.IndeterminateEvaluationException;
import org.ow2.authzforce.core.PdpExtension;
import org.ow2.authzforce.core.StatusHelper;
import org.ow2.authzforce.core.XACMLBindingUtils;
import org.ow2.authzforce.core.expression.Expression;
import org.ow2.authzforce.core.func.FunctionCall;
import org.ow2.authzforce.core.value.Value;
/**
* Interface that all functions in the system must implement.
......@@ -55,7 +46,7 @@ import com.thalesgroup.authzforce.core.func.FunctionCall;
* @param <RETURN_T>
* return type of this function, i.e. single-valued V or bag of Vs
*/
public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> extends FunctionType implements Expression<RETURN_T>, PdpExtension
public abstract class Function<RETURN_T extends Value> extends FunctionType implements Expression<RETURN_T>, PdpExtension
{
// cached hashcode result
private transient volatile int hashCode = 0; // Effective Java - Item 9
......@@ -63,7 +54,7 @@ public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> exte
/**
* Returns the function ID (as PDP extension ID)
*
* @see com.thalesgroup.authzforce.core.PdpExtension#getId()
* @see org.ow2.authzforce.core.PdpExtension#getId()
*/
@Override
public final String getId()
......@@ -74,19 +65,20 @@ public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> exte
/**
* The standard namespace where all XACML 1.0 spec-defined functions are defined
*/
public static final String FUNCTION_NS_1 = "urn:oasis:names:tc:xacml:1.0:function:";
public static final String XACML_NS_1_0 = "urn:oasis:names:tc:xacml:1.0:function:";
/**
* The standard namespace where all XACML 2.0 spec-defined functions are defined
*/
public static final String FUNCTION_NS_2 = "urn:oasis:names:tc:xacml:2.0:function:";
public static final String XACML_NS_2_0 = "urn:oasis:names:tc:xacml:2.0:function:";
/**
* The standard namespace where all XACML 3.0 spec-defined functions are defined
*/
public static final String FUNCTION_NS_3 = "urn:oasis:names:tc:xacml:3.0:function:";
public static final String XACML_NS_3_0 = "urn:oasis:names:tc:xacml:3.0:function:";
private static final UnsupportedOperationException UNSUPPORTED_SET_FUNCTION_ID_OPERATION_EXCEPTION = new UnsupportedOperationException("Function.setFunctionId() not allowed");
private static final UnsupportedOperationException UNSUPPORTED_SET_FUNCTION_ID_OPERATION_EXCEPTION = new UnsupportedOperationException(
"Function.setFunctionId() not allowed");
protected Function(String functionId)
{
......@@ -94,19 +86,18 @@ public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> exte
}
/**
* Creates new function call with given arguments (Expressions). Any implementation of this
* method should first validate inputs according to the function signature/definition.
* Creates new function call with given arguments (Expressions). Any implementation of this method should first validate inputs according to the function
* signature/definition.
*
* @param inputExpressions
* @param argExpressions
* function arguments (expressions)
*
* @return Function call handle for calling this function which such inputs (with possible
* changes from original inputs due to optimizations for instance)
* @return Function call handle for calling this function which such inputs (with possible changes from original inputs due to optimizations for instance)
*
* @throws IllegalArgumentException
* if inputs are invalid for this function
*/
public abstract FunctionCall<RETURN_T> newCall(List<Expression<?>> inputExpressions) throws IllegalArgumentException;
public abstract FunctionCall<RETURN_T> newCall(List<Expression<?>> argExpressions) throws IllegalArgumentException;
/*
* (non-Javadoc)
......@@ -121,19 +112,11 @@ public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> exte
}
@Override
public final RETURN_T evaluate(EvaluationContext context) throws IndeterminateEvaluationException // NOPMD
// by
// Cyril
// DANGERVILLE
// on
// 10/12/15
// 11:19
// PM
public final RETURN_T evaluate(EvaluationContext context) throws IndeterminateEvaluationException
{
// Expression#evaluate()
/*
* The static function instance itself (as an expression, without any parameter) evaluates
* to nothing, it is just a function ID
* The static function instance itself (as an expression, without any parameter) evaluates to nothing, it is just a function ID
*/
return null;
}
......@@ -141,7 +124,7 @@ public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> exte
@Override
public final String toString()
{
return this.getFunctionId();
return this.functionId;
}
@Override
......
/**
*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
* AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
* AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
* WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use in
* the design, construction, operation or maintenance of any nuclear facility.
* You acknowledge that this software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
*/
package com.sun.xacml.cond;
package com.sun.xacml;
import java.util.Collections;
import java.util.Deque;
import java.util.List;
import com.thalesgroup.authzforce.core.Expression;
import com.thalesgroup.authzforce.core.IndeterminateEvaluationException;
import com.thalesgroup.authzforce.core.datatypes.BooleanAttributeValue;
import com.thalesgroup.authzforce.core.datatypes.DatatypeConstants;
import com.thalesgroup.authzforce.core.func.FirstOrderFunction;
import com.thalesgroup.authzforce.core.func.FirstOrderFunctionCall;
import com.thalesgroup.authzforce.core.func.FirstOrderFunctionCall.EagerSinglePrimitiveTypeEval;
import org.ow2.authzforce.core.IndeterminateEvaluationException;
import org.ow2.authzforce.core.expression.Expression;
import org.ow2.authzforce.core.func.FirstOrderFunction;
import org.ow2.authzforce.core.func.FirstOrderFunctionCall;
import org.ow2.authzforce.core.value.BooleanValue;
import org.ow2.authzforce.core.value.Datatype;
import org.ow2.authzforce.core.value.DatatypeConstants;
/**
* A class that implements the not function. This function takes one boolean argument and returns
* the logical negation of that value. If the argument evaluates to indeterminate, an indeterminate
* result is returned.
* A class that implements the not function. This function takes one boolean argument and returns the logical negation of that value. If the argument evaluates
* to indeterminate, an indeterminate result is returned.
*
* @since 1.0
* @author Steve Hanna
* @author Seth Proctor
*/
public class NotFunction extends FirstOrderFunction<BooleanAttributeValue>
public final class NotFunction extends FirstOrderFunction.SingleParameterTyped<BooleanValue, BooleanValue>
{
/**
* Standard identifier for the not function.
*/
public static final String NAME_NOT = FUNCTION_NS_1 + "not";
public static final String NAME_NOT = XACML_NS_1_0 + "not";
/**
* Creates a new <code>NotFunction</code> object.
*/
public NotFunction()
{
super(NAME_NOT, DatatypeConstants.BOOLEAN.TYPE, false, DatatypeConstants.BOOLEAN.TYPE);
super(NAME_NOT, DatatypeConstants.BOOLEAN.TYPE, false, Collections.singletonList(DatatypeConstants.BOOLEAN.TYPE));
}
@Override
protected FirstOrderFunctionCall<BooleanAttributeValue> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes) throws IllegalArgumentException
protected FirstOrderFunctionCall<BooleanValue> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes)
throws IllegalArgumentException
{
return new EagerSinglePrimitiveTypeEval<BooleanAttributeValue, BooleanAttributeValue>(signature, DatatypeConstants.BOOLEAN.TYPE, argExpressions, remainingArgTypes)
return new FirstOrderFunctionCall.EagerSinglePrimitiveTypeEval<BooleanValue, BooleanValue>(functionSignature, argExpressions, remainingArgTypes)
{
@Override
protected BooleanAttributeValue evaluate(Deque<BooleanAttributeValue> args) throws IndeterminateEvaluationException
protected BooleanValue evaluate(Deque<BooleanValue> args) throws IndeterminateEvaluationException
{
return eval(args.getFirst());
return args.getFirst().not();
}
};
}
/**
* not(arg)
*
* @param arg
* boolean
* @return not(<code>arg</code>)
*/
public static BooleanAttributeValue eval(BooleanAttributeValue arg)
{
return arg.not();
}
}
This diff is collapsed.
/**
*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
* AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
* AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
* WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use in
* the design, construction, operation or maintenance of any nuclear facility.
* You acknowledge that this software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
*/
package com.sun.xacml;
import com.thalesgroup.authzforce.core.DecisionResult;
import com.thalesgroup.authzforce.core.StatusHelper;
import org.ow2.authzforce.core.DecisionResult;
import org.ow2.authzforce.core.StatusHelper;
/**
* Exception that gets thrown if any general parsing error occurs.
......@@ -45,6 +35,11 @@ import com.thalesgroup.authzforce.core.StatusHelper;
public class ParsingException extends Exception
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Constructs a new <code>ParsingException</code> with no message or cause.
*/
......@@ -54,9 +49,8 @@ public class ParsingException extends Exception
}
/**
* Constructs a new <code>ParsingException</code> with a message, but no cause. The message is
* saved for later retrieval by the {@link java.lang#Throwable.getMessage()
* Throwable.getMessage()} method.
* Constructs a new <code>ParsingException</code> with a message, but no cause. The message is saved for later retrieval by the
* {@link java.lang#Throwable.getMessage() Throwable.getMessage()} method.
*
* @param message
* the detail message (<code>null</code> if nonexistent or unknown)
......@@ -67,10 +61,8 @@ public class ParsingException extends Exception
}
/**
* Constructs a new <code>ParsingException</code> with a message and a cause. The message and
* cause are saved for later retrieval by the {@link java.lang#Throwable.getMessage()
* Throwable.getMessage()} and {@link java.lang#Throwable.getCause() Throwable.getCause()}
* methods.
* Constructs a new <code>ParsingException</code> with a message and a cause. The message and cause are saved for later retrieval by the
* {@link java.lang#Throwable.getMessage() Throwable.getMessage()} and {@link java.lang#Throwable.getCause() Throwable.getCause()} methods.
*
* @param message
* the detail message (<code>null</code> if nonexistent or unknown)
......
/**
*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
* AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
* AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
* WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use in
* the design, construction, operation or maintenance of any nuclear facility.
* You acknowledge that this software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
*/
package com.sun.xacml.attr;
package com.sun.xacml;
import java.util.Objects;
/**
* This class represents a port range as specified in the XACML 2.0 description of
* <code>dnsName</code> and <code>ipAddress</code>. The range may have upper and lower bounds, be
* specified by a single port number, or may be unbound.
*
* @since 2.0
* @author Seth Proctor
* This class represents a port range as specified in the <code>dnsName</code> and <code>ipAddress</code> datatypes. The range may have upper and lower bounds,
* be specified by a single port number, or may be unbound.
*/
final class PortRange
public final class PortRange
{
/**
......@@ -56,8 +42,7 @@ final class PortRange
private final int upperBound;
/**
* Default constructor used to represent an unbound range. This is typically used when an
* address has no port information.
* Default constructor used to represent an unbound range. This is typically used when an address has no port information.
*/
public PortRange()
{
......@@ -65,8 +50,8 @@ final class PortRange
}
/**
* Creates a <code>PortRange</code> with upper and lower bounds. Either of the parameters may
* have the value <code>UNBOUND</code> meaning that there is no bound at the respective end.
* Creates a <code>PortRange</code> with upper and lower bounds. Either of the parameters may have the value <code>UNBOUND</code> meaning that there is no
* bound at the respective end.
*
* @param lowerBound
* the lower-bound port number or <code>UNBOUND</code>
......@@ -90,7 +75,7 @@ final class PortRange
* @throws NumberFormatException
* if a port value isn't an integer
*/
static PortRange getInstance(String value)
public static PortRange getInstance(String value)
{
int lowerBound = UNBOUND;
int upperBound = UNBOUND;
......@@ -130,9 +115,8 @@ final class PortRange
}
/**
* Returns the lower-bound port value. If the range is not lower-bound, then this returns
* <code>UNBOUND</code>. If the range is actually a single port number, then this returns the
* same value as <code>getUpperBound</code>.
* Returns the lower-bound port value. If the range is not lower-bound, then this returns <code>UNBOUND</code>. If the range is actually a single port
* number, then this returns the same value as <code>getUpperBound</code>.
*
* @return the upper-bound
*/
......@@ -142,9 +126,8 @@ final class PortRange
}
/**
* Returns the upper-bound port value. If the range is not upper-bound, then this returns
* <code>UNBOUND</code>. If the range is actually a single port number, then this returns the
* same value as <code>getLowerBound</code>.
* Returns the upper-bound port value. If the range is not upper-bound, then this returns <code>UNBOUND</code>. If the range is actually a single port
* number, then this returns the same value as <code>getLowerBound</code>.
*
* @return the upper-bound
*/
......@@ -184,8 +167,8 @@ final class PortRange
}
/**
* Returns whether the range is unbound, which means that it specifies no port number or range.
* This is typically used with addresses that include no port information.
* Returns whether the range is unbound, which means that it specifies no port number or range. This is typically used with addresses that include no port
* information.
*
* @return true if the range is unbound, false otherwise
*/
......@@ -208,8 +191,7 @@ final class PortRange
}
/**
* Returns true if the input is an instance of this class and if its value equals the value
* contained in this class.
* Returns true if the input is an instance of this class and if its value equals the value contained in this class.
*
* @param o
* the object to compare
......
/**
*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
* AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
* AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
* WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use in
* the design, construction, operation or maintenance of any nuclear facility.
* You acknowledge that this software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
*/
package com.sun.xacml;
/**
* Exception that gets thrown if an unknown identifier was used, such as the identifier used in any
* of the standard factories.
* Exception that gets thrown if an unknown identifier was used, such as the identifier used in any of the standard factories.
*
* @since 1.0
* @author Seth Proctor
......@@ -43,6 +32,11 @@ package com.sun.xacml;
public class UnknownIdentifierException extends Exception
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Creates an <code>UnknownIdentifierException</code> with no data
*/
......
......@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with AuthZForce. If not, see <http://www.gnu.org/licenses/>.
*/
package com.thalesgroup.authzforce.core;
package org.ow2.authzforce.core;
import java.util.ArrayList;
import java.util.Collections;
......@@ -24,6 +24,7 @@ import java.util.List;
import net.sf.saxon.s9api.XPathCompiler;
import org.ow2.authzforce.core.expression.ExpressionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -54,7 +55,7 @@ public class AllOfEvaluator extends oasis.names.tc.xacml._3_0.core.schema.wd_17.
* Expression factory
* @throws ParsingException
*/
public AllOfEvaluator(oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOf jaxbAllOf, XPathCompiler xPathCompiler, Expression.Factory expFactory) throws ParsingException