Class DirectoryLayout

    • Field Detail

      • mFileServers

        protected java.util.Map<FileServerType.OPERATION,​java.util.List<FileServer>> mFileServers
        The list of file servers that can be used to write to access this directory indexed by operation type.
      • mInternalMount

        protected InternalMountPoint mInternalMount
        The internal mount point for the directory.
    • Constructor Detail

      • DirectoryLayout

        public DirectoryLayout()
        The default constructor.
      • DirectoryLayout

        public DirectoryLayout​(DirectoryLayout directory)
        The copy constructor
      • DirectoryLayout

        public DirectoryLayout​(java.util.Map<FileServerType.OPERATION,​java.util.List<FileServer>> fs,
                               InternalMountPoint imt)
        The overloaded constructor
        Parameters:
        fs - map of file servers indexed by FileServer operation
        imt - the internal mount point.
    • Method Detail

      • initialize

        private void initialize()
        Initializes the object
      • initialize

        private void initialize​(java.util.Map<FileServerType.OPERATION,​java.util.List<FileServer>> fs,
                                InternalMountPoint imt)
        Initializes the object
        Parameters:
        fs - list of file servers indexed by operation type
        imt - the internal mount point.
      • addFileServer

        public void addFileServer​(FileServer server)
        Adds a FileServer that can access this directory.
        Parameters:
        server - the file server.
      • setFileServers

        public void setFileServers​(java.util.List<FileServer> servers)
        Sets the list of FileServers that can access this directory.
        Parameters:
        servers - the list of servers
      • selectFileServer

        public FileServer selectFileServer​(FileServerType.OPERATION operation)
        Selects a random file server and returns it matching an operation type. If not found matching the operation type it defaults back to the all operation server.
        Parameters:
        operation - the operation for which the file server is required
        Returns:
        FileServer else null
      • getFileServers

        public java.util.List<FileServer> getFileServers​(FileServerType.OPERATION operation)
        Selects all file servers and returns it matching an operation type.
        Parameters:
        operation - the operation for which the file server is required
        Returns:
        List of FileServer else null
      • hasFileServerForGETOperations

        public boolean hasFileServerForGETOperations()
        A convenience method that retrieves whether the directory has a file server for get operations ( file server with type get and all )
        Returns:
        boolean
      • hasFileServerForPUTOperations

        public boolean hasFileServerForPUTOperations()
        A convenience method that retrieves whether the directory has a file server for put operations ( file server with type put and all )
        Returns:
        boolean
      • hasFileServerForOperations

        public boolean hasFileServerForOperations​(FileServerType.OPERATION operation)
        A convenience method that retrieves whether the directory has a file server for a particular operation. Servers with operation type as ALL are also considered.
        Parameters:
        operation - the operation for which we need the file servers
        Returns:
        boolean
      • getFileServersIterator

        public java.util.Iterator<FileServer> getFileServersIterator​(FileServerType.OPERATION operation)
        Returns at iterator to the file servers.
        Returns:
        Iterator
      • setInternalMountPoint

        public void setInternalMountPoint​(InternalMountPoint mountPoint)
        Sets the internal mount point for the directory.
        Parameters:
        mountPoint - the internal mount point.
      • getInternalMountPoint

        public InternalMountPoint getInternalMountPoint()
        Returns the internal mount point for the directory.
        Returns:
        the internal mount point.
      • isEmpty

        public boolean isEmpty()
        A convenience method that returns true if all the attributes values are uninitialized or empty strings. Useful for serializing the object as XML.
        Returns:
        boolean
      • resetFileServers

        public void resetFileServers()
        Resets the internal collection of file servers
      • clone

        public java.lang.Object clone()
        Returns the clone of the object.
        Overrides:
        clone in class AbstractSiteData
        Returns:
        the clone