Interface ConfigMgr
-
- All Known Implementing Classes:
ConfigMgrImpl
,ConfigMgrRestImpl
public interface ConfigMgr
This interface prescribes CRUD methods used to manage properties stored within the ldap directory. The Fortress config nodes are used to remotely share Fortress client specific properties between processes. Fortress places no limits on the number of unique configurations that can be present at one time in the directory. The Fortress client will specify the preferred cfg node by name via a property named,GlobalIds.CONFIG_REALM
. Each process using Fortress client is free to share an existing node with other processes or create its own unique config instance using the methods within this class.
This class is thread safe.
- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Configuration
add(Configuration cfg)
Create a new cfg node with given name and properties.void
delete(String name)
Completely removes named cfg node from the directory.void
delete(String name, Properties inProps)
Delete properties from existing cfg node.Configuration
getIds(String name)
Read an existing cfg node with given name and return posixIds to caller.Configuration
read(String name)
Read an existing cfg node with given name and return to caller.Configuration
update(Configuration cfg)
Update existing cfg node with additional properties, or, replace existing properties.void
updateProperty(String name, String key, String value, String newValue)
This method will update a single property with a new value..
-
-
-
Method Detail
-
add
Configuration add(Configuration cfg) throws SecurityException
Create a new cfg node with given name and properties. The name is required. If node already exists,SecurityException
with errorGlobalErrIds.FT_CONFIG_ALREADY_EXISTS
will be thrown.required parameters
- Parameters:
cfg
- contains the name and optional attributes.- Configuration#name - contains the name of new object being added
optional parameters
- Configuration#props - List of name / value pairs corresponding to fortress configuration entries.
- Configuration#uidNumber - String containing valid integer value for sequence number
- Configuration#gidNumber - String containing valid integer value for sequence number
- Returns:
- Configuration - contains the configuration entity that was added.
- Throws:
SecurityException
- in the event entry already present or other system error.
-
update
Configuration update(Configuration cfg) throws SecurityException
Update existing cfg node with additional properties, or, replace existing properties. The name is required. If node does not exist, a org.apache.directory.fortress.core.SecurityException with error org.apache.directory.fortress.core.GlobalErrIds#FT_CONFIG_NOT_FOUND will be thrown.required parameters
- Parameters:
cfg
- contains the name and optional attributes.- Configuration#name - contains the name of new object being added
optional parameters
- Configuration#props - List of name / value pairs corresponding to fortress configuration entries.
- Configuration#uidNumber - String containing valid integer value for sequence number
- Configuration#gidNumber - String containing valid integer value for sequence number
- Returns:
- Configuration - contains the configuration entity that was added.
- Throws:
SecurityException
- in the event entry not present or other system error.
-
updateProperty
void updateProperty(String name, String key, String value, String newValue) throws SecurityException
This method will update a single property with a new value..- Parameters:
name
- of the config node, mostly likely 'DEFAULT'.key
- used for the property.value
- this is old value to be replaced with newValue.newValue
- new value for the property- Throws:
SecurityException
- in the event entry not present or other system error.
-
delete
void delete(String name) throws SecurityException
Completely removes named cfg node from the directory. The name is required. If node does not exist, aSecurityException
with errorwill be thrown.
- Parameters:
name
- is required and maps to 'cn' attribute on 'device' object class of node targeted for operation.- Throws:
SecurityException
- in the event of system error.
-
delete
void delete(String name, Properties inProps) throws SecurityException
Delete properties from existing cfg node. The name is required. If node does not exist, aSecurityException
with errorGlobalErrIds.FT_CONFIG_NOT_FOUND
will be thrown.- Parameters:
name
- attribute is required and maps to 'cn' attribute in 'device' object class.inProps
- contains the properties to remove.- Throws:
SecurityException
- in the event entry not present or other system error.
-
read
Configuration read(String name) throws SecurityException
Read an existing cfg node with given name and return to caller. The name is required. If node doesn't exist, aSecurityException
with errorGlobalErrIds.FT_CONFIG_NOT_FOUND
will be thrown.- Parameters:
name
- attribute is required and maps to 'cn' attribute in 'device' object class.- Returns:
Configuration
containing the collection of name/value pairs present. Maps to 'ftProps' attribute in 'ftProperties' object class.- Throws:
SecurityException
- in the event entry doesn't exist or other system error.
-
getIds
Configuration getIds(String name) throws SecurityException
Read an existing cfg node with given name and return posixIds to caller. The name is required. If node doesn't exist, aSecurityException
with errorGlobalErrIds.FT_CONFIG_NOT_FOUND
will be thrown.- Parameters:
name
- attribute is required and maps to 'cn' attribute in 'device' object class.- Returns:
Configuration
entity contains the getPosixIds on the specified node.- Throws:
SecurityException
- in the event entry doesn't exist or other system error.
-
-