Commit 9bc0f9e9 authored by cdanger's avatar cdanger

- Fixed AttributeFqn implementations' toString()

- Fixed javadoc of AttributeProvider interface
- BaseDesignatedAttributeProvider: removed unused exceptions
- Expressions: fixed debug logs
parent e4d0cf4e
......@@ -127,7 +127,9 @@ public final class AttributeFqns
{
if (toString == null)
{
toString = "[category='" + category + "', issuer=" + getIssuer() + ", id='" + id + "']";
final Optional<String> optIssuer = getIssuer();
toString = "[category='" + category + "', issuer=" + (optIssuer.isPresent() ? "'" + optIssuer.get() + "'" : null) + ", id='" + id + "']";
}
return toString;
......
......@@ -36,10 +36,11 @@ public interface AttributeProvider
* @param context
* the request context
* @param returnDatatype
* attribute value bag datatype
* @return the result of retrieving the attribute, which will be a bag of values of type defined by {@code attributeDatatype}; empty bag iff no value found and no error occurred.
* attribute bag datatype
* @return the result of retrieving the attribute, which will be a bag of values of type defined by {@code returnDatatype}; empty bag iff no value found and no error occurred.
* @throws UnsupportedOperationException {@code attributeFQN} or {@code returnDatatype} are not supported (the PDP engine should try another attribute provider if any)
* @throws IndeterminateEvaluationException
* if any error finding the attribute value(s)
* {@code attributeFQN} or {@code returnDatatype} are supported but some error occurred while trying to resolve the attribute value(s)
*/
<AV extends AttributeValue> AttributeBag<AV> get(AttributeFqn attributeFQN, BagDatatype<AV> returnDatatype, EvaluationContext context) throws IndeterminateEvaluationException;
......
......@@ -23,10 +23,6 @@ package org.ow2.authzforce.core.pdp.api;
public abstract class BaseDesignatedAttributeProvider implements CloseableDesignatedAttributeProvider
{
protected static final UnsupportedOperationException UNSUPPORTED_ATTRIBUTE_CATEGORY_EXCEPTION = new UnsupportedOperationException("Unsupported attribute category");
protected static final UnsupportedOperationException UNSUPPORTED_ATTRIBUTE_ISSUER_EXCEPTION = new UnsupportedOperationException("Unsupported attribute issuer");
protected static final UnsupportedOperationException UNSUPPORTED_ATTRIBUTE_ID_EXCEPTION = new UnsupportedOperationException("Unsupported attribute ID");
protected static final UnsupportedOperationException UNSUPPORTED_ATTRIBUTE_DATATYPE_EXCEPTION = new UnsupportedOperationException("Unsupported attribute datetype");
private static final IllegalArgumentException UNDEF_INSTANCE_ID = new IllegalArgumentException("Undefined Attribute Provider's instance ID");
private final String instanceID;
......
......@@ -62,7 +62,7 @@ public final class Expressions
final Value val = arg.evaluate(context);
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("eval( arg = <{}>, <context>, expectedType = <{}> ) -> <{}>", arg, returnType, val);
LOGGER.debug("eval( arg = ({}), context, expectedType = ({}) ) -> ({})", arg, returnType, val);
}
if (val == null)
......@@ -99,7 +99,7 @@ public final class Expressions
/*
* Findsecbugs: prevent CRLF log injection
*/
LOGGER.debug("evalPrimitive( arg = <{}>, <context>) -> <{}>", arg, val);
LOGGER.debug("evalPrimitive( arg = ({}), context ) -> ({})", arg, val);
}
if (val == null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment