public class IdsClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
IdsClient.Flag
Defines packaging options
|
class |
IdsClient.ServiceStatus
Returned by the getServiceStatus call
|
static class |
IdsClient.Status
Values to be returned by the
getStatus() calls. |
| Modifier and Type | Method and Description |
|---|---|
void |
archive(String sessionId,
DataSelection dataSelection)
Archive data specified by the dataSelection.
|
void |
delete(String sessionId,
DataSelection dataSelection)
Delete data specified by the dataSelection.
|
InputStream |
getData(String sessionId,
DataSelection dataSelection,
IdsClient.Flag flags,
String outname,
long offset)
Get the data specified by the dataSelection.
|
InputStream |
getData(String preparedId,
String outname,
long offset)
Get the data using the preparedId returned by a call to prepareData
|
URL |
getDataUrl(String sessionId,
DataSelection dataSelection,
IdsClient.Flag flags,
String outname)
Get the URL to retrieve the data specified by the dataSelection.
|
URL |
getDataUrl(String preparedId,
String outname)
Get the URL to retrieve the data specified by the preparedId returned by a call to
prepareData
|
IdsClient.ServiceStatus |
getServiceStatus(String sessionId)
Return a ServiceStatus object to understand what the IDS is doing.
|
IdsClient.Status |
getStatus(String sessionId,
DataSelection dataSelection)
Return the status of the data specified by the dataSelection.
|
boolean |
isPrepared(String preparedId)
Returns true if the data identified by the preparedId returned by a call to prepareData is
ready.
|
void |
ping()
Check that the server is alive and is an IDS server
|
String |
prepareData(String sessionId,
DataSelection dataSelection,
IdsClient.Flag flags)
Prepare data for a subsequent getData call.
|
Long |
put(String sessionId,
InputStream inputStream,
String name,
long datasetId,
long datafileFormatId,
String description)
Put the data in the inputStream into a data file and catalogue it.
|
Long |
put(String sessionId,
InputStream inputStream,
String name,
long datasetId,
long datafileFormatId,
String description,
String doi,
Date datafileCreateTime,
Date datafileModTime)
Put the data in the inputStream into a data file and catalogue it.
|
void |
restore(String sessionId,
DataSelection dataSelection)
Restore data specified by the dataSelection.
|
public IdsClient(URL idsUrl)
idsUrl - The URL of the ids server host. This should be of the form
https://example.com:443.public void archive(String sessionId, DataSelection dataSelection) throws NotImplementedException, BadRequestException, InsufficientPrivilegesException, InternalException, NotFoundException
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionInternalExceptionNotFoundExceptionpublic void delete(String sessionId, DataSelection dataSelection) throws NotImplementedException, BadRequestException, InsufficientPrivilegesException, InternalException, NotFoundException, DataNotOnlineException
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionInternalExceptionNotFoundExceptionDataNotOnlineExceptionpublic InputStream getData(String sessionId, DataSelection dataSelection, IdsClient.Flag flags, String outname, long offset) throws NotImplementedException, BadRequestException, InsufficientPrivilegesException, NotFoundException, InternalException, DataNotOnlineException
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyflags - To select packing optionsoutname - The name of the file. If it is in .zip format the .zip extension will be added if
not present.offset - Skip this number of bytes in the returned streamNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionNotFoundExceptionInternalExceptionDataNotOnlineExceptionpublic InputStream getData(String preparedId, String outname, long offset) throws NotImplementedException, BadRequestException, InsufficientPrivilegesException, NotFoundException, InternalException, DataNotOnlineException
preparedId - A valid preparedId returned by a call to prepareDataoutname - The name of the file. If it is in .zip format the .zip extension will be added if
not present.offset - Skip this number of bytes in the returned streamNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionNotFoundExceptionInternalExceptionDataNotOnlineExceptionpublic URL getDataUrl(String sessionId, DataSelection dataSelection, IdsClient.Flag flags, String outname)
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyflags - To select packing optionsoutname - The name of the file. If it is in .zip format the .zip extension will be added if
not present.public URL getDataUrl(String preparedId, String outname)
preparedId - A valid preparedId returned by a call to prepareDataoutname - The name of the file. If it is in .zip format the .zip extension will be added if
not present.public IdsClient.ServiceStatus getServiceStatus(String sessionId) throws InternalException, InsufficientPrivilegesException
sessionId - A valid ICAT session ID of a user in the IDS rootUserNames set.InternalExceptionInsufficientPrivilegesExceptionpublic IdsClient.Status getStatus(String sessionId, DataSelection dataSelection) throws BadRequestException, NotFoundException, InsufficientPrivilegesException, InternalException, NotImplementedException
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionNotFoundExceptionInternalExceptionpublic boolean isPrepared(String preparedId) throws BadRequestException, NotFoundException, InternalException, NotImplementedException
preparedId - the id returned by a call to prepareDataBadRequestExceptionNotFoundExceptionInternalExceptionNotImplementedExceptionpublic void ping()
throws InternalException,
NotFoundException
InternalExceptionNotFoundException - If the server gives an unexpected responsepublic String prepareData(String sessionId, DataSelection dataSelection, IdsClient.Flag flags) throws NotImplementedException, BadRequestException, InsufficientPrivilegesException, NotFoundException, InternalException
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyflags - To select packing optionsNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionNotFoundExceptionInternalExceptionpublic Long put(String sessionId, InputStream inputStream, String name, long datasetId, long datafileFormatId, String description) throws BadRequestException, NotFoundException, InternalException, InsufficientPrivilegesException, NotImplementedException, DataNotOnlineException, InsufficientStorageException
sessionId - A valid ICAT session IDinputStream - the input stream providing the data to storename - the name to associate with the data filedatasetId - the id of the ICAT "Dataset" which should own the data filedatafileFormatId - the id of the ICAT "DatafileForat" to be associated with the data filedescription - Free text to associate with the data file (may be null)BadRequestExceptionNotFoundExceptionInternalExceptionInsufficientPrivilegesExceptionNotImplementedExceptionDataNotOnlineExceptionInsufficientStorageExceptionpublic Long put(String sessionId, InputStream inputStream, String name, long datasetId, long datafileFormatId, String description, String doi, Date datafileCreateTime, Date datafileModTime) throws BadRequestException, NotFoundException, InternalException, InsufficientPrivilegesException, NotImplementedException, DataNotOnlineException, InsufficientStorageException
sessionId - A valid ICAT session IDinputStream - the input stream providing the data to storename - the name to associate with the data filedatasetId - the id of the ICAT "Dataset" which should own the data filedatafileFormatId - the id of the ICAT "DatafileForat" to be associated with the data filedescription - Free text to associate with the data file. (may be null)doi - The Digital Object Identifier to associate with the data file. (may be null)datafileCreateTime - the time to record as the creation time of the datafile. If null the current time
as known to the IDS server will be stored.datafileModTime - the time to record as the modification time of the datafile. If null the value of
the datafileCreateTime or the current time as known to the IDS server if that
value is also null will be stored.BadRequestExceptionNotFoundExceptionInternalExceptionInsufficientPrivilegesExceptionNotImplementedExceptionDataNotOnlineExceptionInsufficientStorageExceptionpublic void restore(String sessionId, DataSelection dataSelection) throws NotImplementedException, BadRequestException, InsufficientPrivilegesException, InternalException, NotFoundException
sessionId - A valid ICAT session IDdataSelection - A data selection object that must not be emptyNotImplementedExceptionBadRequestExceptionInsufficientPrivilegesExceptionInternalExceptionNotFoundExceptionCopyright © 2014 The ICAT Collaboration. All rights reserved.