Class ConfigMgrRestImpl

  • All Implemented Interfaces:
    ConfigMgr

    public class ConfigMgrRestImpl
    extends Object
    implements ConfigMgr
    This Manager impl supplies CRUD methods used to manage properties stored within the ldap directory using HTTP access to Fortress Rest server. 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
    • Constructor Detail

      • ConfigMgrRestImpl

        public ConfigMgrRestImpl()
    • Method Detail

      • add

        public 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 error GlobalErrIds.FT_CONFIG_ALREADY_EXISTS will be thrown.

        required parameters

        Specified by:
        add in interface ConfigMgr
        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

        public 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

        Specified by:
        update in interface ConfigMgr
        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

        public void updateProperty​(String name,
                                   String key,
                                   String value,
                                   String newValue)
                            throws SecurityException
        This method will update a single property with a new value..
        Specified by:
        updateProperty in interface ConfigMgr
        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

        public void delete​(String name)
                    throws SecurityException
        Completely removes named cfg node from the directory. The name is required. If node does not exist, a SecurityException with error will be thrown.
        Specified by:
        delete in interface ConfigMgr
        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.