org.wamblee.security.authorization
Class DefaultOperationRegistry

java.lang.Object
  extended by org.wamblee.security.authorization.DefaultOperationRegistry
All Implemented Interfaces:
OperationRegistry

public class DefaultOperationRegistry
extends java.lang.Object
implements OperationRegistry

Operation registry implementation. This implementation ignores the distinction between different types of resources and simply assumes that every operation is applicable to every type of resource.

Author:
Erik Brakkee

Constructor Summary
DefaultOperationRegistry(Operation[] aOperations)
          Creates a new DefaultOperationRegistry object.
 
Method Summary
 Operation[] decode(java.lang.Class aResourceClass, java.lang.String aOperationsString)
          Converts an operations string to an array of operations.
 Operation[] decode(java.lang.String aOperationsString)
          Converts an operations string to an array of operations.
 java.lang.String encode(Operation[] aOperations)
          Converts a number of operations to a string.
 Operation[] getOperations(java.lang.Class aResourceClass)
          Gets the supported operations for a given resource class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOperationRegistry

public DefaultOperationRegistry(Operation[] aOperations)
Creates a new DefaultOperationRegistry object.

Method Detail

getOperations

public Operation[] getOperations(java.lang.Class aResourceClass)
Description copied from interface: OperationRegistry
Gets the supported operations for a given resource class.

Specified by:
getOperations in interface OperationRegistry
Parameters:
aResourceClass - Resource class.
Returns:
Supported operations for that class.

encode

public java.lang.String encode(Operation[] aOperations)
Description copied from interface: OperationRegistry
Converts a number of operations to a string.

Specified by:
encode in interface OperationRegistry
Parameters:
aOperations - Operations to convert.
Returns:
String representation of the allowed operations.

decode

public Operation[] decode(java.lang.Class aResourceClass,
                          java.lang.String aOperationsString)
Description copied from interface: OperationRegistry
Converts an operations string to an array of operations.

Specified by:
decode in interface OperationRegistry
Parameters:
aResourceClass - Resource class.
aOperationsString - Operations string as returned by OperationRegistry.encode(Operation[]).
Returns:
Operations array.

decode

public Operation[] decode(java.lang.String aOperationsString)
Description copied from interface: OperationRegistry
Converts an operations string to an array of operations.

Specified by:
decode in interface OperationRegistry
Parameters:
aOperationsString - Operations string as returned by OperationRegistry.encode(Operation[]).
Returns:
Operations array.


Copyright © 2022. All Rights Reserved.