public class TestArcRepositoryClient extends TrivialArcRepositoryClient
Modifier and Type | Field and Description |
---|---|
File |
arcDir |
int |
batchCounter
How many times batch has been called
|
boolean |
batchMustDie
Whether the batch call should die with an exception
|
int |
batchPauseMilliseconds
How many milliseconds the batch should pause before running
|
File |
tmpDir |
Constructor and Description |
---|
TestArcRepositoryClient(File arcdir) |
Modifier and Type | Method and Description |
---|---|
BatchStatus |
batch(FileBatchJob job,
String replicaId,
String... args)
Runs a batch batch job on each file in the ArcRepository.
|
BitarchiveRecord |
get(String arcfile,
long index)
Gets a single ARC record out of the ArcRepository.
|
void |
getFile(String arcfilename,
Replica replica,
File toFile)
Retrieves a file from an ArcRepository and places it in a local file.
|
close, correct, getAllChecksums, getAllFilenames, getChecksum, removeAndGetFile, store, updateAdminChecksum, updateAdminData
public int batchCounter
public boolean batchMustDie
public int batchPauseMilliseconds
public TestArcRepositoryClient(File arcdir)
public void getFile(String arcfilename, Replica replica, File toFile)
TrivialArcRepositoryClient
getFile
in interface ArcRepositoryClient
getFile
in interface PreservationArcRepositoryClient
getFile
in interface ViewerArcRepositoryClient
getFile
in class TrivialArcRepositoryClient
arcfilename
- Name of the arcfile to retrieve.replica
- The bitarchive to retrieve the data from (not used in this implementation)toFile
- Filename of a place where the file fetched can be put.public BitarchiveRecord get(String arcfile, long index) throws ArgumentNotValid
TrivialArcRepositoryClient
get
in interface ArcRepositoryClient
get
in interface PreservationArcRepositoryClient
get
in interface ViewerArcRepositoryClient
get
in class TrivialArcRepositoryClient
arcfile
- The name of a file containing the desired record.index
- The offset of the desired record in the fileArgumentNotValid
- if arcfile is null or empty, or index is negativepublic BatchStatus batch(FileBatchJob job, String replicaId, String... args)
TrivialArcRepositoryClient
batch
in interface ArcRepositoryClient
batch
in interface PreservationArcRepositoryClient
batch
in interface ViewerArcRepositoryClient
batch
in class TrivialArcRepositoryClient
job
- An object that implements the FileBatchJob interface. The initialize() method will be called before
processing and the finish() method will be called afterwards. The process() method will be called with each File
entry. An optional function postProcess() allows handling the combined results of the batchjob, e.g. summing the
results, sorting, etc.replicaId
- The archive to execute the job on (not used in this implementation)args
- The arguments for the batchjob.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.