Package ddf.security.permission.impl
Class KeyValueCollectionPermissionImpl
java.lang.Object
ddf.security.permission.impl.CollectionPermissionImpl
ddf.security.permission.impl.KeyValueCollectionPermissionImpl
- All Implemented Interfaces:
ddf.security.permission.CollectionPermission,ddf.security.permission.KeyValueCollectionPermission,org.apache.shiro.authz.Permission
public class KeyValueCollectionPermissionImpl
extends CollectionPermissionImpl
implements ddf.security.permission.KeyValueCollectionPermission
An extension of ColectionPermission that exclusively holds KeyValuePermission objects.
-
Field Summary
Fields inherited from class ddf.security.permission.impl.CollectionPermissionImpl
action, permissionListFields inherited from interface ddf.security.permission.CollectionPermission
CREATE_ACTION, DELETE_ACTION, PERMISSION_END_MSG, PERMISSION_IMPLIES_MSG, PERMISSION_NOT_IMPLIES_MSG, PERMISSION_START_MSG, READ_ACTION, UNKNOWN_ACTION, UPDATE_ACTION -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty collection that can hold KeyValuePermission objects.Creates an empty collection with an associated actionKeyValueCollectionPermissionImpl(String action, ddf.security.permission.KeyValuePermission... permissions) Creates a new collection of KeyValuePermission objects and adds the provided permissions to the newly created collection.KeyValueCollectionPermissionImpl(String action, Collection<ddf.security.permission.KeyValuePermission> permissions) Creates a new collection of KeyValuePermission objects from an existing collection of KeyValuePermission objects.KeyValueCollectionPermissionImpl(String action, Map<String, ? extends Collection<String>> map) Creates a new collection of KeyValuePermission objects from an existing map of keys and values. -
Method Summary
Methods inherited from class ddf.security.permission.impl.CollectionPermissionImpl
addAll, clear, getAction, getPermissionList, implies, isEmpty, setAction, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ddf.security.permission.CollectionPermission
addAll, clear, getAction, getPermissionList, isEmpty, setActionMethods inherited from interface org.apache.shiro.authz.Permission
implies
-
Constructor Details
-
KeyValueCollectionPermissionImpl
public KeyValueCollectionPermissionImpl()Creates an empty collection that can hold KeyValuePermission objects. -
KeyValueCollectionPermissionImpl
Creates an empty collection with an associated action- Parameters:
action-
-
KeyValueCollectionPermissionImpl
public KeyValueCollectionPermissionImpl(String action, ddf.security.permission.KeyValuePermission... permissions) Creates a new collection of KeyValuePermission objects and adds the provided permissions to the newly created collection.- Parameters:
action- Action associated with this collection of permissionspermissions- KeyValuePermission objects to be added to the newly created collection
-
KeyValueCollectionPermissionImpl
public KeyValueCollectionPermissionImpl(String action, Map<String, ? extends Collection<String>> map) Creates a new collection of KeyValuePermission objects from an existing map of keys and values. Each key and associated list of values is turned into a KeyValuePermission and added to the newly created collection.- Parameters:
action- Action associated with this collection of permissionsmap- collection of keys and their associated list of values to be added to the newly created collection
-
KeyValueCollectionPermissionImpl
public KeyValueCollectionPermissionImpl(String action, Collection<ddf.security.permission.KeyValuePermission> permissions) Creates a new collection of KeyValuePermission objects from an existing collection of KeyValuePermission objects. All KeyValuePermission objects in the provided collection are added to the newly created collection.- Parameters:
action- Action associated with this collection of permissionspermissions- existing collection of KeyValuePermission objects
-
-
Method Details
-
getKeyValuePermissionList
Returns the KeyValuePermission collection as a List of KeyValuePermission objects.- Specified by:
getKeyValuePermissionListin interfaceddf.security.permission.KeyValueCollectionPermission- Type Parameters:
T- specified by the type of the calling object - should be KeyValuePermission to avoid class cast exceptions- Returns:
- List of KeyValuePermission that represent the permission in this collection
-
addAll
Adds all of the incoming key value map entries to this KeyValueCollectionPermission. Each key and associated list of values is turned into a KeyValuePermission and added to the newly created collection.- Specified by:
addAllin interfaceddf.security.permission.KeyValueCollectionPermission- Parameters:
map- collection of keys and their associated list of values to be added to the newly created collection
-