Package org.dspace.ctask.replicate
Interface ObjectStore
-
- All Known Implementing Classes:
DuraCloudObjectStore,LocalObjectStore,MountableObjectStore
public interface ObjectStoreAn ObjectStore provides access to a managed store containing objects that possess a set of attributes. ObjectStores allow storage within named containers, here called groups.- Author:
- richardrodgers
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longfetchObject(String group, String id, File file)Fetches a copy of the object with passed ID, and places it in passed file.voidinit()Initializes the storage service for use.longmoveObject(String srcgroup, String destGroup, String id)Moves the passed object from one storage group to another.StringobjectAttribute(String group, String id, String attrName)Obtains attributes of the representation of the object with passed ID.booleanobjectExists(String group, String id)Returns whether an object with the passed id exists in the store.longremoveObject(String group, String id)Removes the passed object from the store.longtransferObject(String group, File file)Transfers a copy of this file to the object store
-
-
-
Method Detail
-
init
void init() throws IOException
Initializes the storage service for use.- Throws:
IOException- if I/O error
-
objectExists
boolean objectExists(String group, String id) throws IOException
Returns whether an object with the passed id exists in the store.- Parameters:
group- Groupid- ID- Returns:
- true if a representation of the object named by ID exists
- Throws:
IOException- if I/O error
-
objectAttribute
String objectAttribute(String group, String id, String attrName) throws IOException
Obtains attributes of the representation of the object with passed ID.- Parameters:
group- Groupid- IDattrName- - name of the attribute- Returns:
- value of the attribute if it exists, else null
- Throws:
IOException- if I/O error
-
fetchObject
long fetchObject(String group, String id, File file) throws IOException
Fetches a copy of the object with passed ID, and places it in passed file.- Parameters:
group- Groupid- IDfile- File- Returns:
- number of bytes the replica used
- Throws:
IOException- if I/O error
-
transferObject
long transferObject(String group, File file) throws IOException
Transfers a copy of this file to the object store- Parameters:
group- Groupfile- the file to transfer to store- Returns:
- number of bytes transferred to store or 0 if transfer failed.
- Throws:
IOException- if I/O error
-
removeObject
long removeObject(String group, String id) throws IOException
Removes the passed object from the store.- Parameters:
group- Groupid- 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
-
moveObject
long moveObject(String srcgroup, String destGroup, String id) throws IOException
Moves the passed object from one storage group to another.- Parameters:
srcgroup- source groupdestGroup- destination groupid- 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
-
-