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.permissions.admin.PermissionMemoryStore<V>
-
- All Implemented Interfaces:
PermissionsStore<V>
,edu.uiuc.ncsa.security.core.Store<V>
,Serializable
,Cloneable
,Map<edu.uiuc.ncsa.security.core.Identifier,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 class
PermissionMemoryStore.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 void
addToAdmins(V p)
protected void
addToClients(V p)
void
clear()
PermissionList
get(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.int
getClientCount(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.Permission
getErsatzChain(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.PermissionList
getErsatzChains(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)
PermissionList
getProvisioners(edu.uiuc.ncsa.security.core.Identifier adminID, edu.uiuc.ncsa.security.core.Identifier ersatzID)
edu.uiuc.ncsa.security.core.XMLConverter<V>
getXMLConverter()
boolean
hasEntry(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.V
put(edu.uiuc.ncsa.security.core.Identifier key, V value2)
V
remove(Object key)
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.protected void
removeFromClients(V p)
-
Methods inherited from class edu.uiuc.ncsa.security.storage.MemoryStore
create, getAll, getInitializer, getMapConverter, realSave, register, remove, save, search, search, search, size, 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 edu.uiuc.ncsa.myproxy.oa4mp.server.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:
getMostRecent
in 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:PermissionsStore
A list of all admin ids for a given client.- Specified by:
getAdmins
in 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:PermissionsStore
A list of all identifiers that a given admin can manage.- Specified by:
getClients
in interfacePermissionsStore<V extends Permission>
- Returns:
-
getClientCount
public int getClientCount(edu.uiuc.ncsa.security.core.Identifier adminID)
- Specified by:
getClientCount
in 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:PermissionsStore
Retrieve a permission from the admin and client identifier.- Specified by:
get
in 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:PermissionsStore
Returns the chain of ersatz clients for a given admin and provisioning client. Access the list usingPermission.getErsatzChain()
.- Specified by:
getErsatzChains
in 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:PermissionsStore
Get the specific permission with the chain starting with clientID and ending with ersatzID.- Specified by:
getErsatzChain
in 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:
getProvisioners
in 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:PermissionsStore
Returns whether or not there is an entry for this pair of identifiers. There is at most one permission for any such pair- Specified by:
hasEntry
in interfacePermissionsStore<V extends Permission>
- Returns:
-
addToClients
protected void addToClients(V p)
-
addToAdmins
protected void addToAdmins(V p)
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
- Overrides:
clear
in 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:
put
in interfaceMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
- Overrides:
put
in classHashMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
-
remove
public V remove(Object key)
- Specified by:
remove
in interfaceMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
- Overrides:
remove
in classHashMap<edu.uiuc.ncsa.security.core.Identifier,V extends Permission>
-
getXMLConverter
public edu.uiuc.ncsa.security.core.XMLConverter<V> getXMLConverter()
- Specified by:
getXMLConverter
in interfaceedu.uiuc.ncsa.security.core.Store<V extends Permission>
-
-