au.edu.archer.service.icat.helper
Class ICATServiceHelper

java.lang.Object
  extended by au.edu.archer.service.icat.helper.ICATServiceHelper

public class ICATServiceHelper
extends java.lang.Object

Helper class for ICATService.


Constructor Summary
ICATServiceHelper()
           
 
Method Summary
static java.util.List<au.edu.archer.domain.icat.api.DataFileParameter> extractParameters(byte[] xmlMetadata, au.edu.archer.domain.icat.api.DataFile df)
          extract all data file parameters from the xml file.
static au.edu.archer.domain.icat.impl.DataFileImpl generateDataFile(java.lang.String fileLocation, int fileSize)
          Generate a DataFileImpl object.
static au.edu.archer.domain.icat.api.DataSet generateDataset(DatasetRequest request, au.edu.archer.domain.icat.api.DataSetType datasetType, au.edu.archer.domain.icat.api.DataSetStatus datasetStatus, au.edu.archer.domain.icat.api.Sample sample, au.edu.archer.domain.icat.api.Investigation expr)
          Generate Dataset object for persisting.
static au.edu.archer.domain.icat.api.Investigation generateExperiment(ExperimentRequest request, au.edu.archer.domain.icat.api.InvestigationType type)
          Generate experiment object from request.
static au.edu.archer.domain.icat.api.Study generateProject(ProjectRequest request, au.edu.archer.domain.icat.api.StudyStatus stydyStatus)
          Construct StudyImpl object from project request.
static au.edu.archer.domain.icat.api.Sample generateSample(SampleRequest request, au.edu.archer.domain.icat.api.Investigation experiment)
          Generate sample object from request.
static void mergeDatasetUpdates(au.edu.archer.domain.icat.impl.DataSetImpl dataset, DatasetRequest request, au.edu.archer.domain.icat.api.DataSetType datasetType, au.edu.archer.domain.icat.api.DataSetStatus datasetStatus, au.edu.archer.domain.icat.api.Sample sample)
          Merge dataset object for updating.
static void mergeExperimentUpdates(au.edu.archer.domain.icat.impl.InvestigationImpl oldInvestigation, ExperimentRequest request, au.edu.archer.domain.icat.api.InvestigationType type)
          Merge experiment properties.
static void mergeProjectUpdates(au.edu.archer.domain.icat.impl.StudyImpl originalProject, ProjectRequest updateRequest, au.edu.archer.domain.icat.api.StudyStatus stydyStatus)
          Merge project updates.
static void mergeSampleUpdates(au.edu.archer.domain.icat.impl.SampleImpl sample, SampleRequest request)
          Merge sample object for update.
static void validateInsertMetadataRequest(byte[] content, java.lang.String srbLocation)
          validate before calling ICATServiceImpl.insertMetadata.
static void validateSRBLocationRequest(java.lang.String srbLocation)
          validate before calling ICATServiceImpl.retrieveMetadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICATServiceHelper

public ICATServiceHelper()
Method Detail

generateDataset

public static au.edu.archer.domain.icat.api.DataSet generateDataset(DatasetRequest request,
                                                                    au.edu.archer.domain.icat.api.DataSetType datasetType,
                                                                    au.edu.archer.domain.icat.api.DataSetStatus datasetStatus,
                                                                    au.edu.archer.domain.icat.api.Sample sample,
                                                                    au.edu.archer.domain.icat.api.Investigation expr)
Generate Dataset object for persisting.

Parameters:
request - DatasetRequest object.
datasetType - DataSetType object.
datasetStatus - DataSetStatus object.
sample - Sample object.
expr - Investigation object.
Returns:
Dataset object ready for persisting.

mergeDatasetUpdates

public static void mergeDatasetUpdates(au.edu.archer.domain.icat.impl.DataSetImpl dataset,
                                       DatasetRequest request,
                                       au.edu.archer.domain.icat.api.DataSetType datasetType,
                                       au.edu.archer.domain.icat.api.DataSetStatus datasetStatus,
                                       au.edu.archer.domain.icat.api.Sample sample)
Merge dataset object for updating.

Parameters:
dataset - DataSetImpl object.
request - DatasetRequest object.
datasetType - DataSetType obejct.
datasetStatus - DataSetStatus object.
sample - Sample object.

generateProject

public static au.edu.archer.domain.icat.api.Study generateProject(ProjectRequest request,
                                                                  au.edu.archer.domain.icat.api.StudyStatus stydyStatus)
Construct StudyImpl object from project request.

Parameters:
request - ProjectRequest object.
stydyStatus - project status.
Returns:
Study object.

mergeProjectUpdates

public static void mergeProjectUpdates(au.edu.archer.domain.icat.impl.StudyImpl originalProject,
                                       ProjectRequest updateRequest,
                                       au.edu.archer.domain.icat.api.StudyStatus stydyStatus)
Merge project updates.

Parameters:
originalProject - StudyImpl object.
updateRequest - ProjectRequest object.
stydyStatus - StudyStatus.

generateDataFile

public static au.edu.archer.domain.icat.impl.DataFileImpl generateDataFile(java.lang.String fileLocation,
                                                                           int fileSize)
Generate a DataFileImpl object.

Parameters:
fileLocation - String fileLocation.
fileSize - String file size.
Returns:
DataFileImpl DataFileImpl object.

extractParameters

public static java.util.List<au.edu.archer.domain.icat.api.DataFileParameter> extractParameters(byte[] xmlMetadata,
                                                                                                au.edu.archer.domain.icat.api.DataFile df)
                                                                                         throws MetadataExtractionException
extract all data file parameters from the xml file.

Parameters:
xmlMetadata - byte[] the byte array of the xml file.
df - DataFile the DataFile object used to initialize each parameter.
Returns:
List<DataFileParameter> list of DataFileParameter.
Throws:
MetadataExtractionException - AnalyzeException is thrown in case any exception happened.

validateInsertMetadataRequest

public static void validateInsertMetadataRequest(byte[] content,
                                                 java.lang.String srbLocation)
                                          throws InvalidICATRequestException
validate before calling ICATServiceImpl.insertMetadata.

Parameters:
content - byte[] file content.
srbLocation - String fileLocation.
Throws:
InvalidICATRequestException - exception thrown when invalid request received.

validateSRBLocationRequest

public static void validateSRBLocationRequest(java.lang.String srbLocation)
                                       throws InvalidICATRequestException
validate before calling ICATServiceImpl.retrieveMetadata.

Parameters:
srbLocation - String fileLocation.
Throws:
InvalidICATRequestException - exception thrown when invalid request received.

generateExperiment

public static au.edu.archer.domain.icat.api.Investigation generateExperiment(ExperimentRequest request,
                                                                             au.edu.archer.domain.icat.api.InvestigationType type)
Generate experiment object from request.

Parameters:
request - ExperimentRequest request object.
type - InvestigationType experiment type object.
Returns:
Investigation experiment object.

mergeExperimentUpdates

public static void mergeExperimentUpdates(au.edu.archer.domain.icat.impl.InvestigationImpl oldInvestigation,
                                          ExperimentRequest request,
                                          au.edu.archer.domain.icat.api.InvestigationType type)
Merge experiment properties.

Parameters:
oldInvestigation - InvestigationImpl experiment object.
request - ExperimentRequest request object.
type - ExperimentType experiment type.

mergeSampleUpdates

public static void mergeSampleUpdates(au.edu.archer.domain.icat.impl.SampleImpl sample,
                                      SampleRequest request)
Merge sample object for update.

Parameters:
sample - SampleImpl sample implementation object.
request - SampleRequest request object.

generateSample

public static au.edu.archer.domain.icat.api.Sample generateSample(SampleRequest request,
                                                                  au.edu.archer.domain.icat.api.Investigation experiment)
Generate sample object from request.

Parameters:
request - SampleRequest request object.
experiment - Investigation experiment object that linked with this sample.
Returns:
Sample sample object.


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