public abstract class AbstractMainStorage extends Object implements MainStorageInterface
Constructor and Description |
---|
AbstractMainStorage() |
Modifier and Type | Method and Description |
---|---|
void |
delete(DsInfo dsInfo)
This is a dummy implementation.
|
void |
delete(String location,
String createId,
String modId)
This is a dummy implementation.
|
boolean |
exists(DsInfo dsInfo)
This is a dummy implementation.
|
boolean |
exists(String location)
This is a dummy implementation.
|
List<DfInfo> |
getDatafilesToArchive(long lowArchivingLevel,
long highArchivingLevel)
This is a dummy implementation.
|
List<DsInfo> |
getDatasetsToArchive(long lowArchivingLevel,
long highArchivingLevel)
This is a dummy implementation.
|
Path |
getPath(String location,
String createId,
String modId)
This is a dummy implementation.
|
AutoCloseable |
lock(DsInfo dsInfo,
boolean shared)
This is a dummy implementation.
|
String |
put(DsInfo dsInfo,
String name,
InputStream inputStream)
This is a dummy implementation.
|
void |
put(InputStream inputStream,
String location)
This is a dummy implementation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public void delete(DsInfo dsInfo) throws IOException
delete
in interface MainStorageInterface
dsInfo
- describes the data set with the files to be deletedIOException
- to indicate failurepublic void delete(String location, String createId, String modId) throws IOException
delete
in interface MainStorageInterface
location
- location of the data file to be deletedcreateId
- the icat user name of the creator of this datafile. This is
provided so that the implementation can choose whether or not
to trust the ICAT datafile object which holds this location
field.modId
- the icat user name of the modifier of this datafile. This is
provided so that the implementation can choose whether or not
to trust the ICAT datafile object which holds this location
field.IOException
- to indicate failurepublic boolean exists(DsInfo dsInfo)
exists
in interface MainStorageInterface
dsInfo
- describes the data set being queriedpublic boolean exists(String location)
exists
in interface MainStorageInterface
location
- the value from datafile.locationpublic List<DfInfo> getDatafilesToArchive(long lowArchivingLevel, long highArchivingLevel) throws IOException
getDatafilesToArchive
in interface MainStorageInterface
lowArchivingLevel
- don't try to reduce space below this levelhighArchivingLevel
- if storage used is less than this return an empty list.
Otherwise identify the list of DsInfos to get the space down
to lowArchivingLevelIOException
- to indicate failurepublic List<DsInfo> getDatasetsToArchive(long lowArchivingLevel, long highArchivingLevel) throws IOException
getDatasetsToArchive
in interface MainStorageInterface
lowArchivingLevel
- don't try to reduce space below this levelhighArchivingLevel
- if storage used is less than this return an empty list.
Otherwise identify the list of DsInfos to get the space down
to lowArchivingLevelIOException
- to indicate failurepublic Path getPath(String location, String createId, String modId) throws IOException
getPath
in interface MainStorageInterface
location
- the value from datafile.locationcreateId
- the icat user name of the creator of this datafile. This is
provided so that the implementation can choose whether or not
to trust the ICAT datafile object which holds this location
field.modId
- the icat user name of the modifier of this datafile. This is
provided so that the implementation can choose whether or not
to trust the ICAT datafile object which holds this location
field.IOException
- to indicate failurepublic String put(DsInfo dsInfo, String name, InputStream inputStream) throws IOException
put
in interface MainStorageInterface
dsInfo
- describes the data set to which the data file should be addedname
- name of file within data setinputStream
- stream of data to storeIOException
- to indicate failurepublic void put(InputStream inputStream, String location) throws IOException
put
in interface MainStorageInterface
inputStream
- stream of data to storelocation
- where to store the fileIOException
- to indicate failurepublic AutoCloseable lock(DsInfo dsInfo, boolean shared) throws AlreadyLockedException, IOException
lock
in interface MainStorageInterface
dsInfo
- describes the data set to be lockedshared
- indicates whether a shared or an exclusive lock should be obtainedAlreadyLockedException
- if the lock cannot be obtained because the dataset is already lockedIOException
- to indicate failureCopyright © 2019 The ICAT Collaboration. All rights reserved.