Class DuraCloudObjectStore

  • All Implemented Interfaces:
    ObjectStore

    public class DuraCloudObjectStore
    extends Object
    implements ObjectStore
    DuraCloudReplicaStore invokes the DuraCloud RESTful web service API, (using a java client library) rather than using the rsync tool.
    Author:
    richardrodgers
    • Constructor Detail

      • DuraCloudObjectStore

        public DuraCloudObjectStore()
    • Method Detail

      • setContentStore

        protected void setContentStore​(org.duracloud.client.ContentStore contentStore)
      • fetchObject

        public long fetchObject​(String group,
                                String id,
                                File file)
                         throws IOException
        Description copied from interface: ObjectStore
        Fetches a copy of the object with passed ID, and places it in passed file.
        Specified by:
        fetchObject in interface ObjectStore
        Parameters:
        group - Group
        id - ID
        file - File
        Returns:
        number of bytes the replica used
        Throws:
        IOException - if I/O error
      • objectExists

        public boolean objectExists​(String group,
                                    String id)
                             throws IOException
        Description copied from interface: ObjectStore
        Returns whether an object with the passed id exists in the store.
        Specified by:
        objectExists in interface ObjectStore
        Parameters:
        group - Group
        id - ID
        Returns:
        true if a representation of the object named by ID exists
        Throws:
        IOException - if I/O error
      • removeObject

        public long removeObject​(String group,
                                 String id)
                          throws IOException
        Description copied from interface: ObjectStore
        Removes the passed object from the store.
        Specified by:
        removeObject in interface ObjectStore
        Parameters:
        group - Group
        id - the id of the object to remove
        Returns:
        number of bytes the object was using, or 0 if object did not exist.
        Throws:
        IOException - if I/O error
      • transferObject

        public long transferObject​(String group,
                                   File file)
                            throws IOException
        Description copied from interface: ObjectStore
        Transfers a copy of this file to the object store
        Specified by:
        transferObject in interface ObjectStore
        Parameters:
        group - Group
        file - the file to transfer to store
        Returns:
        number of bytes transferred to store or 0 if transfer failed.
        Throws:
        IOException - if I/O error
      • moveObject

        public long moveObject​(String srcGroup,
                               String destGroup,
                               String id)
                        throws IOException
        Description copied from interface: ObjectStore
        Moves the passed object from one storage group to another.
        Specified by:
        moveObject in interface ObjectStore
        Parameters:
        srcGroup - source group
        destGroup - destination group
        id - the id of the object to move between groups
        Returns:
        number of bytes moved or 0 if move failed.
        Throws:
        IOException - if I/O error
      • objectAttribute

        public String objectAttribute​(String group,
                                      String id,
                                      String attrName)
                               throws IOException
        Description copied from interface: ObjectStore
        Obtains attributes of the representation of the object with passed ID.
        Specified by:
        objectAttribute in interface ObjectStore
        Parameters:
        group - Group
        id - ID
        attrName - - name of the attribute
        Returns:
        value of the attribute if it exists, else null
        Throws:
        IOException - if I/O error