au.edu.archer.service.ddm.helper
Class DDMServiceHelper

java.lang.Object
  extended by au.edu.archer.service.common.helper.ServiceHelper
      extended by au.edu.archer.service.ddm.helper.DDMServiceHelper

public class DDMServiceHelper
extends ServiceHelper

Helper class for DDMService.


Constructor Summary
DDMServiceHelper()
           
 
Method Summary
static java.lang.String createHandle(int datasetId, java.lang.String handleSuffix, java.lang.String relPath)
          Create handle identifier for the Dataset.
static au.edu.archer.domain.icat.api.Investigation generateExperiment(ExperimentRequest request, ICATService icatServ)
          Generate Investigation object from request.
static java.lang.String generateMgrDisplay(au.edu.archer.domain.icat.api.FacilityUser mgr)
          Generate project manager as display String[Title + initials + Last name].
static SRBGroupPermissionRequest generateModifyDtflPermissionRequest(SRBUploadRequest dtflRequest, java.lang.String admnGrpName, java.lang.String teamGrpName)
          Generate SRBModifyPermissionRequest for a datafile.
static SRBGroupPermissionRequest generateModifyDtstPermissionRequest(DatasetRequest dtstRequest, java.lang.String admnGrpName, java.lang.String teamGrpName)
          Generate SRBModifyPermissionRequest for a dataset.
static SRBGroupPermissionRequest generateModifyExprPermissionRequest(ExperimentRequest exprRequest, java.lang.String admnGrpName, java.lang.String teamGrpName)
          Generate SRBModifyPermissionRequest for an experiment.
static SRBGroupPermissionRequest generateModifyProjPermissionRequest(ProjectRequest projectRequest)
          Generate SRBModifyPermissionRequest for a project.
static SRBRenameContentRequest generateRenameContentRequest(ExperimentRequest request, java.lang.String oldName, java.lang.String projectName)
          Generate SRB experiment directory rename content request.
static SRBRenameContentRequest generateRenameContentRequest(java.lang.String srbSessionId, java.lang.String oldName, java.lang.String newName)
          Generate SRB directory rename content request.
static SRBContentRequest generateSRBContentRequest(DatasetRequest request)
          Generate SRB create dataset directory request.
static SRBContentRequest generateSRBContentRequest(ExperimentRequest request)
          Generate SRB create project request.
static SRBContentRequest generateSRBContentRequest(ProjectRequest request)
          Generate SRB create directory request.
static SRBContentRequest generateSRBContentRequest(java.lang.String contentName, java.lang.String srbSessionId)
          Generate SRB content request.
static java.lang.String generateTimestampedHandleSuffix()
          Generate the timestamp based handle suffix.
static java.lang.String getCompleteDatasetPathPrefix(au.edu.archer.domain.icat.api.DataSet dataset)
          Append project and experiment name.
static boolean isFileFormatSupported(java.lang.String contentName, java.util.List<au.edu.archer.domain.icat.api.DataFileFormat> formats)
          Check the datafile formats that are supported by the XDMS system.
static void validateCreateDatasetRequest(DatasetRequest request)
          Validate create dataset request.
static void validateCreateExperimentRequest(ExperimentRequest request)
          validate create experiment request.
static void validateCreateProjectRequest(ProjectRequest request)
          Validate create project request.
static void validateCreateSample(SampleRequest request)
          validate the sample request for creation.
static void validateDeleteDatasetRequest(DatasetRequest request)
          Validate delete dataset request.
static void validateDeleteProjectRequest(ProjectRequest request)
          Validate delete project request.
static void validateDeleteSample(SampleRequest request)
          validate the sample request for deleting.
static void validateProjectRequest(ProjectRequest request, boolean validateName)
          Validate project request.
static void validateUpdateDatasetRequest(DatasetRequest request)
          Validate update dataset request.
static void validateUpdateExperimentRequest(ExperimentRequest request)
          validate update experiment request.
static void validateUpdateProjectRequest(ProjectRequest request)
          Validate update project request.
static void validateUpdateteSample(SampleRequest request)
          validate the sample request for updating.
 
Methods inherited from class au.edu.archer.service.common.helper.ServiceHelper
validateSRBSessionIDProvided
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDMServiceHelper

public DDMServiceHelper()
Method Detail

generateModifyDtflPermissionRequest

public static SRBGroupPermissionRequest generateModifyDtflPermissionRequest(SRBUploadRequest dtflRequest,
                                                                            java.lang.String admnGrpName,
                                                                            java.lang.String teamGrpName)
Generate SRBModifyPermissionRequest for a datafile.

Parameters:
dtflRequest - SRBUploadRequest.
admnGrpName - admnGrpName.
teamGrpName - teamGrpName.
Returns:
SRBGroupPermissionRequest object.

generateModifyDtstPermissionRequest

public static SRBGroupPermissionRequest generateModifyDtstPermissionRequest(DatasetRequest dtstRequest,
                                                                            java.lang.String admnGrpName,
                                                                            java.lang.String teamGrpName)
Generate SRBModifyPermissionRequest for a dataset.

Parameters:
dtstRequest - DatasetRequest.
admnGrpName - admnGrpName.
teamGrpName - teamGrpName.
Returns:
SRBGroupPermissionRequest.

generateModifyExprPermissionRequest

public static SRBGroupPermissionRequest generateModifyExprPermissionRequest(ExperimentRequest exprRequest,
                                                                            java.lang.String admnGrpName,
                                                                            java.lang.String teamGrpName)
Generate SRBModifyPermissionRequest for an experiment.

Parameters:
exprRequest - ExperimentRequest.
admnGrpName - admnGrpName.
teamGrpName - teamGrpName.
Returns:
SRBGroupPermissionRequest.

generateModifyProjPermissionRequest

public static SRBGroupPermissionRequest generateModifyProjPermissionRequest(ProjectRequest projectRequest)
Generate SRBModifyPermissionRequest for a project.

Parameters:
projectRequest - ProjectRequest.
Returns:
SRBGroupPermissionRequest.

getCompleteDatasetPathPrefix

public static java.lang.String getCompleteDatasetPathPrefix(au.edu.archer.domain.icat.api.DataSet dataset)
Append project and experiment name.

Parameters:
dataset - DataSet object.
Returns:
dataset complete path prefix.

createHandle

public static java.lang.String createHandle(int datasetId,
                                            java.lang.String handleSuffix,
                                            java.lang.String relPath)
                                     throws DDMServiceException
Create handle identifier for the Dataset.

Parameters:
datasetId - dataset id.
handleSuffix - handle suffix.
relPath - The relative path.
Returns:
newly created handle identifier.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.

generateTimestampedHandleSuffix

public static java.lang.String generateTimestampedHandleSuffix()
Generate the timestamp based handle suffix.

Returns:
an timestamp based handle suffix.

validateCreateDatasetRequest

public static void validateCreateDatasetRequest(DatasetRequest request)
                                         throws InvalidDDMRequestException
Validate create dataset request.

Parameters:
request - CreateDatasetRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateUpdateDatasetRequest

public static void validateUpdateDatasetRequest(DatasetRequest request)
                                         throws InvalidDDMRequestException
Validate update dataset request.

Parameters:
request - DatasetRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateDeleteDatasetRequest

public static void validateDeleteDatasetRequest(DatasetRequest request)
                                         throws InvalidDDMRequestException
Validate delete dataset request.

Parameters:
request - DatasetRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

generateMgrDisplay

public static java.lang.String generateMgrDisplay(au.edu.archer.domain.icat.api.FacilityUser mgr)
Generate project manager as display String[Title + initials + Last name].

Parameters:
mgr - FacilityUser object.
Returns:
manager display string.

generateRenameContentRequest

public static SRBRenameContentRequest generateRenameContentRequest(java.lang.String srbSessionId,
                                                                   java.lang.String oldName,
                                                                   java.lang.String newName)
Generate SRB directory rename content request.

Parameters:
srbSessionId - srb session id.
oldName - old name.
newName - new name.
Returns:
SRBRenameContentRequest object.

generateSRBContentRequest

public static SRBContentRequest generateSRBContentRequest(ProjectRequest request)
Generate SRB create directory request.

Parameters:
request - ProjectRequest object.
Returns:
SRBContentRequest object.

generateSRBContentRequest

public static SRBContentRequest generateSRBContentRequest(java.lang.String contentName,
                                                          java.lang.String srbSessionId)
Generate SRB content request.

Parameters:
contentName - content name.
srbSessionId - srbSession Id.
Returns:
SRBContentRequest object.

generateSRBContentRequest

public static SRBContentRequest generateSRBContentRequest(DatasetRequest request)
Generate SRB create dataset directory request.

Parameters:
request - CreateDatasetRequest object.
Returns:
SRBContentRequest object.

validateUpdateProjectRequest

public static void validateUpdateProjectRequest(ProjectRequest request)
                                         throws InvalidDDMRequestException
Validate update project request.

Parameters:
request - CreateProjectRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateDeleteProjectRequest

public static void validateDeleteProjectRequest(ProjectRequest request)
                                         throws InvalidDDMRequestException
Validate delete project request.

Parameters:
request - DeleteProjectRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateCreateProjectRequest

public static void validateCreateProjectRequest(ProjectRequest request)
                                         throws InvalidDDMRequestException
Validate create project request.

Parameters:
request - ProjectRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateProjectRequest

public static void validateProjectRequest(ProjectRequest request,
                                          boolean validateName)
                                   throws InvalidDDMRequestException
Validate project request.

Parameters:
request - ProjectRequest object.
validateName - set to true when updating.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateUpdateExperimentRequest

public static void validateUpdateExperimentRequest(ExperimentRequest request)
                                            throws InvalidDDMRequestException
validate update experiment request.

Parameters:
request - ExperimentRequest object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateCreateExperimentRequest

public static void validateCreateExperimentRequest(ExperimentRequest request)
                                            throws InvalidDDMRequestException
validate create experiment request.

Parameters:
request - ExperimentRequest object
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

generateSRBContentRequest

public static SRBContentRequest generateSRBContentRequest(ExperimentRequest request)
Generate SRB create project request.

Parameters:
request - ExperimentRequest object.
Returns:
SRBContentRequest object.

generateRenameContentRequest

public static SRBRenameContentRequest generateRenameContentRequest(ExperimentRequest request,
                                                                   java.lang.String oldName,
                                                                   java.lang.String projectName)
Generate SRB experiment directory rename content request.

Parameters:
request - ExperimentRequest request object.
oldName - String old experiment name.
projectName - projectName.
Returns:
SRBRenameContentRequest object.

generateExperiment

public static au.edu.archer.domain.icat.api.Investigation generateExperiment(ExperimentRequest request,
                                                                             ICATService icatServ)
                                                                      throws DDMServiceException
Generate Investigation object from request.

Parameters:
request - ExperimentRequest object.
icatServ - ICAT service reference.
Returns:
Investigation object.
Throws:
DDMServiceException - Exception raised by DDM service when an error occurs.

validateCreateSample

public static void validateCreateSample(SampleRequest request)
                                 throws InvalidDDMRequestException
validate the sample request for creation.

Parameters:
request - SampleRequest request object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateDeleteSample

public static void validateDeleteSample(SampleRequest request)
                                 throws InvalidDDMRequestException
validate the sample request for deleting.

Parameters:
request - SampleRequest request object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

validateUpdateteSample

public static void validateUpdateteSample(SampleRequest request)
                                   throws InvalidDDMRequestException
validate the sample request for updating.

Parameters:
request - SampleRequest request object.
Throws:
InvalidDDMRequestException - Exception raised by DDM service when an invalid request is received for processing.

isFileFormatSupported

public static boolean isFileFormatSupported(java.lang.String contentName,
                                            java.util.List<au.edu.archer.domain.icat.api.DataFileFormat> formats)
Check the datafile formats that are supported by the XDMS system.

Parameters:
contentName - The content name.
formats - The Datafile formats.
Returns:
true if it is one of the supported datafile formats.


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