Package org.dspace.ctask.replicate
Class ReplicaManager
- java.lang.Object
-
- org.dspace.ctask.replicate.ReplicaManager
-
public class ReplicaManager extends Object
Singleton access point for communicating with replication access providers. ReplicaManager adds a thin accounting or bookkeeping layer, recording activity with the storage provider.- Author:
- richardrodgers
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcanonicalId(String storageId)Convert a Storage ID back into a Canonical Identifier (opposite of 'storageId()' method).StringdeletionCatalogId(String objId, String fileExtension)Determine the ID of an object's deletion catalog in storage.FilefetchObject(org.dspace.core.Context context, String group, String objId)OdometergetOdometer()static ReplicaManagerinstance()booleanmoveObject(String srcGroup, String destGroup, String objId)StringobjectAttribute(String group, String objId, String attrName)booleanobjectExists(String group, String objId)voidremoveObject(String group, String objId)Filestage(org.dspace.core.Context context, String group, String id)StringstorageId(org.dspace.core.Context context, String objId, String fileExtension)Determine the Identifier of an object once it is placed in storage.voidtransferObject(String group, File file)
-
-
-
Method Detail
-
instance
public static ReplicaManager instance() throws IOException
- Throws:
IOException
-
storageId
public String storageId(org.dspace.core.Context context, String objId, String fileExtension)
Determine the Identifier of an object once it is placed in storage. This method ensures any special characters are escaped. It also ensures all objects are named in a similar manner once they are in a given store (so that they can similarly be retrieved from storage using this same 'storageId').- Parameters:
context- the context to useobjId- - original object id (canonical ID)fileExtension- - file extension, if any (may be null)- Returns:
- reformatted storage ID for this object (including file extension)
-
canonicalId
public String canonicalId(String storageId)
Convert a Storage ID back into a Canonical Identifier (opposite of 'storageId()' method).- Parameters:
storageId- the given object's storage ID- Returns:
- the objects canonical identifier
-
deletionCatalogId
public String deletionCatalogId(String objId, String fileExtension)
Determine the ID of an object's deletion catalog in storage. This method ensures any special characters are escaped. It also ensures all objects are named in a similar manner once they are in a given store (so that they can similarly be retrieved from storage using this same 'storageId').- Parameters:
objId- - original object id (canonical ID)fileExtension- - file extension, if any (may be null)- Returns:
- reformatted storage ID for this object (including file extension)
-
getOdometer
public Odometer getOdometer() throws IOException
- Throws:
IOException
-
fetchObject
public File fetchObject(org.dspace.core.Context context, String group, String objId) throws IOException
- Throws:
IOException
-
transferObject
public void transferObject(String group, File file) throws IOException
- Throws:
IOException
-
objectExists
public boolean objectExists(String group, String objId) throws IOException
- Throws:
IOException
-
objectAttribute
public String objectAttribute(String group, String objId, String attrName) throws IOException
- Throws:
IOException
-
removeObject
public void removeObject(String group, String objId) throws IOException
- Throws:
IOException
-
moveObject
public boolean moveObject(String srcGroup, String destGroup, String objId) throws IOException
- Throws:
IOException
-
-