Class PermissionMemoryStore<V extends Permission>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<edu.uiuc.ncsa.security.core.Identifier,V>
-
- edu.uiuc.ncsa.security.storage.MemoryStore<V>
-
- org.oa4mp.server.api.admin.permissions.PermissionMemoryStore<V>
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Store<V>,Serializable,Cloneable,Map<edu.uiuc.ncsa.security.core.Identifier,V>,PermissionsStore<V>
public class PermissionMemoryStore<V extends Permission> extends edu.uiuc.ncsa.security.storage.MemoryStore<V> implements PermissionsStore<V>
Created by Jeff Gaynor
on 10/10/16 at 4:18 PM- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPermissionMemoryStore.IDTriple-
Nested classes/interfaces inherited from class edu.uiuc.ncsa.security.storage.MemoryStore
edu.uiuc.ncsa.security.storage.MemoryStore.MSInitializer
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description PermissionMemoryStore(edu.uiuc.ncsa.security.core.IdentifiableProvider<V> identifiableProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToAdmins(V p)protected voidaddToClients(V p)voidclear()PermissionListget(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID)Retrieve a permission from the admin and client identifier.List<edu.uiuc.ncsa.security.core.Identifier>getAdmins(edu.uiuc.ncsa.security.core.Identifier clientID)A list of all admin ids for a given client.List<Permission>getByAdminID(edu.uiuc.ncsa.security.core.Identifier adminID)List<Permission>getByClientID(edu.uiuc.ncsa.security.core.Identifier clientID)List<Permission>getByErsatzID(edu.uiuc.ncsa.security.core.Identifier ersatzID)intgetClientCount(edu.uiuc.ncsa.security.core.Identifier adminID)List<edu.uiuc.ncsa.security.core.Identifier>getClients(edu.uiuc.ncsa.security.core.Identifier adminID)A list of all identifiers that a given admin can manage.PermissiongetErsatzChain(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID, edu.uiuc.ncsa.security.core.Identifier ersatzID)Get the specific permission with the chain starting with clientID and ending with ersatzID.PermissionListgetErsatzChains(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID)Returns the chain of ersatz clients for a given admin and provisioning client.List<V>getMostRecent(int n, List<String> attributes)PermissionListgetProvisioners(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier ersatzID)edu.uiuc.ncsa.security.core.XMLConverter<V>getXMLConverter()booleanhasEntry(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID)Returns whether or not there is an entry for this pair of identifiers.Vput(edu.uiuc.ncsa.security.core.Identifier key, V value2)Vremove(Object key)protected voidremoveFromAdmins(V p)Part of the contract for this store is that saving a permission with an updated ID (AC or client) should remove the old value, which means we have to clean out stale entries from the clientMpa and adminMap.protected voidremoveFromClients(V p)-
Methods inherited from class edu.uiuc.ncsa.security.storage.MemoryStore
create, getAll, getInitializer, getMapConverter, realSave, register, remove, removeByID, save, search, search, search, search, size, update, update
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Methods inherited from interface org.oa4mp.server.api.admin.permissions.PermissionsStore
getMapConverter
-
-
-
-
Constructor Detail
-
PermissionMemoryStore
public PermissionMemoryStore(edu.uiuc.ncsa.security.core.IdentifiableProvider<V> identifiableProvider)
-
-
Method Detail
-
getMostRecent
public List<V> getMostRecent(int n, List<String> attributes)
- Specified by:
getMostRecentin interfaceedu.uiuc.ncsa.security.core.Store<V extends Permission>
-
getAdmins
public List<edu.uiuc.ncsa.security.core.Identifier> getAdmins(edu.uiuc.ncsa.security.core.Identifier clientID)
Description copied from interface:PermissionsStoreA list of all admin ids for a given client.- Specified by:
getAdminsin interfacePermissionsStore<V extends Permission>- Returns:
-
getClients
public List<edu.uiuc.ncsa.security.core.Identifier> getClients(edu.uiuc.ncsa.security.core.Identifier adminID)
Description copied from interface:PermissionsStoreA list of all identifiers that a given admin can manage.- Specified by:
getClientsin interfacePermissionsStore<V extends Permission>- Returns:
-
getClientCount
public int getClientCount(edu.uiuc.ncsa.security.core.Identifier adminID)
- Specified by:
getClientCountin interfacePermissionsStore<V extends Permission>
-
get
public PermissionList get(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID)
Description copied from interface:PermissionsStoreRetrieve a permission from the admin and client identifier.- Specified by:
getin interfacePermissionsStore<V extends Permission>- Returns:
-
getErsatzChains
public PermissionList getErsatzChains(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID)
Description copied from interface:PermissionsStoreReturns the chain of ersatz clients for a given admin and provisioning client. Access the list usingPermission.getErsatzChain().- Specified by:
getErsatzChainsin interfacePermissionsStore<V extends Permission>- Returns:
-
getErsatzChain
public Permission getErsatzChain(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID, edu.uiuc.ncsa.security.core.Identifier ersatzID)
Description copied from interface:PermissionsStoreGet the specific permission with the chain starting with clientID and ending with ersatzID.- Specified by:
getErsatzChainin interfacePermissionsStore<V extends Permission>- Returns:
-
getProvisioners
public PermissionList getProvisioners(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier ersatzID)
- Specified by:
getProvisionersin interfacePermissionsStore<V extends Permission>
-
hasEntry
public boolean hasEntry(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier clientID)Description copied from interface:PermissionsStoreReturns whether or not there is an entry for this pair of identifiers. There is at most one permission for any such pair- Specified by:
hasEntryin interfacePermissionsStore<V extends Permission>- Returns:
-
addToClients
protected void addToClients(V p)
-
addToAdmins
protected void addToAdmins(V p)
-
clear
public void clear()
- Specified by:
clearin interfaceMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>- Overrides:
clearin classHashMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
-
removeFromClients
protected void removeFromClients(V p)
-
removeFromAdmins
protected void removeFromAdmins(V p)
Part of the contract for this store is that saving a permission with an updated ID (AC or client) should remove the old value, which means we have to clean out stale entries from the clientMpa and adminMap. The problem with a memory store is that the permission- Parameters:
p-
-
put
public V put(edu.uiuc.ncsa.security.core.Identifier key, V value2)
- Specified by:
putin interfaceMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>- Overrides:
putin classHashMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
-
remove
public V remove(Object key)
- Specified by:
removein interfaceMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>- Overrides:
removein classHashMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
-
getXMLConverter
public edu.uiuc.ncsa.security.core.XMLConverter<V> getXMLConverter()
- Specified by:
getXMLConverterin interfaceedu.uiuc.ncsa.security.core.Store<V extends Permission>
-
getByAdminID
public List<Permission> getByAdminID(edu.uiuc.ncsa.security.core.Identifier adminID)
- Specified by:
getByAdminIDin interfacePermissionsStore<V extends Permission>
-
getByClientID
public List<Permission> getByClientID(edu.uiuc.ncsa.security.core.Identifier clientID)
- Specified by:
getByClientIDin interfacePermissionsStore<V extends Permission>
-
getByErsatzID
public List<Permission> getByErsatzID(edu.uiuc.ncsa.security.core.Identifier ersatzID)
- Specified by:
getByErsatzIDin interfacePermissionsStore<V extends Permission>
-
-