au.edu.archer.service.ddm.impl
Class DDMServiceImpl

java.lang.Object
  extended by au.edu.archer.service.ddm.impl.DDMServiceImpl
All Implemented Interfaces:
DDMService

@Transactional(rollbackFor=BusinessException.class)
public class DDMServiceImpl
extends java.lang.Object
implements DDMService

Implements DDMService.


Constructor Summary
DDMServiceImpl()
           
 
Method Summary
 au.edu.archer.domain.icat.api.DataFile addDatafileToDataset(byte[] content, java.lang.String srbLocation, int datasetId)
          Insert the extracted meta data.
 au.edu.archer.domain.icat.api.DataFile addDatafileToDataset(SRBUploadRequest srbUploadRequest, java.lang.String srbLocation, int datasetId)
          Add a Datafile to a Dataset.
 DatasetDetails addDatasetToAnExpr(DatasetRequest request)
          Add dataset to an experiment.
 au.edu.archer.domain.icat.api.DataFile addGenericFileToDataset(SRBUploadRequest srbUploadRequest, java.lang.String srbLocation, int datasetId)
          Add a Generic File to a Dataset.
 void addGroupPermissions(SRBGroupPermissionRequest request)
          Modify group permissions.
 ProjectDetails addProject(ProjectRequest createProjectRequest)
          Create Project.
 au.edu.archer.domain.icat.api.DataFile copyDatafile(DatafileRequest request)
          Copy Datafile to another Dataset.
 DatasetDetails copyDataset(DatasetRequest request)
          Copy Dataset to another experiment.
 ExperimentDetails createExperiment(ExperimentRequest request)
          Create Experiment.
 SampleDetails createSample(SampleRequest request)
          Create sample.
 void deleteDataFile(DatafileRequest request)
          Delete DataFile by using relative path of the DataFile.
 void deleteDataset(DatasetRequest request)
          Delete dataset.
 void deleteExperiment(ExperimentRequest request)
          Delete Experiment.
 void deleteProject(ProjectRequest deleteProjectRequest)
          Delete project.
 void deleteSample(SampleRequest request)
          Delete sample.
 SRBDownloadResponse downloadSingleDataFile(SRBDownloadRequest request)
          Download a datafile from SRB.
 java.util.Map<java.lang.String,java.lang.String> getAllDataFileFormat()
          Get all existing DataFileformats.
 java.util.List<au.edu.archer.domain.icat.api.DataFile> getAllDataFiles(int datasetId)
          Get all associated datafiles for a specific dataset.
 java.util.Map<java.lang.String,java.lang.String> getAllDatasetFiles(int datasetId)
          Get all associated datafiles for a dataset.
 java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllDatasetsByExpr(int experimentId)
          Get all associasted datasets.
 java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllDatasetsBySampleId(int sampleId)
          Get all datasets by a sample.
 java.util.Map<java.lang.String,java.lang.String> getAllDatasetStatus()
          Get all available Dataset status.
 java.util.Map<java.lang.String,java.lang.String> getAllDatasetTypes()
          Get all available Dataset Types.
 java.util.List<au.edu.archer.domain.icat.api.Investigation> getAllExperimentsUnderProject(int projectId)
          Get All Experiments under this Project.
 java.util.List<au.edu.archer.domain.icat.api.InvestigationType> getAllExperimentTypes()
          Get all available experiment types.
 java.util.Map<java.lang.String,java.lang.String> getAllInvestigators()
          Get all Investigators.
 java.util.Map<java.lang.String,java.lang.String> getAllManagers()
          Get all available project managers.
 java.util.Map<java.lang.String,java.lang.String> getAllNonPackageDatasetType()
          Get all non-package Dataset Types.
 java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllNonPackagedDatasetByExpId(int experimentId)
          Get all non-packaged datasets.
 java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllPackagedDatasetsByExpId(int experimentId)
          Get all associasted datasets.
 java.util.Map<java.lang.String,java.lang.String> getAllProjectNames()
          Get all project names.
 java.util.Map<java.lang.String,java.lang.String> getAllProjectStatus()
          Retrieve a map of all available project status.
 java.util.Map<java.lang.String,java.lang.String> getAllSamplesByExpId(SampleRequest request)
          Get all samples that are attached to the given experiment id.
 java.util.Map<java.lang.String,java.lang.String> getAllSamplesByExpName(SampleRequest request)
          Get all samples that are attached to the given experiment id.
 java.util.Map<java.lang.String,java.lang.String> getAllSRBGroups(SRBRequest request)
          Retrieve all SRB groups.
 java.util.Map<java.lang.String,java.lang.String> getAllTopicNames()
          Get all Topic.
 au.edu.archer.domain.icat.api.DataFile getDataFile(int dfId)
          Get DataFile by its id.
 au.edu.archer.domain.icat.api.DataFile getDataFile(java.lang.String path)
          Get DataFile id by using relative path of the DataFile.
 au.edu.archer.domain.icat.api.DataFile getDataFile(java.lang.String projectName, java.lang.String experimentName, java.lang.String datasetName, java.lang.String datafileName)
          Get DataFile id by using project name, exepriment name, dataset name and datafile name.
 java.util.Map<java.lang.String,java.lang.String> getDatafileParametersById(DatafileRequest request)
          Retrieve datafile parameters.
 java.util.Map<java.lang.String,DatafileSliceResponse> getDatafileSliceByDatasetId(int datasetId)
          Get Datafile Slice by a Dataset Id.
 DatasetDetails getDatasetDetailsById(int datasetId, java.lang.String srbSessionId)
          Get dataset details by dataset Id.
 DatasetDetails getDatasetDetailsByName(java.lang.String projectName, java.lang.String exprName, java.lang.String datasetName, java.lang.String srbSessionId)
          Get dataset details by names.
 int getDatasetIdByHandle(java.lang.String handleId)
          Get dataset id by dataset handle id.
 java.util.Map<java.lang.String,java.lang.String> getDatasetNamesByExperimentId(int experimentId)
          getDatasetNamesByExperimentId.
 java.util.Map<java.lang.String,java.lang.String> getDatasetParametersById(DatasetRequest request)
          Retrieve Dataset parameters by Dataset Id.
 ExperimentDetails getExperimentById(int expId, java.lang.String srbSessionId)
          Get Experiment.
 ExperimentDetails getExperimentByName(ExperimentRequest request)
          Get Experiment.
 java.util.Map<java.lang.String,java.lang.String> getExperimentNamesByProjectId(int projectId)
          Get all experiment names of a given project.
 java.util.Map<java.lang.String,java.lang.String> getLock()
          Get the lock.
 java.lang.String getManagerDisplayById(int mgrId)
          Get manager display name form the Id.
 ProjectDetails getProjectDetailsById(int projectId, java.lang.String srbSessionId)
          Get project details.
 ProjectDetails getProjectDetailsByName(java.lang.String projectName, java.lang.String srbSessionId)
          Get project details.
 java.util.Map<java.lang.String,java.lang.String> getProjectGroups(SRBContentRequest request, java.lang.String contentType)
          Retrieve parent project groups.
 SampleDetails getSampleById(SampleRequest request)
          Get sample by sample id.
 java.util.Map<java.lang.String,java.lang.String> getSampleParametersById(SampleRequest request)
          Retrieve sample parameters.
 java.util.List<SRBContentInfo> getScratchDatasetDirs(SRBContentRequest request)
          Fetch all scratch area dataset directories content from SRB from the specified collection.
 java.util.List<SRBContentInfo> getSRBAll(SRBContentRequest request)
          Fetch all file content from SRB from the specified collection.
 java.util.List<SRBContentInfo> getSRBDirs(SRBContentRequest request)
          Fetch all directory content from SRB from the specified collection.
 java.util.List<SRBContentInfo> getStagingAreaContent(SRBContentRequest request)
          Get staging area contents.
 boolean isAuthorised(SRBContentRequest request, int operation)
          Check if user is authorised to perform a SRB operation.
 java.util.List<au.edu.archer.domain.icat.api.Investigator> listAllInvestigatorsByExperimentId(int expid)
          List all investigators by experiment id.
 java.util.List<au.edu.archer.domain.icat.api.TopicList> listAllTopicListsByExperimentId(int expid)
          List all TopicLists by ExperimentId.
 java.util.List<au.edu.archer.domain.icat.api.Topic> listAllTopics()
          List of all Topics.
 au.edu.archer.domain.icat.api.DataFile moveDatafile(DatafileRequest request)
          Move Datafile to another dataset.
 DatasetDetails moveDataset(DatasetRequest request)
          Move Dataset to another experiment.
 java.lang.String performDDMAuthentication(SRBLoginRequest request)
          Authorise request to perform srb related operations.
 au.edu.archer.domain.icat.impl.DataFileImpl resetDatafileParameters(DatafileRequest request)
          reset datafile parameters by re-extracting from the original file stored on SRB.
 au.edu.archer.domain.icat.api.DataFile retrieveMetadata(java.lang.String srbLocation)
          Retrieve Metadata information based on srbLocation.
 SearchResponse search(SearchRequest request)
          Search method.
 void setIcatService(ICATService icatService)
          Set icatService.
 void setLock(java.util.Map<java.lang.String,java.lang.String> lock)
          set the lock.
 void setMailService(MailService mailService)
          setMailService.
 void setMetadataExtractorService(MetadataExtractorService metadataExtractorService)
          Set MetadataExtractorService.
 void setSearchService(SearchService searchService)
          Set search service.
 void setSrbService(SRBService srbService)
          Set SRBService.
 java.lang.Thread startMETSThread(CreateMETSRequest request)
          startMETSThread.
 java.lang.Thread startPublishThread(PublishExperimentRequest request)
          startMETSThread.
 java.lang.Thread startTransferThread(java.lang.String srbSessionId, java.lang.String stagingDir, java.lang.Integer datasetId, boolean stagTransfer, java.lang.String notificationRecv)
          Transfer all files in the staging area.
 StagingContentTransferResponse transferFromStagingArea(StagingContentTransferRequest request)
          Transfer the datafiles in the staging area into a specified Dataset (TODO).
 au.edu.archer.domain.icat.api.DataFile updateDatafile(DatafileRequest request)
          Update Datafile without changing DatafileParameters.
 void updateDatafileParameters(DatafileRequest request)
          Add datafile parameters.
 DatasetDetails updateDataset(DatasetRequest request)
          Update dataset.
 void updateDatasetParameters(DatasetRequest request)
          Update Dataset parameters.
 ExperimentDetails updateExperiment(ExperimentRequest request)
          Update Experiment.
 ProjectDetails updateProject(ProjectRequest updateProjectRequest)
          Update project.
 SampleDetails updateSample(SampleRequest request)
          Update sample.
 void updateSampleParameters(SampleRequest request)
          Add sample parameters.
 au.edu.archer.domain.icat.api.DataFile uploadSingleDatafile(SRBUploadRequest srbUploadRequest)
          Upload single datafile to a dataset.
 au.edu.archer.domain.icat.api.DataFile uploadSingleGenericFile(SRBUploadRequest srbUploadRequest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDMServiceImpl

public DDMServiceImpl()
Method Detail

performDDMAuthentication

public java.lang.String performDDMAuthentication(SRBLoginRequest request)
                                          throws InvalidDDMRequestException
Authorise request to perform srb related operations.

This authorisation will return a SRB session id which shall be refrenced for further SRB related operations.

Specified by:
performDDMAuthentication in interface DDMService
Parameters:
request - SRBLoginRequest object.
Returns:
SRB session id to be used for further SRB related operations.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

isAuthorised

public boolean isAuthorised(SRBContentRequest request,
                            int operation)
                     throws InvalidSRBRequestException
Check if user is authorised to perform a SRB operation.

Specified by:
isAuthorised in interface DDMService
Parameters:
request - SRBContentRequest.
operation - operation code.
Returns:
true if authorised, false otherwise.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

getAllSRBGroups

public java.util.Map<java.lang.String,java.lang.String> getAllSRBGroups(SRBRequest request)
                                                                 throws InvalidSRBRequestException
Retrieve all SRB groups.

Specified by:
getAllSRBGroups in interface DDMService
Parameters:
request - SRBRequest object.
Returns:
Map of all SRB groups.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

getProjectGroups

public java.util.Map<java.lang.String,java.lang.String> getProjectGroups(SRBContentRequest request,
                                                                         java.lang.String contentType)
                                                                  throws InvalidSRBRequestException
Retrieve parent project groups.

Specified by:
getProjectGroups in interface DDMService
Parameters:
request - SRBContentRequest.
contentType - content type.
Returns:
Map of parent project groups.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

addGroupPermissions

public void addGroupPermissions(SRBGroupPermissionRequest request)
                         throws InvalidSRBRequestException
Modify group permissions.

Specified by:
addGroupPermissions in interface DDMService
Parameters:
request - SRBGroupPermissionRequest.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

getScratchDatasetDirs

public java.util.List<SRBContentInfo> getScratchDatasetDirs(SRBContentRequest request)
                                                     throws InvalidDDMRequestException
Fetch all scratch area dataset directories content from SRB from the specified collection. All scratch area dataset directories are 4 level down from the scrath area.

Specified by:
getScratchDatasetDirs in interface DDMService
Parameters:
request - SRBContentRequest.
Returns:
List of SRBContentInfo objects.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getSRBDirs

public java.util.List<SRBContentInfo> getSRBDirs(SRBContentRequest request)
                                          throws InvalidDDMRequestException
Fetch all directory content from SRB from the specified collection.

Specified by:
getSRBDirs in interface DDMService
Parameters:
request - SRBContentRequest.
Returns:
List of SRBContentInfo objects.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getSRBAll

public java.util.List<SRBContentInfo> getSRBAll(SRBContentRequest request)
                                         throws InvalidDDMRequestException
Fetch all file content from SRB from the specified collection.

Specified by:
getSRBAll in interface DDMService
Parameters:
request - SRBContentRequest.
Returns:
List of SRBContentInfo objects.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getStagingAreaContent

public java.util.List<SRBContentInfo> getStagingAreaContent(SRBContentRequest request)
                                                     throws InvalidDDMRequestException
Get staging area contents.

Specified by:
getStagingAreaContent in interface DDMService
Parameters:
request - SRBContentRequest.
Returns:
List of staging area contents.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

transferFromStagingArea

public StagingContentTransferResponse transferFromStagingArea(StagingContentTransferRequest request)
Transfer the datafiles in the staging area into a specified Dataset (TODO).

Parameters:
request - The StagingContentTransferRequest request.
Returns:
A StagingContentTransferResponse.

getAllManagers

public java.util.Map<java.lang.String,java.lang.String> getAllManagers()
                                                                throws DDMServiceException
Get all available project managers.

Map contains the manager id as key and 'Title + Initials + LastName' as value.

Specified by:
getAllManagers in interface DDMService
Returns:
Map of available project managers.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.

getManagerDisplayById

public java.lang.String getManagerDisplayById(int mgrId)
                                       throws InvalidDDMRequestException,
                                              DDMServiceException
Get manager display name form the Id.

Specified by:
getManagerDisplayById in interface DDMService
Parameters:
mgrId - manager id.
Returns:
manager display name.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - Exception raised by DDM service when an error occurs.

getAllProjectStatus

public java.util.Map<java.lang.String,java.lang.String> getAllProjectStatus()
                                                                     throws DDMServiceException
Retrieve a map of all available project status.

Specified by:
getAllProjectStatus in interface DDMService
Returns:
Map of project status.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.

getProjectDetailsByName

public ProjectDetails getProjectDetailsByName(java.lang.String projectName,
                                              java.lang.String srbSessionId)
                                       throws DDMServiceException,
                                              InvalidDDMRequestException
Get project details.

The project detail contains the ICAT meta data and the corresponding SRB directory info.

Specified by:
getProjectDetailsByName in interface DDMService
Parameters:
projectName - project name.
srbSessionId - srb sessionId.
Returns:
ProjectDetails object.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getProjectDetailsById

public ProjectDetails getProjectDetailsById(int projectId,
                                            java.lang.String srbSessionId)
                                     throws DDMServiceException,
                                            InvalidDDMRequestException
Get project details.

The project detail contains the ICAT meta data and the corresponding SRB directory info.

Specified by:
getProjectDetailsById in interface DDMService
Parameters:
projectId - project id.
srbSessionId - srb sessionId.
Returns:
ProjectDetails object.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

addProject

public ProjectDetails addProject(ProjectRequest createProjectRequest)
                          throws InvalidDDMRequestException,
                                 DDMServiceException
Create Project.

Creates an empty project directory in SRB and the project metadata in ICAT.

Specified by:
addProject in interface DDMService
Parameters:
createProjectRequest - request object.
Returns:
ProjectDetails object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - Exception raised by DDM service when an error occurs.

updateProject

public ProjectDetails updateProject(ProjectRequest updateProjectRequest)
                             throws InvalidDDMRequestException,
                                    DDMServiceException
Update project.

Update the project ICAT meta-data and SRB project directory name if required.

Specified by:
updateProject in interface DDMService
Parameters:
updateProjectRequest - request object.
Returns:
ProjectDetails object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - Exception raised by DDM service when an error occurs.

deleteProject

public void deleteProject(ProjectRequest deleteProjectRequest)
                   throws InvalidDDMRequestException,
                          DDMServiceException
Delete project.

Delete the project directory from SRB and the project meta data from ICAT.

Specified by:
deleteProject in interface DDMService
Parameters:
deleteProjectRequest - request object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - Exception raised by DDM service when an error occurs.

getDatasetIdByHandle

public int getDatasetIdByHandle(java.lang.String handleId)
Get dataset id by dataset handle id.

Specified by:
getDatasetIdByHandle in interface DDMService
Parameters:
handleId - dataset handle id.
Returns:
dataset id.

getAllDatasetTypes

public java.util.Map<java.lang.String,java.lang.String> getAllDatasetTypes()
                                                                    throws InvalidDDMRequestException
Get all available Dataset Types.

Specified by:
getAllDatasetTypes in interface DDMService
Returns:
Map of dataset type values.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getAllNonPackageDatasetType

public java.util.Map<java.lang.String,java.lang.String> getAllNonPackageDatasetType()
                                                                             throws InvalidDDMRequestException
Get all non-package Dataset Types.

Specified by:
getAllNonPackageDatasetType in interface DDMService
Returns:
Map of dataset type values.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getAllDatasetStatus

public java.util.Map<java.lang.String,java.lang.String> getAllDatasetStatus()
                                                                     throws InvalidDDMRequestException
Get all available Dataset status.

Specified by:
getAllDatasetStatus in interface DDMService
Returns:
Map of dataset status values.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getDatasetDetailsById

public DatasetDetails getDatasetDetailsById(int datasetId,
                                            java.lang.String srbSessionId)
                                     throws DDMServiceException,
                                            InvalidDDMRequestException
Get dataset details by dataset Id.

Retrieves dataset metadata from ICAT and the dataset SRB directory info.

Specified by:
getDatasetDetailsById in interface DDMService
Parameters:
datasetId - dataset id.
srbSessionId - srb session id.
Returns:
DatasetDetails object.
Throws:
DDMServiceException - raised by DDM service when failure reached in processing.
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getDatasetDetailsByName

public DatasetDetails getDatasetDetailsByName(java.lang.String projectName,
                                              java.lang.String exprName,
                                              java.lang.String datasetName,
                                              java.lang.String srbSessionId)
                                       throws DDMServiceException,
                                              InvalidDDMRequestException
Get dataset details by names.

Retrieves dataset metadata from ICAT and the dataset SRB directory info.

Specified by:
getDatasetDetailsByName in interface DDMService
Parameters:
projectName - proj name.
exprName - expr name.
datasetName - dataste name.
srbSessionId - srb session id.
Returns:
DatasetDetails object.
Throws:
DDMServiceException - raised by DDM service when failure reached in processing.
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

getAllDatasetsByExpr

public java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllDatasetsByExpr(int experimentId)
Get all associasted datasets.

Specified by:
getAllDatasetsByExpr in interface DDMService
Parameters:
experimentId - id.
Returns:
List of DataSet objects.

getAllDatasetsBySampleId

public java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllDatasetsBySampleId(int sampleId)
Get all datasets by a sample.

Specified by:
getAllDatasetsBySampleId in interface DDMService
Parameters:
sampleId - id.
Returns:
List of DataSet objects.

getAllPackagedDatasetsByExpId

public java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllPackagedDatasetsByExpId(int experimentId)
                                                                                    throws DDMServiceException
Get all associasted datasets.

Specified by:
getAllPackagedDatasetsByExpId in interface DDMService
Parameters:
experimentId - id.
Returns:
List of DataSet objects.
Throws:
DDMServiceException

getAllNonPackagedDatasetByExpId

public java.util.List<au.edu.archer.domain.icat.api.DataSet> getAllNonPackagedDatasetByExpId(int experimentId)
                                                                                      throws DDMServiceException
Description copied from interface: DDMService
Get all non-packaged datasets.

Specified by:
getAllNonPackagedDatasetByExpId in interface DDMService
Parameters:
experimentId - id.
Returns:
List of DataSet objects.
Throws:
DDMServiceException

getAllDatasetFiles

public java.util.Map<java.lang.String,java.lang.String> getAllDatasetFiles(int datasetId)
Get all associated datafiles for a dataset.

Specified by:
getAllDatasetFiles in interface DDMService
Parameters:
datasetId - dataset id.
Returns:
Map of dataset files.

getAllDataFiles

public java.util.List<au.edu.archer.domain.icat.api.DataFile> getAllDataFiles(int datasetId)
Get all associated datafiles for a specific dataset.

Specified by:
getAllDataFiles in interface DDMService
Parameters:
datasetId - The dataset id.
Returns:
A list of DataFile.

downloadSingleDataFile

public SRBDownloadResponse downloadSingleDataFile(SRBDownloadRequest request)
                                           throws InvalidDDMRequestException
Download a datafile from SRB.

Specified by:
downloadSingleDataFile in interface DDMService
Parameters:
request - SRBDownloadRequest object.
Returns:
SRBDownloadResponse object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

uploadSingleDatafile

public au.edu.archer.domain.icat.api.DataFile uploadSingleDatafile(SRBUploadRequest srbUploadRequest)
                                                            throws InvalidDDMRequestException,
                                                                   DDMServiceException
Upload single datafile to a dataset.

Will upload file in SRB and persist extracted meta data based on the file type.

Specified by:
uploadSingleDatafile in interface DDMService
Parameters:
srbUploadRequest - request object.
Returns:
DataFile object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

uploadSingleGenericFile

public au.edu.archer.domain.icat.api.DataFile uploadSingleGenericFile(SRBUploadRequest srbUploadRequest)
                                                               throws InvalidDDMRequestException,
                                                                      DDMServiceException
Throws:
InvalidDDMRequestException
DDMServiceException

addGenericFileToDataset

public au.edu.archer.domain.icat.api.DataFile addGenericFileToDataset(SRBUploadRequest srbUploadRequest,
                                                                      java.lang.String srbLocation,
                                                                      int datasetId)
                                                               throws DDMServiceException,
                                                                      InvalidDDMRequestException
Add a Generic File to a Dataset.

Specified by:
addGenericFileToDataset in interface DDMService
Parameters:
srbUploadRequest - The SRBUploadRequest srbUploadRequest.
srbLocation - The SRB location.
datasetId - The Dataset Id.
Returns:
A DataFile.
Throws:
DDMServiceException - if an error occurs.
InvalidDDMRequestException - if an error occurs.

addDatasetToAnExpr

public DatasetDetails addDatasetToAnExpr(DatasetRequest request)
                                  throws InvalidDDMRequestException,
                                         DDMServiceException
Add dataset to an experiment.

Add dataset metadata to ICAT and dataset diredtory in SRB.

Specified by:
addDatasetToAnExpr in interface DDMService
Parameters:
request - DatasetRequest object.
Returns:
DatasetDetails object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

updateDataset

public DatasetDetails updateDataset(DatasetRequest request)
                             throws InvalidDDMRequestException,
                                    DDMServiceException
Update dataset.

Updates metadata data in ICAT and directory name in SRB.

Specified by:
updateDataset in interface DDMService
Parameters:
request - DatasetRequest object.
Returns:
DatasetDetails object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

deleteDataset

public void deleteDataset(DatasetRequest request)
                   throws InvalidDDMRequestException,
                          DDMServiceException
Delete dataset.

Delets dataset metadata from ICAT and the dataset directory from SRB.

Specified by:
deleteDataset in interface DDMService
Parameters:
request - DatasetRequest object.
Throws:
InvalidDDMRequestException
DDMServiceException - raised by DDM service when failure reached in processing.

updateDatasetParameters

public void updateDatasetParameters(DatasetRequest request)
                             throws InvalidDDMRequestException,
                                    DDMServiceException
Update Dataset parameters. Also referred as Dataset variable metadata.

Specified by:
updateDatasetParameters in interface DDMService
Parameters:
request - DatasetRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getDatasetParametersById

public java.util.Map<java.lang.String,java.lang.String> getDatasetParametersById(DatasetRequest request)
Retrieve Dataset parameters by Dataset Id. Also referred as Dataset variable metadata.

Specified by:
getDatasetParametersById in interface DDMService
Parameters:
request - DatasetRequest object.
Returns:
Map of Dataset parameters.

deleteExperiment

public void deleteExperiment(ExperimentRequest request)
                      throws InvalidDDMRequestException,
                             DDMServiceException
Delete Experiment.

delete experiment directory under an exist project directory in SRB and remove metadata from ICAT.

Specified by:
deleteExperiment in interface DDMService
Parameters:
request - ExperimentRequest request object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - Exception raised by DDM service when an error occurs.

createExperiment

public ExperimentDetails createExperiment(ExperimentRequest request)
                                   throws InvalidDDMRequestException,
                                          DDMServiceException
Create Experiment.

Create an empty experiment directory under an exist project directory in SRB and save metadata in ICAT.

Specified by:
createExperiment in interface DDMService
Parameters:
request - ExperimentRequest request object.
Returns:
ExperimentDetails response object.
Throws:
DDMServiceException
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

updateExperiment

public ExperimentDetails updateExperiment(ExperimentRequest request)
                                   throws InvalidDDMRequestException,
                                          DDMServiceException
Update Experiment.

Specified by:
updateExperiment in interface DDMService
Parameters:
request - ExperimentRequest request object.
Returns:
ExperimentDetails response object of update.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getExperimentByName

public ExperimentDetails getExperimentByName(ExperimentRequest request)
                                      throws InvalidDDMRequestException,
                                             DDMServiceException
Get Experiment.

Specified by:
getExperimentByName in interface DDMService
Parameters:
request - ExperimentRequest request object.
Returns:
ExperimentDetails response object of experiment.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getExperimentById

public ExperimentDetails getExperimentById(int expId,
                                           java.lang.String srbSessionId)
                                    throws InvalidDDMRequestException,
                                           DDMServiceException
Get Experiment.

Specified by:
getExperimentById in interface DDMService
Parameters:
expId - int experiment id.
srbSessionId - String srb session id.
Returns:
ExperimentDetails response object of experiment.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

createSample

public SampleDetails createSample(SampleRequest request)
                           throws InvalidDDMRequestException,
                                  DDMServiceException
Create sample.

Specified by:
createSample in interface DDMService
Parameters:
request - SampleRequest request object.
Returns:
SampleDetails result object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

deleteSample

public void deleteSample(SampleRequest request)
                  throws InvalidDDMRequestException,
                         DDMServiceException
Delete sample.

Specified by:
deleteSample in interface DDMService
Parameters:
request - SampleRequest request
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getAllSamplesByExpId

public java.util.Map<java.lang.String,java.lang.String> getAllSamplesByExpId(SampleRequest request)
Get all samples that are attached to the given experiment id.

Specified by:
getAllSamplesByExpId in interface DDMService
Parameters:
request - SampleRequest request.
Returns:
Map<String, String> map of sample id and sample name.

getSampleById

public SampleDetails getSampleById(SampleRequest request)
                            throws InvalidDDMRequestException,
                                   DDMServiceException
Get sample by sample id.

Specified by:
getSampleById in interface DDMService
Parameters:
request - SampleRequest request.
Returns:
SampleDetails requlst object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

updateSample

public SampleDetails updateSample(SampleRequest request)
                           throws InvalidDDMRequestException,
                                  DDMServiceException
Update sample.

Specified by:
updateSample in interface DDMService
Parameters:
request - SampleRequest request object.
Returns:
SampleDetails result object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getAllSamplesByExpName

public java.util.Map<java.lang.String,java.lang.String> getAllSamplesByExpName(SampleRequest request)
Get all samples that are attached to the given experiment id.

Specified by:
getAllSamplesByExpName in interface DDMService
Parameters:
request - SampleRequest request.
Returns:
Map<String, String> map of sample id and sample name.

updateSampleParameters

public void updateSampleParameters(SampleRequest request)
                            throws InvalidDDMRequestException,
                                   DDMServiceException
Add sample parameters. Also referred as sample variable metadata.

This method is used by UQ Meta DataEditor.

Specified by:
updateSampleParameters in interface DDMService
Parameters:
request - SampleRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getSampleParametersById

public java.util.Map<java.lang.String,java.lang.String> getSampleParametersById(SampleRequest request)
Retrieve sample parameters. Also referred as sample variable metadata.

This method is used by UQ Meta DataEditor.

Specified by:
getSampleParametersById in interface DDMService
Parameters:
request - SampleRequest object.
Returns:
Map of sample parameters.

getAllExperimentTypes

public java.util.List<au.edu.archer.domain.icat.api.InvestigationType> getAllExperimentTypes()
Get all available experiment types.

Specified by:
getAllExperimentTypes in interface DDMService
Returns:
List of Experiment types.

addDatafileToDataset

public au.edu.archer.domain.icat.api.DataFile addDatafileToDataset(byte[] content,
                                                                   java.lang.String srbLocation,
                                                                   int datasetId)
                                                            throws DDMServiceException,
                                                                   InvalidDDMRequestException
Insert the extracted meta data.

Specified by:
addDatafileToDataset in interface DDMService
Parameters:
content - meta data content in XML file.
srbLocation - String location of the file.
datasetId - dataset id.
Returns:
DataFile the DataFile persistent object saved.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

addDatafileToDataset

public au.edu.archer.domain.icat.api.DataFile addDatafileToDataset(SRBUploadRequest srbUploadRequest,
                                                                   java.lang.String srbLocation,
                                                                   int datasetId)
                                                            throws DDMServiceException,
                                                                   InvalidDDMRequestException
Add a Datafile to a Dataset.

Parameters:
srbUploadRequest - The SRBUploadRequest srbUploadRequest.
srbLocation - The SRB location.
datasetId - The Dataset Id.
Returns:
A DataFile.
Throws:
DDMServiceException - if an error occurs.
InvalidDDMRequestException - if an error occurs.

search

public SearchResponse search(SearchRequest request)
                      throws InvalidDDMRequestException
Search method.

Specified by:
search in interface DDMService
Parameters:
request - SearchRequest search request.
Returns:
SearchResponse response object.
Throws:
InvalidDDMRequestException - throw InvalidDDMRequestException when no search criteria is provided.

getAllProjectNames

public java.util.Map<java.lang.String,java.lang.String> getAllProjectNames()
Get all project names.

Specified by:
getAllProjectNames in interface DDMService
Returns:
Map<String, String> project names.

getExperimentNamesByProjectId

public java.util.Map<java.lang.String,java.lang.String> getExperimentNamesByProjectId(int projectId)
                                                                               throws DDMServiceException
Get all experiment names of a given project.

Specified by:
getExperimentNamesByProjectId in interface DDMService
Parameters:
projectId - int project id.
Returns:
Map<String, String> experiment names.
Throws:
DDMServiceException - throw DDMServiceException when an error occurs.

getAllExperimentsUnderProject

public java.util.List<au.edu.archer.domain.icat.api.Investigation> getAllExperimentsUnderProject(int projectId)
                                                                                          throws DDMServiceException
Get All Experiments under this Project.

Specified by:
getAllExperimentsUnderProject in interface DDMService
Parameters:
projectId - The project id.
Returns:
A list of Investigations.
Throws:
DDMServiceException - if any errors occur.

getDatasetNamesByExperimentId

public java.util.Map<java.lang.String,java.lang.String> getDatasetNamesByExperimentId(int experimentId)
                                                                               throws DDMServiceException
getDatasetNamesByExperimentId.

Specified by:
getDatasetNamesByExperimentId in interface DDMService
Parameters:
experimentId - int.
Returns:
Map<String, String > .
Throws:
DDMServiceException - .

copyDataset

public DatasetDetails copyDataset(DatasetRequest request)
                           throws DDMServiceException
Copy Dataset to another experiment.

Specified by:
copyDataset in interface DDMService
Parameters:
request - DatasetRequest request object.
Returns:
DatasetDetails DatasetDetails object.
Throws:
DDMServiceException - throw DDMServiceException when an error occurs.

copyDatafile

public au.edu.archer.domain.icat.api.DataFile copyDatafile(DatafileRequest request)
                                                    throws DDMServiceException
Copy Datafile to another Dataset.

Specified by:
copyDatafile in interface DDMService
Parameters:
request - DatafileRequest request object.
Returns:
DatafileDetails DatafileDetails object.
Throws:
DDMServiceException - throw DDMServiceException when an error occurs.

moveDatafile

public au.edu.archer.domain.icat.api.DataFile moveDatafile(DatafileRequest request)
                                                    throws DDMServiceException
Move Datafile to another dataset.

Specified by:
moveDatafile in interface DDMService
Parameters:
request - DatasetRequest request object.
Returns:
DatasetDetails DatasetDetails object.
Throws:
DDMServiceException - DDMServiceException throw DDMServiceException when an error occurs.

moveDataset

public DatasetDetails moveDataset(DatasetRequest request)
                           throws DDMServiceException,
                                  InvalidDDMRequestException
Move Dataset to another experiment.

Specified by:
moveDataset in interface DDMService
Parameters:
request - DatasetRequest request object.
Returns:
DatasetDetails DatasetDetails object.
Throws:
DDMServiceException - throw DDMServiceException when an error occurs.
InvalidDDMRequestException - throw InvalidDDMRequestException when request object is invalid.

retrieveMetadata

public au.edu.archer.domain.icat.api.DataFile retrieveMetadata(java.lang.String srbLocation)
                                                        throws InvalidICATRequestException
Retrieve Metadata information based on srbLocation.

Specified by:
retrieveMetadata in interface DDMService
Parameters:
srbLocation - String location used when inserting metadata.
Returns:
DataFile the DataFile object.
Throws:
InvalidICATRequestException - throw MetaDataIncompleteException in case validation fails.

getDataFile

public au.edu.archer.domain.icat.api.DataFile getDataFile(int dfId)
Get DataFile by its id.

Specified by:
getDataFile in interface DDMService
Parameters:
dfId - int DataFile id.
Returns:
DataFile DataFile object to be returned.

getDataFile

public au.edu.archer.domain.icat.api.DataFile getDataFile(java.lang.String projectName,
                                                          java.lang.String experimentName,
                                                          java.lang.String datasetName,
                                                          java.lang.String datafileName)
                                                   throws DDMServiceException
Get DataFile id by using project name, exepriment name, dataset name and datafile name.

Specified by:
getDataFile in interface DDMService
Parameters:
projectName - String project name.
experimentName - String experiment name.
datasetName - String dataset name.
datafileName - String datafile name.
Returns:
DataFile DataFile object to be returned.
Throws:
DDMServiceException - if any errors occur.

getDataFile

public au.edu.archer.domain.icat.api.DataFile getDataFile(java.lang.String path)
                                                   throws DDMServiceException
Get DataFile id by using relative path of the DataFile.

Specified by:
getDataFile in interface DDMService
Parameters:
path - String relative path of the DataFile.
Returns:
DataFile DataFile object to be returned.
Throws:
DDMServiceException - if any errors occur.

deleteDataFile

public void deleteDataFile(DatafileRequest request)
                    throws DDMServiceException
Delete DataFile by using relative path of the DataFile.

Specified by:
deleteDataFile in interface DDMService
Parameters:
request - DatafileRequest request object.
Throws:
DDMServiceException - throw DDMServiceException when an error happens.

updateDatafileParameters

public void updateDatafileParameters(DatafileRequest request)
                              throws InvalidDDMRequestException,
                                     DDMServiceException
Add datafile parameters. Also referred as datafile variable metadata.

This method is used by UQ Meta DataEditor.

Specified by:
updateDatafileParameters in interface DDMService
Parameters:
request - DatafileRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

updateDatafile

public au.edu.archer.domain.icat.api.DataFile updateDatafile(DatafileRequest request)
                                                      throws InvalidDDMRequestException,
                                                             DDMServiceException
Update Datafile without changing DatafileParameters.

Specified by:
updateDatafile in interface DDMService
Parameters:
request - DatafileRequest request object.
Returns:
DataFile the updated DataFile object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.
DDMServiceException - raised by DDM service when failure reached in processing.

getDatafileParametersById

public java.util.Map<java.lang.String,java.lang.String> getDatafileParametersById(DatafileRequest request)
Retrieve datafile parameters. Also referred as datafile variable metadata.

This method is used by UQ Meta DataEditor.

Specified by:
getDatafileParametersById in interface DDMService
Parameters:
request - DatafileRequest object.
Returns:
Map of datafile parameters.

resetDatafileParameters

public au.edu.archer.domain.icat.impl.DataFileImpl resetDatafileParameters(DatafileRequest request)
                                                                    throws DDMServiceException
reset datafile parameters by re-extracting from the original file stored on SRB.

Specified by:
resetDatafileParameters in interface DDMService
Parameters:
request - DatafileRequest request object.
Returns:
DataFileImpl changed DataFile object.
Throws:
DDMServiceException - throw DDMServiceException when an error occurs.

getAllDataFileFormat

public java.util.Map<java.lang.String,java.lang.String> getAllDataFileFormat()
Get all existing DataFileformats.

Specified by:
getAllDataFileFormat in interface DDMService
Returns:
Map<String, String> mapping of Datafile format.

setIcatService

public void setIcatService(ICATService icatService)
Set icatService. Set by Spring framework.

Parameters:
icatService - to set.

setSrbService

public void setSrbService(SRBService srbService)
Set SRBService. Set by Spring framework.

Parameters:
srbService - to set.

setMetadataExtractorService

public void setMetadataExtractorService(MetadataExtractorService metadataExtractorService)
Set MetadataExtractorService. Set by Spring framework.

Parameters:
metadataExtractorService - to set.

setSearchService

public void setSearchService(SearchService searchService)
Set search service.

Parameters:
searchService - SearchService searchService.

setMailService

public void setMailService(MailService mailService)
setMailService.

Parameters:
mailService - MailService.

startMETSThread

public java.lang.Thread startMETSThread(CreateMETSRequest request)
                                 throws DDMServiceException,
                                        InvalidDDMRequestException
startMETSThread.

Specified by:
startMETSThread in interface DDMService
Parameters:
request - CreateMETSRequest.
Returns:
Thread.
Throws:
DDMServiceException
InvalidDDMRequestException

startPublishThread

public java.lang.Thread startPublishThread(PublishExperimentRequest request)
                                    throws java.lang.Exception
startMETSThread.

Specified by:
startPublishThread in interface DDMService
Parameters:
request - CreateMETSRequest.
Returns:
Thread.
Throws:
DDMServiceException
java.lang.Exception

getDatafileSliceByDatasetId

public java.util.Map<java.lang.String,DatafileSliceResponse> getDatafileSliceByDatasetId(int datasetId)
Get Datafile Slice by a Dataset Id.

Specified by:
getDatafileSliceByDatasetId in interface DDMService
Parameters:
datasetId - A datafile id.
Returns:
A Collection of DatafileSliceResponse.

startTransferThread

public java.lang.Thread startTransferThread(java.lang.String srbSessionId,
                                            java.lang.String stagingDir,
                                            java.lang.Integer datasetId,
                                            boolean stagTransfer,
                                            java.lang.String notificationRecv)
Transfer all files in the staging area.

Specified by:
startTransferThread in interface DDMService
Parameters:
srbSessionId - The String srbSessionId.
stagingDir - The String stagingDir.
datasetId - The Dataset Id.
stagTransfer - The flag is stagTransfer.
notificationRecv - String.
Returns:
Thread.

listAllInvestigatorsByExperimentId

public java.util.List<au.edu.archer.domain.icat.api.Investigator> listAllInvestigatorsByExperimentId(int expid)
List all investigators by experiment id.

Specified by:
listAllInvestigatorsByExperimentId in interface DDMService
Parameters:
expid - The experiment Id.
Returns:
A list of investigators.

listAllTopicListsByExperimentId

public java.util.List<au.edu.archer.domain.icat.api.TopicList> listAllTopicListsByExperimentId(int expid)
List all TopicLists by ExperimentId.

Specified by:
listAllTopicListsByExperimentId in interface DDMService
Parameters:
expid - The experiment Id.
Returns:
A list of TopicList of the this experiment.

listAllTopics

public java.util.List<au.edu.archer.domain.icat.api.Topic> listAllTopics()
                                                                  throws DDMServiceException
List of all Topics.

Specified by:
listAllTopics in interface DDMService
Returns:
A list of all Topics.
Throws:
DDMServiceException - if errors.

getAllTopicNames

public java.util.Map<java.lang.String,java.lang.String> getAllTopicNames()
                                                                  throws DDMServiceException
Get all Topic.

Specified by:
getAllTopicNames in interface DDMService
Returns:
A Map of all Topics.
Throws:
DDMServiceException - if any errors.

getAllInvestigators

public java.util.Map<java.lang.String,java.lang.String> getAllInvestigators()
                                                                     throws DDMServiceException
Get all Investigators.

Specified by:
getAllInvestigators in interface DDMService
Returns:
A Map of all Investigators.
Throws:
DDMServiceException - if any errors.

getLock

public java.util.Map<java.lang.String,java.lang.String> getLock()
Get the lock.

Specified by:
getLock in interface DDMService
Returns:
lock Map.

setLock

public void setLock(java.util.Map<java.lang.String,java.lang.String> lock)
set the lock.

Specified by:
setLock in interface DDMService
Parameters:
lock - the lock to set.


Copyright © 2008-09 Monash University. All Rights Reserved.