Class SMSEnhancedFlatFileObject


  • public class SMSEnhancedFlatFileObject
    extends SMSFlatFileObjectBase
    This is an enhancement of SMSEnhancedFlatFileObject where we modified the implementation to avoid hitting the file name length limitation on Windows Operating System. Under the base directory of the datastore, there shall be a XML file, DirectoryTree.xml which contains information on the nodes ofnthe directory tree. The attribute properties on these nodes are also stored under the base directory. The name of this property file is the hash of the distinguished name of the node.
    • Constructor Detail

      • SMSEnhancedFlatFileObject

        public SMSEnhancedFlatFileObject()
                                  throws SMSException
        Constructor for SMSEnhancedFlatFileObject.
        Throws:
        SMSException
    • Method Detail

      • getSubEntries

        protected Set getSubEntries​(String objName,
                                    String filter,
                                    String sidFilter,
                                    boolean isSubConfig,
                                    int numOfEntries,
                                    boolean sortResults,
                                    boolean ascendingOrder)
                             throws SMSException
        Real routine to get sub entries, used by subEntries() and schemaSubEntries().
        Specified by:
        getSubEntries in class SMSFlatFileObjectBase
        Throws:
        ServiceNotFoundException - if the configuration object is not found.
        SchemaException - if a sub directory name is not in the expected "ou=..." format.
        ServiceNotFoundException - if the configuration object is not found.
        SchemaException - if a sub directory name is not in the expected "ou=..." format.
        SMSException
      • read

        public Map read​(SSOToken token,
                        String objName)
                 throws SMSException,
                        SSOException
        Reads in attributes of a configuration object.
        Specified by:
        read in class SMSObject
        Parameters:
        token - Ignored argument. Access check is assumed to have occurred before reaching this method.
        objName - Name of the configuration object, expected to be a dn.
        Returns:
        A Map with the coniguration object's attributes or null if the configuration object does not exist or no attributes are found.
        Throws:
        SMSException - if an IO error occurred during the read.
        SchemaException - if a format error occurred while reading the attributes properties file.
        IllegalArgumentException - if objName argument is null or empty.
        SSOException
      • create

        public void create​(SSOToken token,
                           String objName,
                           Map attrs)
                    throws SMSException,
                           SSOException
        Creates the configuration object. Creates the directory for the object and the attributes properties file with the given attributes.
        Specified by:
        create in class SMSObject
        Parameters:
        token - Ignored argument. Access check is assumed to have occurred before reaching this method.
        objName - Name of the configuration object to create. Name is expected to be a dn.
        attrs - Map of attributes for the object.
        Throws:
        IllegalArgumentException - if the objName or attrs argument is null or empty.
        ServiceAlreadyExistsException - if the configuration object already exists.
        SMSException - if an IO error occurred while creating the configuration object.
        SSOException
      • modify

        public void modify​(SSOToken token,
                           String objName,
                           ModificationItem[] mods)
                    throws SMSException,
                           SSOException
        Modifies the attributes for the given configuration object.
        Specified by:
        modify in class SMSObject
        Parameters:
        token - Ignored argument. Access check is assumed to have occurred before reaching this method.
        objName - Name of the configuration object to modify. Name is expected to be a dn.
        mods - Array of attributes to modify.
        Throws:
        IllegalArgumentException - if objName or mods argument is null or empty, or if an error was encountered getting attributes from the mods argument.
        ServiceNotFoundException - if the attributes properties file for the configuration object is not found.
        SchemaException - if a format error occurred while reading in the existing attributes properties file.
        SMSException - if an IO error occurred while reading or writing to the attributes properties file.
        SSOException
      • delete

        public void delete​(SSOToken token,
                           String objName)
                    throws SMSException,
                           SSOException
        Deletes the configuration object and all objects below it.
        Specified by:
        delete in class SMSObject
        Parameters:
        token - Ignored argument. Access check is assumed to have occurred before reaching this method.
        objName - Name of the configuration object to delete. Name is expected to be a dn.
        Throws:
        IllegalArgumentException - if objName argument is null or empty.
        SMSException - if any files for or under the configuration object could not be removed.
        SSOException
      • entryExists

        public boolean entryExists​(SSOToken token,
                                   String objName)
        Returns ture if the configuration object exists.
        Specified by:
        entryExists in class SMSObject
        Parameters:
        token - Ignored argument. Access check is assumed to have occurred before reaching this method.
        objName - Name of the configuration object to check.
        Returns:
        true>/code> if the configuration object exists.
        Throws:
        IllegalArgumentException - if objName is null or empty.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a String representing the name of this class.