Class SMSFlatFileTreeNode


  • public class SMSFlatFileTreeNode
    extends Object
    This is a node in the directory tree that the SMSEnhancedFlatFileObject class holds to track the directory structure of the data.
    • Constructor Detail

      • SMSFlatFileTreeNode

        public SMSFlatFileTreeNode​(String dn)
        Creates a new instance of SMSFlatFileTreeNode
    • Method Detail

      • getParentNode

        public SMSFlatFileTreeNode getParentNode()
        Returns parent node.
        Returns:
        parent node.
      • addChild

        public boolean addChild​(SMSFlatFileTreeNode child)
        Adds child.
        Parameters:
        child - Child node.
        Returns:
        true if child is added to the tree.
        Throws:
        SMSException - if the dn of the child is not prefix with this node.
      • removeChild

        public boolean removeChild​(SMSFlatFileTreeNode node,
                                   String baseDir)
        Removes a child node from the tree.
        Parameters:
        node - Node of to be removed.
        baseDir - Base directory where data files are stored.
      • getAttributeFilename

        public String getAttributeFilename​(String dn,
                                           String baseDir)
        Returns the attribute file name of a node.
        Parameters:
        dn - Distinguished Name of the node.
        baseDir - Base Directory.
        Returns:
        the attribute file name of a node.
      • getAttributeFilename

        public String getAttributeFilename​(String baseDir)
        Returns the attribute file name of this node.
        Parameters:
        baseDir - Base Directory.
        Returns:
        the attribute file name of a node.
      • isExists

        public boolean isExists​(String baseDir,
                                String dn)
        Returns true is a node of a given dn exists.
        Parameters:
        baseDir - Base Directory.
        dn - Distinguished name of the node.
        Returns:
        true is a node of a given dn exists.
      • getChild

        public SMSFlatFileTreeNode getChild​(String dn)
        Returns the node of a given distinguished name.
        Parameters:
        dn - Distinguished Name of the node.
        Returns:
        the node of a given distinguished name.
      • searchChildren

        public Set searchChildren​(NodeNameFilter filter,
                                  boolean recursive)
        Searches for nodes that matches with a given filter.
        Parameters:
        filter - Search filter.
        recursive - true to perform search recursively.
        Returns:
        a set of node of class, SMSFlatFileTreeNode.
      • getDN

        public String getDN()
        Returns distinguished name.
        Returns:
        distinguished name.
      • getName

        public String getName()
        Returns name.
        Returns:
        name.
      • equals

        public boolean equals​(Object o)
        Returns true if this node is identical to other.
        Overrides:
        equals in class Object
        Parameters:
        o - Other node.
        Returns:
        true if this node is identical to other.
      • hashCode

        public int hashCode()
        Returns hash code.
        Overrides:
        hashCode in class Object
        Returns:
        hash code.
      • toXML

        public String toXML()
        Returns XML String of this tree.
        Returns:
        XML String of this tree.
      • createTree

        public static SMSFlatFileTreeNode createTree​(String xml,
                                                     Debug debug)
                                              throws Exception
        Creates directory tree from a XML.
        Parameters:
        xml - XML string.
        debug - Debugger.
        Returns:
        the root node of the tree.
        Throws:
        Exception