Class DefaultSensitivePropertyManager
- java.lang.Object
-
- com.complexible.stardog.api.admin.DefaultSensitivePropertyManager
-
- All Implemented Interfaces:
SensitivePropertyManager
public class DefaultSensitivePropertyManager extends java.lang.Object implements SensitivePropertyManager
The default implementation of theSensitivePropertyManagerinterface using a database connection. This implementation retrieves the database configuration optionsSecurityOptions.SENSITIVE_PROPERTIESandSecurityOptions.SENSITIVE_PROPERTY_GROUPSfirst. Modifications are applied to the local copy first and then applied to the database metadata overriding any changes that might have occurred after the snapshot was created. If two users try to update the sensitive properties at the same time changes of one user might be lost as a result.- Author:
- Evren Sirin
-
-
Constructor Summary
Constructors Constructor Description DefaultSensitivePropertyManager(Connection theConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>getGroups()Returns the sensitive property groups defined for the database.java.util.Set<IRI>getProperties(java.lang.String theGroup)Returns the sensitive properties associated with a given group.booleanremoveGroup(java.lang.String theGroup)Removes the given sensitive property group from the database.voidsetProperties(java.lang.String theGroup, java.util.Set<IRI> theProperties)Associates a set of properties with a group name.
-
-
-
Constructor Detail
-
DefaultSensitivePropertyManager
public DefaultSensitivePropertyManager(Connection theConnection)
-
-
Method Detail
-
getGroups
public java.util.Set<java.lang.String> getGroups()
Description copied from interface:SensitivePropertyManagerReturns the sensitive property groups defined for the database.- Specified by:
getGroupsin interfaceSensitivePropertyManager- Returns:
- unmodifiable set of group names
-
getProperties
public java.util.Set<IRI> getProperties(java.lang.String theGroup)
Description copied from interface:SensitivePropertyManagerReturns the sensitive properties associated with a given group.- Specified by:
getPropertiesin interfaceSensitivePropertyManager- Parameters:
theGroup- group name- Returns:
- unmodifiable set of properties or empty set if the group is not defined
-
removeGroup
public boolean removeGroup(java.lang.String theGroup)
Description copied from interface:SensitivePropertyManagerRemoves the given sensitive property group from the database. The properties associated with the group will not be sensitive anymore unless they are included in other groups.- Specified by:
removeGroupin interfaceSensitivePropertyManager- Parameters:
theGroup- group name- Returns:
- true if the group was removed as a result of this call
-
setProperties
public void setProperties(java.lang.String theGroup, java.util.Set<IRI> theProperties)Description copied from interface:SensitivePropertyManagerAssociates a set of properties with a group name. If the set is empty then the grouped will be removed except for the default group that will always exist even with empty set of properties. If the group already existed, associated properties will be replaced with the given properties. New groups will be added with the given properties.- Specified by:
setPropertiesin interfaceSensitivePropertyManager- Parameters:
theGroup- schema nametheProperties- set of named graphs
-
-