au.edu.archer.service.srb.impl
Class SRBServiceImpl

java.lang.Object
  extended by au.edu.archer.service.srb.impl.SRBServiceImpl
All Implemented Interfaces:
Service, SRBService

public class SRBServiceImpl
extends java.lang.Object
implements SRBService

Service implementing SRBService.


Field Summary
 
Fields inherited from interface au.edu.archer.service.srb.api.SRBService
ADMN_GRP, DATAFILE, DATASET, EXPERIMENT, PROJECT, SAMPLE, SRB_ALL, SRB_ANNOTATE, SRB_NULL, SRB_READ, SRB_WRITE, TEAM_GRP
 
Constructor Summary
SRBServiceImpl()
           
 
Method Summary
 void addGroupPermissions(SRBGroupPermissionRequest request)
          Modify group permissions.
 SRBLoginResponse authenticate(SRBLoginRequest request)
          Authenticate SRB login request.
 void copyDataset(SRBCopyRequest request)
          Copy Dataset.
 SRBContentInfo createDirectory(SRBContentRequest request)
          Create Directory.
 void deleteContent(SRBContentRequest request)
          Delete a SRB content[File, Directory, Collection ...].
 SRBDownloadResponse downloadContent(SRBDownloadRequest request)
          Get the content of the given file in the specified directory.
 java.util.Map<java.lang.String,java.lang.String> getAllSRBGroups(SRBRequest request)
          Retrieve all SRB groups.
 SRBContentInfo getContentInfo(SRBContentRequest request)
          Retrieve SRB content info.
 java.util.Map<java.lang.String,java.lang.String> getProjectGroups(SRBContentRequest request, java.lang.String contentType)
          Retrieve parent project groups.
 edu.sdsc.grid.io.srb.SRBFileSystem getSrbFileSystem()
          Get srbFileSystem.
 boolean isAuthorised(SRBContentRequest request, int operation)
          Check if user is authorised to perform a SRB operation.
 java.util.List<SRBContentInfo> listAll(SRBContentRequest request)
          Retrieve staging area content.
 java.util.List<SRBContentInfo> listDir(SRBContentRequest request)
          List all sub-directories in the given directory.
 java.util.List<SRBContentInfo> listFile(SRBContentRequest request)
          List all files in the given directory.
 java.util.List<SRBContentInfo> listScratchDirs(SRBContentRequest request)
          List all sub-directories in a scratch area directory that are 4 level down from the scratch area.
 SRBContentInfo renameContent(SRBRenameContentRequest request)
          Rename SRB content.
 void setSrbFileSystem(edu.sdsc.grid.io.srb.SRBFileSystem srbFileSystem)
          Set srbFileSystem.
 java.lang.String uploadContent(SRBUploadRequest request)
          Upload file to SRB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SRBServiceImpl

public SRBServiceImpl()
Method Detail

authenticate

public SRBLoginResponse authenticate(SRBLoginRequest request)
                              throws InvalidSRBRequestException
Authenticate SRB login request.

Specified by:
authenticate in interface SRBService
Parameters:
request - SRBLoginRequest object.
Returns:
SRBLoginResponse a SRBLoginResponse object contains sessionId.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

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 SRBService
Parameters:
request - SRBContentRequest.
operation - operation code.
Returns:
true if authorised, false otherwise.
Throws:
InvalidSRBRequestException - if any errors occur.

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 SRBService
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 SRBService
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 SRBService
Parameters:
request - SRBGroupPermissionRequest.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

listAll

public java.util.List<SRBContentInfo> listAll(SRBContentRequest request)
                                       throws InvalidSRBRequestException
Retrieve staging area content.

Specified by:
listAll in interface SRBService
Parameters:
request - SRBContentRequest object.
Returns:
List of staging area content.
Throws:
InvalidSRBRequestException - if the request parameters are invalid.

listScratchDirs

public java.util.List<SRBContentInfo> listScratchDirs(SRBContentRequest request)
                                               throws InvalidSRBRequestException
List all sub-directories in a scratch area directory that are 4 level down from the scratch area. The supplied directory name is relative to the home directory.

Specified by:
listScratchDirs in interface SRBService
Parameters:
request - srbDirRequest request object.
Returns:
List of SDirectory object.
Throws:
InvalidSRBRequestException - if request is invalid.

listDir

public java.util.List<SRBContentInfo> listDir(SRBContentRequest request)
                                       throws InvalidSRBRequestException
List all sub-directories in the given directory. The supplied directory name is relative to the home directory.

Specified by:
listDir in interface SRBService
Parameters:
request - request object.
Returns:
List of SDirectory object.
Throws:
InvalidSRBRequestException - if request is invalid.

listFile

public java.util.List<SRBContentInfo> listFile(SRBContentRequest request)
                                        throws InvalidSRBRequestException
List all files in the given directory. The supplied directory name is relative to the home directory.

Specified by:
listFile in interface SRBService
Parameters:
request - request object.
Returns:
List of SFile object.
Throws:
InvalidSRBRequestException - if request is invalid.

getContentInfo

public SRBContentInfo getContentInfo(SRBContentRequest request)
                              throws InvalidSRBRequestException
Retrieve SRB content info.

Specified by:
getContentInfo in interface SRBService
Parameters:
request - SRBContentRequest
Returns:
SFile object.
Throws:
InvalidSRBRequestException - if the request parameters are invalid

createDirectory

public SRBContentInfo createDirectory(SRBContentRequest request)
                               throws InvalidSRBRequestException,
                                      SRBServiceException
Create Directory.

Specified by:
createDirectory in interface SRBService
Parameters:
request - request object.
Returns:
SRBContentInfo object.
Throws:
InvalidSRBRequestException - if request is invalid.
SRBServiceException - if error occurs in SRB service.

renameContent

public SRBContentInfo renameContent(SRBRenameContentRequest request)
                             throws SRBServiceException
Rename SRB content.

Specified by:
renameContent in interface SRBService
Parameters:
request - SRBRenameContentRequest object.
Returns:
SRBContentInfo object.
Throws:
SRBServiceException - if failed to change name.

uploadContent

public java.lang.String uploadContent(SRBUploadRequest request)
                               throws InvalidSRBRequestException,
                                      SRBServiceException
Upload file to SRB.

Specified by:
uploadContent in interface SRBService
Parameters:
request - request object.
Returns:
String SRB File Location.
Throws:
InvalidSRBRequestException - if request is invalid.
SRBServiceException - if error occurs in SRB service.

downloadContent

public SRBDownloadResponse downloadContent(SRBDownloadRequest request)
                                    throws InvalidSRBRequestException
Get the content of the given file in the specified directory.

Specified by:
downloadContent in interface SRBService
Parameters:
request - SRBFileRequest down file request.
Returns:
SRBDownloadResponse object.
Throws:
InvalidSRBRequestException - if request is invalid.

deleteContent

public void deleteContent(SRBContentRequest request)
                   throws InvalidSRBRequestException,
                          SRBServiceException
Delete a SRB content[File, Directory, Collection ...].

Specified by:
deleteContent in interface SRBService
Parameters:
request - request object.
Throws:
InvalidSRBRequestException - if request is invalid.
SRBServiceException - if error occurs in SRB service.

getSrbFileSystem

public edu.sdsc.grid.io.srb.SRBFileSystem getSrbFileSystem()
Get srbFileSystem.

Returns:
srbFileSystem SRBFileSystem

setSrbFileSystem

public void setSrbFileSystem(edu.sdsc.grid.io.srb.SRBFileSystem srbFileSystem)
Set srbFileSystem.

Parameters:
srbFileSystem - SRBFileSystem to set.

copyDataset

public void copyDataset(SRBCopyRequest request)
                 throws SRBServiceException
Copy Dataset.

Specified by:
copyDataset in interface SRBService
Parameters:
request - SRBCopyRequest copy request object.
Throws:
SRBServiceException - throws SRBServiceException if error happens.


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