Skip to content

Commit

Permalink
Rename BitStore to BitStoreService, and DSBitStore, S3BitStore
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdietz committed Jan 7, 2016
1 parent 059dcc1 commit d556d9a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
Expand Up @@ -19,7 +19,7 @@
* @author Richard Rodgers, Peter Dietz
*/

public interface BitStore
public interface BitStoreService
{
/**
* Initialize the asset store
Expand Down
Expand Up @@ -7,13 +7,8 @@
*/
package org.dspace.storage.bitstore;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import java.util.*;

Expand All @@ -32,13 +27,6 @@
import org.dspace.core.Utils;
import org.dspace.storage.bitstore.service.BitstreamStorageService;

import edu.sdsc.grid.io.FileFactory;
import edu.sdsc.grid.io.GeneralFile;
import edu.sdsc.grid.io.GeneralFileOutputStream;
import edu.sdsc.grid.io.local.LocalFile;
import edu.sdsc.grid.io.srb.SRBAccount;
import edu.sdsc.grid.io.srb.SRBFile;
import edu.sdsc.grid.io.srb.SRBFileSystem;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

Expand Down Expand Up @@ -81,7 +69,7 @@ public class BitstreamStorageServiceImpl implements BitstreamStorageService, Ini
protected ChecksumHistoryService checksumHistoryService;

/** asset stores */
private static BitStore[] stores;
private static BitStoreService[] stores;

/** The index of the asset store to use for new bitstreams */
private static int incoming;
Expand Down Expand Up @@ -120,7 +108,7 @@ public void afterPropertiesSet() {
}

log.info("LIST: " + ArrayUtils.toString(list));
stores = (BitStore[])list.toArray(new BitStore[list.size()]);
stores = (BitStoreService[])list.toArray(new BitStoreService[list.size()]);
// Read asset store to put new files in. Default is 0.
incoming = ConfigurationManager.getIntProperty("assetstore.incoming");
}
Expand Down Expand Up @@ -180,7 +168,7 @@ private static void initStore(String storeConfig, List list)
log.info("BitStore name: " + className);
try
{
BitStore store = (BitStore)Class.forName(className).newInstance();
BitStoreService store = (BitStoreService)Class.forName(className).newInstance();
store.init(config);
list.add(store);
}
Expand Down
Expand Up @@ -25,10 +25,10 @@
* @author Peter Breton, Robert Tansley, Richard Rodgers, Peter Dietz
*/

public class DSBitStore implements BitStore
public class DSBitStoreService implements BitStoreService
{
/** log4j log */
private static Logger log = Logger.getLogger(DSBitStore.class);
private static Logger log = Logger.getLogger(DSBitStoreService.class);

// These settings control the way an identifier is hashed into
// directory and file names
Expand All @@ -50,7 +50,7 @@ public class DSBitStore implements BitStore
/** the asset directory */
private File baseDir = null;

public DSBitStore()
public DSBitStoreService()
{
}

Expand Down
Expand Up @@ -26,8 +26,6 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;

Expand All @@ -39,10 +37,10 @@
* @author Richard Rodgers, Peter Dietz
*/

public class S3BitStore implements BitStore
public class S3BitStoreService implements BitStoreService
{
/** log4j log */
private static Logger log = Logger.getLogger(S3BitStore.class);
private static Logger log = Logger.getLogger(S3BitStoreService.class);

/** Checksum algorithm */
private static final String CSA = "MD5";
Expand All @@ -56,7 +54,7 @@ public class S3BitStore implements BitStore
/** S3 service */
private AmazonS3 s3Service = null;

public S3BitStore()
public S3BitStoreService()
{
}

Expand Down Expand Up @@ -329,7 +327,7 @@ else if (args[i].startsWith("-f"))
System.out.println("Missing arguments - exiting");
return;
}
S3BitStore store = new S3BitStore();
S3BitStoreService store = new S3BitStoreService();

AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey);

Expand Down
4 changes: 2 additions & 2 deletions dspace/config/dspace.cfg
Expand Up @@ -122,8 +122,8 @@ mail.allowed.referrers = ${dspace.hostname}
## DSpace 6+ assetstore config
# Configure the bitstore implementations
## bitstore.<short-name>.class=<implementation-class-canonical-name>
bitstore.ds.class=org.dspace.storage.bitstore.DSBitStore
bitstore.s3.class=org.dspace.storage.bitstore.S3BitStore
bitstore.ds.class=org.dspace.storage.bitstore.DSBitStoreService
bitstore.s3.class=org.dspace.storage.bitstore.S3BitStoreService

# Configure the assetstore
# DSBitstore is only configured with directory to store assets
Expand Down

0 comments on commit d556d9a

Please sign in to comment.