Package org.ow2.authzforce.core.pdp.api
Class BasePdpExtensionRegistry<T extends PdpExtension>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.BasePdpExtensionRegistry<T>
-
- Type Parameters:
T
- type of extension in this registry
- All Implemented Interfaces:
PdpExtensionRegistry<T>
- Direct Known Subclasses:
ImmutableAttributeValueFactoryRegistry
public abstract class BasePdpExtensionRegistry<T extends PdpExtension> extends Object implements PdpExtensionRegistry<T>
This is a base implementation ofPdpExtensionRegistry
. This should be used as basis to implement (in a final class) an immutable PDP extension registry of a specific type. If you need a generic immutable PDP extension registry, see {- Version:
- $Id: $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ow2.authzforce.core.pdp.api.PdpExtensionRegistry
PdpExtensionRegistry.PdpExtensionComparator<E extends PdpExtension>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BasePdpExtensionRegistry(Class<? super T> extensionClass, Map<String,? extends T> extensionsById)
Instantiates immutable registry from a map.protected
BasePdpExtensionRegistry(Class<? super T> extensionClass, Set<? extends T> extensions)
Instantiates immutable registry from a set of extensions
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getExtension(String identity)
Get an extension by ID.Set<T>
getExtensions()
Get extensionsString
toString()
-
-
-
Constructor Detail
-
BasePdpExtensionRegistry
protected BasePdpExtensionRegistry(Class<? super T> extensionClass, Map<String,? extends T> extensionsById)
Instantiates immutable registry from a map.- Parameters:
extensionClass
- extension classextensionsById
- extensions input map; the registry actually creates and uses an immutable copy of this map internally to avoid external modifications on the internal map
-
-
Method Detail
-
getExtension
public final T getExtension(String identity)
Get an extension by ID.- Specified by:
getExtension
in interfacePdpExtensionRegistry<T extends PdpExtension>
- Parameters:
identity
- ID of extension to look up- Returns:
- extension, null if none with such ID in the registry
-
getExtensions
public final Set<T> getExtensions()
Get extensions- Specified by:
getExtensions
in interfacePdpExtensionRegistry<T extends PdpExtension>
- Returns:
- set of extensions currently registered
-
-