au.edu.archer.service.srb.helper
Class SRBServiceHelper

java.lang.Object
  extended by au.edu.archer.service.srb.helper.SRBServiceHelper

public class SRBServiceHelper
extends java.lang.Object

SRBServiceHelper SRBService validation Helper.


Constructor Summary
SRBServiceHelper()
           
 
Method Summary
static void deleteFileOrDirectory(edu.sdsc.grid.io.GeneralFile file)
          Delete a file or directory on SRB file system.
static java.lang.String fetchHighestRankedPerm(edu.sdsc.grid.io.srb.SRBFile srbContent, java.lang.String srbReadPerm, java.lang.String srbWritePerm, java.lang.String srbAllPerm)
          Retrieve the current user's highest ranked permission.
static java.lang.String generateSRBContentContext(SRBRequest request, edu.sdsc.grid.io.srb.SRBFileSystem srbFileSystem)
          Generate SRB content context.
static SRBContentInfo generateSRBContentInfo(edu.sdsc.grid.io.srb.SRBFile file)
          Generate SRB contentInfo from SRBFile.
static java.util.Map<java.lang.String,java.lang.String> getProjectGroups(edu.sdsc.grid.io.srb.SRBFile srbProjectObj)
          Retrieve admin and team groups from a project.
static edu.sdsc.grid.io.srb.SRBFile getSRBParentProject(SRBContentRequest request, java.lang.String contentType, edu.sdsc.grid.io.srb.SRBFileSystem srbFileSystem)
          Retrieve parent SRB project object.
static void validateAuthenticate(SRBLoginRequest request)
          validate SRBLoginRequest to make sure that all mendatory information are correctly provided.
static void validateCreateDirectory(SRBContentRequest request)
          validate parameters before create directory.
static void validateDeleteDirectory(SRBContentRequest request)
          validate parameters before deleting files.
static void validateDownloadRequest(SRBDownloadRequest request)
          validate parameters before downloading files.
static void validateListFile(SRBContentRequest request)
          validate parameters before list files.
static void validateUploadRequest(SRBUploadRequest request)
          Validate SRB upload request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SRBServiceHelper

public SRBServiceHelper()
Method Detail

generateSRBContentContext

public static java.lang.String generateSRBContentContext(SRBRequest request,
                                                         edu.sdsc.grid.io.srb.SRBFileSystem srbFileSystem)
Generate SRB content context.

Parameters:
request - SRBRequest object.
srbFileSystem - SRBFileSystem object.
Returns:
SRB content context.

fetchHighestRankedPerm

public static java.lang.String fetchHighestRankedPerm(edu.sdsc.grid.io.srb.SRBFile srbContent,
                                                      java.lang.String srbReadPerm,
                                                      java.lang.String srbWritePerm,
                                                      java.lang.String srbAllPerm)
                                               throws InvalidSRBRequestException
Retrieve the current user's highest ranked permission.

Parameters:
srbContent - SRBFile object.
srbReadPerm - SRB read permission value as recognised by JARGON API.
srbWritePerm - SRB write permission value as recognised by JARGON API.
srbAllPerm - SRB all permission value as recognised by JARGON API.
Returns:
highest ranked permission
Throws:
InvalidSRBRequestException - if request is invalid.

getProjectGroups

public static java.util.Map<java.lang.String,java.lang.String> getProjectGroups(edu.sdsc.grid.io.srb.SRBFile srbProjectObj)
                                                                         throws InvalidSRBRequestException
Retrieve admin and team groups from a project.

Parameters:
srbProjectObj - SRBFile.
Returns:
Map of admin and team group.
Throws:
InvalidSRBRequestException - if request is invalid.

getSRBParentProject

public static edu.sdsc.grid.io.srb.SRBFile getSRBParentProject(SRBContentRequest request,
                                                               java.lang.String contentType,
                                                               edu.sdsc.grid.io.srb.SRBFileSystem srbFileSystem)
                                                        throws InvalidSRBRequestException
Retrieve parent SRB project object.

Parameters:
request - SRBContentRequest.
contentType - content type.
srbFileSystem - SRBFileSystem.
Returns:
SRBFile representation of SRB project.
Throws:
InvalidSRBRequestException - if request is invalid.

generateSRBContentInfo

public static SRBContentInfo generateSRBContentInfo(edu.sdsc.grid.io.srb.SRBFile file)
Generate SRB contentInfo from SRBFile.

Parameters:
file - SRBFile object.
Returns:
SRBContentInfo object.

deleteFileOrDirectory

public static void deleteFileOrDirectory(edu.sdsc.grid.io.GeneralFile file)
                                  throws SRBServiceException
Delete a file or directory on SRB file system.

Parameters:
file - GeneralFile a reference to file.
Throws:
SRBServiceException - if error occurs in SRB service.

validateCreateDirectory

public static void validateCreateDirectory(SRBContentRequest request)
                                    throws InvalidSRBRequestException
validate parameters before create directory.

Parameters:
request - SRBDirRequest request for creating directory.
Throws:
InvalidSRBRequestException - throw SRBIncompleteRequestException if input information is incomplete.

validateListFile

public static void validateListFile(SRBContentRequest request)
                             throws InvalidSRBRequestException
validate parameters before list files.

Parameters:
request - SRBDirRequest request for listing files.
Throws:
InvalidSRBRequestException - throw SRBIncompleteRequestException if input information is incomplete.

validateDownloadRequest

public static void validateDownloadRequest(SRBDownloadRequest request)
                                    throws InvalidSRBRequestException
validate parameters before downloading files.

Parameters:
request - SRBFileRequest request for downloading a file.
Throws:
InvalidSRBRequestException - throw SRBIncompleteRequestException if input information is incomplete.

validateDeleteDirectory

public static void validateDeleteDirectory(SRBContentRequest request)
                                    throws InvalidSRBRequestException
validate parameters before deleting files.

Parameters:
request - SRBFileRequest request for deleting a file.
Throws:
InvalidSRBRequestException - throw SRBIncompleteRequestException if input information is incomplete.

validateUploadRequest

public static void validateUploadRequest(SRBUploadRequest request)
                                  throws InvalidSRBRequestException
Validate SRB upload request.

Parameters:
request - SRBFileRequest object.
Throws:
InvalidSRBRequestException - if validation fails.

validateAuthenticate

public static void validateAuthenticate(SRBLoginRequest request)
                                 throws InvalidSRBRequestException
validate SRBLoginRequest to make sure that all mendatory information are correctly provided.

Parameters:
request - SRBLoginRequest srb login request object.
Throws:
InvalidSRBRequestException - if request is incorrect.


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