public interface MainStorageInterface
Modifier and Type | Method and Description |
---|---|
void |
delete(DsInfo dsInfo)
Deletes the files of the specified data set.
|
void |
delete(String location,
String createId,
String modId)
Deletes the specified file
Implementations must not throw an error if the file does
not exist in the storage.
|
boolean |
exists(DsInfo dsInfo)
See if the data set exists.
|
boolean |
exists(String location)
See if the data file exists.
|
InputStream |
get(String location,
String createId,
String modId)
Return a stream of data from the specified data file
|
List<DfInfo> |
getDatafilesToArchive(long lowArchivingLevel,
long highArchivingLevel)
Return the list of DfInfos which should be archived to reduce the used
storage to between lowArchivingLevel and highArchivingLevel.
|
List<DsInfo> |
getDatasetsToArchive(long lowArchivingLevel,
long highArchivingLevel)
Return the list of DsInfos which should be archived to reduce the used
storage to between lowArchivingLevel and highArchivingLevel.
|
Path |
getPath(String location,
String createId,
String modId)
Return the physical path corresponding to a location for a datafile.
|
AutoCloseable |
lock(DsInfo dsInfo,
boolean shared)
Place a lock on the dataset in the storage.
|
String |
put(DsInfo dsInfo,
String name,
InputStream inputStream)
Store the specified data file and return the chosen location of the file
to allow it to be retrieved.
|
void |
put(InputStream inputStream,
String location)
Store the data file at the specified location.
|
void delete(DsInfo dsInfo) throws IOException
dsInfo
- describes the data set with the files to be deletedIOException
- to indicate failurevoid delete(String location, String createId, String modId) throws IOException
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 failureboolean exists(DsInfo dsInfo)
dsInfo
- describes the data set being queriedboolean exists(String location)
location
- the value from datafile.locationInputStream get(String location, String createId, String modId) throws IOException
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 failureList<DfInfo> getDatafilesToArchive(long lowArchivingLevel, long highArchivingLevel) throws IOException
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 failureList<DsInfo> getDatasetsToArchive(long lowArchivingLevel, long highArchivingLevel) throws IOException
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 failurePath getPath(String location, String createId, String modId) throws IOException
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 failureString put(DsInfo dsInfo, String name, InputStream inputStream) throws IllegalArgumentException, IOException
dsInfo
- describes the data set to which the data file should be addedname
- name of file within data setinputStream
- stream of data to storeIllegalArgumentException
- if the creation of the file has been refused because either
the name or any attribute of dsinfo is not acceptable.IOException
- to indicate failurevoid put(InputStream inputStream, String location) throws IOException
inputStream
- stream of data to storelocation
- where to store the fileIOException
- to indicate failureAutoCloseable lock(DsInfo dsInfo, boolean shared) throws AlreadyLockedException, IOException
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.