Commit 54b7aa83 authored by cdanger's avatar cdanger

- Renamed (Closeable|Base)DesignatedAttributeProvider classes to

(Closeable|Base)NamedAttributeProvider to reuse the official term "named
attribute" from §7.3 of XACML 3.0 spec
parent 3975a717
......@@ -18,9 +18,9 @@
package org.ow2.authzforce.core.pdp.api;
/**
* This is a convenience class to help implement {@link CloseableDesignatedAttributeProvider}.
* This is a convenience class to help implement {@link CloseableNamedAttributeProvider}.
*/
public abstract class BaseDesignatedAttributeProvider implements CloseableDesignatedAttributeProvider
public abstract class BaseNamedAttributeProvider implements CloseableNamedAttributeProvider
{
private static final IllegalArgumentException UNDEF_INSTANCE_ID = new IllegalArgumentException("Undefined Attribute Provider's instance ID");
......@@ -39,7 +39,7 @@ public abstract class BaseDesignatedAttributeProvider implements CloseableDesign
* @throws IllegalArgumentException
* if instanceId null
*/
protected BaseDesignatedAttributeProvider(final String instanceID) throws IllegalArgumentException
protected BaseNamedAttributeProvider(final String instanceID) throws IllegalArgumentException
{
if (instanceID == null)
{
......@@ -75,12 +75,12 @@ public abstract class BaseDesignatedAttributeProvider implements CloseableDesign
return true;
}
if (!(obj instanceof BaseDesignatedAttributeProvider))
if (!(obj instanceof BaseNamedAttributeProvider))
{
return false;
}
final BaseDesignatedAttributeProvider other = (BaseDesignatedAttributeProvider) obj;
final BaseNamedAttributeProvider other = (BaseNamedAttributeProvider) obj;
return this.instanceID.equals(other.instanceID);
}
......
......@@ -20,24 +20,24 @@ package org.ow2.authzforce.core.pdp.api;
import java.io.Closeable;
import java.util.Set;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType;
import org.ow2.authzforce.core.pdp.api.value.AttributeValueFactoryRegistry;
import org.ow2.authzforce.xmlns.pdp.ext.AbstractAttributeProvider;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType;
/**
* {@link DesignatedAttributeProvider} that extends {@link Closeable} because it may may use resources external to the JVM such as a cache, a disk, a connection to a remote server, etc. for retrieving
* the attribute values. Therefore, these resources must be released by calling {@link #close()} when it is no longer needed.
* {@link NamedAttributeProvider} that extends {@link Closeable} because it may may use resources external to the JVM such as a cache, a disk, a connection to a remote server, etc. for retrieving the
* attribute values. Therefore, these resources must be released by calling {@link #close()} when it is no longer needed.
* <p>
* PDP extensions of this type (to support new ways of providing attributes) must implement the {@link FactoryBuilder} class.
*/
public interface CloseableDesignatedAttributeProvider extends DesignatedAttributeProvider, Closeable
public interface CloseableNamedAttributeProvider extends NamedAttributeProvider, Closeable
{
/**
* Intermediate dependency-aware {@link CloseableDesignatedAttributeProvider} factory that can create instances of Attribute Providers from a XML/JAXB configuration, and also provides the
* dependencies (required attributes) (based on this configuration), that any such instance (created by it) will need. Providing the dependencies helps to optimize the {@code depAttrProvider}
* argument to {@link #getInstance(AttributeValueFactoryRegistry, AttributeProvider)} and therefore optimize the created provider's job of finding its own supported attribute values based on other
* attributes in the evaluation context.
* Intermediate dependency-aware {@link CloseableNamedAttributeProvider} factory that can create instances of Attribute Providers from a XML/JAXB configuration, and also provides the dependencies
* (required attributes) (based on this configuration), that any such instance (created by it) will need. Providing the dependencies helps to optimize the {@code depAttrProvider} argument to
* {@link #getInstance(AttributeValueFactoryRegistry, AttributeProvider)} and therefore optimize the created provider's job of finding its own supported attribute values based on other attributes
* in the evaluation context.
*
*/
interface DependencyAwareFactory
......@@ -56,14 +56,14 @@ public interface CloseableDesignatedAttributeProvider extends DesignatedAttribut
/**
* Create Attribute Provider instance
*
* @param attributeValueFactoryRegistry
* registry of Attribute value factories for the Provider to be able to create attribute values
* @param attributeValueFactories
* AttributeValue factories for the Provider to be able to create AttributeValues
* @param depAttrProvider
* Existing Attribute Provider supplying the possibly required attributes that new Providers instantiated here will depend on
*
* @return attribute value in internal model
*/
CloseableDesignatedAttributeProvider getInstance(AttributeValueFactoryRegistry attributeValueFactoryRegistry, AttributeProvider depAttrProvider);
CloseableNamedAttributeProvider getInstance(AttributeValueFactoryRegistry attributeValueFactories, AttributeProvider depAttrProvider);
}
/**
......
......@@ -21,8 +21,6 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Optional;
import net.sf.saxon.s9api.XdmNode;
import org.ow2.authzforce.core.pdp.api.expression.AttributeDesignatorExpression;
import org.ow2.authzforce.core.pdp.api.expression.AttributeSelectorExpression;
import org.ow2.authzforce.core.pdp.api.value.AttributeBag;
......@@ -33,6 +31,8 @@ import org.ow2.authzforce.core.pdp.api.value.Datatype;
import org.ow2.authzforce.core.pdp.api.value.Value;
import org.ow2.authzforce.core.pdp.api.value.XPathValue;
import net.sf.saxon.s9api.XdmNode;
/**
* Manages context for the policy evaluation of a given authorization decision request. Typically, an instance of this is instantiated whenever the PDP gets a request and needs to perform an
* evaluation to a authorization decision. Such a context is used and possibly updated all along the evaluation of the request.
......@@ -95,7 +95,7 @@ public interface EvaluationContext
/**
* Returns the value of a named attribute available in the request context. Used to evaluate {@link AttributeDesignatorExpression}, ContextSelectorId of {@link AttributeSelectorExpression}, or to
* get values of attributes on which {@link DesignatedAttributeProvider}s depends to resolve their own attributes (e.g. some module may need attribute X, such as a subject ID, as input to resolve
* get values of attributes on which {@link NamedAttributeProvider}s depends to resolve their own attributes (e.g. some module may need attribute X, such as a subject ID, as input to resolve
* attribute Y from an external source, such as subject role from a user database).
*
* @param attributeFQN
......@@ -265,12 +265,11 @@ public interface EvaluationContext
<L extends Listener> L putListener(Class<L> listenerType, L listener);
/**
* Returns the listener the specified class is mapped to, or null if no entry for this class is present. This will only return a value that was bound to this specific class, not a value that may
* have been bound to a subtype.
* Returns the listener the specified class is mapped to. This will only return a value that was bound to this specific class, not a value that may have been bound to a subtype.
*
* @param listenerType
* listener type, used as key to retrieve the listener registered with this type with {@link #putListener(Class, Listener)}
* @return the listener associated with this class
* @return the listener associated with this class, or null if no entry for this class is present
*/
<L extends Listener> L getListener(Class<L> listenerType);
......
......@@ -22,9 +22,13 @@ import java.util.Set;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType;
/**
* "Designated" Attribute Provider, i.e. attribute provider supporting/assigned to designated attribute
* "Named" Attribute Provider, i.e. providing "named attribute(s)" as defined in §7.3 of XACML 3.0 specification:
* <p>
* <i>A named attribute is the term used for the criteria that the specific attribute designators use to refer to particular attributes in the <Attributes> elements of the request context.</i>
* </p>
*
*/
public interface DesignatedAttributeProvider extends AttributeProvider
public interface NamedAttributeProvider extends AttributeProvider
{
/**
......
......@@ -26,14 +26,14 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.ExpressionType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableDefinition;
import org.ow2.authzforce.core.pdp.api.DesignatedAttributeProvider;
import org.ow2.authzforce.core.pdp.api.NamedAttributeProvider;
import org.ow2.authzforce.core.pdp.api.value.AttributeValue;
import org.ow2.authzforce.core.pdp.api.value.Datatype;
/**
* Expression factory for parsing XACML {@link ExpressionType}s in policies: AttributeDesignator, AttributeSelector, Apply, etc.
* <p>
* Extends {@link Closeable} because it may use {@link DesignatedAttributeProvider}s (implement {@link Closeable}) to resolve AttributeDesignators for attributes not provided in the request.
* Extends {@link Closeable} because it may use {@link NamedAttributeProvider}s (implement {@link Closeable}) to resolve AttributeDesignators for attributes not provided in the request.
*/
public interface ExpressionFactory extends Closeable
{
......
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