gov.bnl.star.offline.scheduler.util.sandbox
Class ZipSandbox

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.util.sandbox.ZipSandbox
All Implemented Interfaces:
Sandbox

public class ZipSandbox
extends java.lang.Object
implements Sandbox

This sandbox variant will zip all files packaged by the user in the user's home directory. Then it will copy the zip to the users working directory and expand it.

Author:
Levente Hajdu

Constructor Summary
ZipSandbox()
          Creates a new instance of ZipSandbox
 
Method Summary
 void addPackage(SandboxPackage sandboxPackage)
          Used to add a package to the sand box
 void addSandboxedFiles(java.lang.String file)
           
 java.lang.String CopyCommand(SandboxPackage packageObj)
           
 java.util.List getPackages()
          Returns a List of sandboxPackage object that are part of the sandbox
 java.util.List getSandboxedFiles()
           
 java.lang.String gridInstallCommand(SandboxPackage packageObj, Job job)
           
 java.lang.String InitializationCommands()
           
 java.lang.String installCommand(SandboxPackage packageObj, Job job)
          Chech program locations for unzip
 java.lang.String localInstallCommand(SandboxPackage packageObj, Job job)
           
 boolean MakePackage(SandboxPackage packageObj, Request request)
          Zip the users requested files
 void packageAlreadyExistWarning(java.lang.String fileName)
           
 boolean PackageExists(SandboxPackage packageObj)
           
 void Sandbox()
          Creates a new instance of Sandbox
 void setPackages(java.util.List packages)
          Sets the list of packages that make up the sand box, it is best to set one by one using addPackage(SandboxPackage sandboxPackage)
 void setSandboxedFiles(java.util.List SandboxedFiles)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipSandbox

public ZipSandbox()
Creates a new instance of ZipSandbox

Method Detail

CopyCommand

public java.lang.String CopyCommand(SandboxPackage packageObj)
Specified by:
CopyCommand in interface Sandbox
Returns:
the cammand to copy the pakege

MakePackage

public boolean MakePackage(SandboxPackage packageObj,
                           Request request)
Zip the users requested files

Specified by:
MakePackage in interface Sandbox
Parameters:
packageObj - The package object holding inforamtion about the files to be packaged.
request - The request object of the job.
Returns:
True if the package was biult, else return false.

packageAlreadyExistWarning

public void packageAlreadyExistWarning(java.lang.String fileName)

PackageExists

public boolean PackageExists(SandboxPackage packageObj)
Specified by:
PackageExists in interface Sandbox
Returns:
true of the package exists

Sandbox

public void Sandbox()
Description copied from interface: Sandbox
Creates a new instance of Sandbox

Specified by:
Sandbox in interface Sandbox

installCommand

public java.lang.String installCommand(SandboxPackage packageObj,
                                       Job job)
Chech program locations for unzip

Specified by:
installCommand in interface Sandbox
Returns:
the install command to install the package

localInstallCommand

public java.lang.String localInstallCommand(SandboxPackage packageObj,
                                            Job job)

gridInstallCommand

public java.lang.String gridInstallCommand(SandboxPackage packageObj,
                                           Job job)

setPackages

public void setPackages(java.util.List packages)
Description copied from interface: Sandbox
Sets the list of packages that make up the sand box, it is best to set one by one using addPackage(SandboxPackage sandboxPackage)

Specified by:
setPackages in interface Sandbox

getPackages

public java.util.List getPackages()
Returns a List of sandboxPackage object that are part of the sandbox

Specified by:
getPackages in interface Sandbox

addPackage

public void addPackage(SandboxPackage sandboxPackage)
Used to add a package to the sand box

Specified by:
addPackage in interface Sandbox

getSandboxedFiles

public java.util.List getSandboxedFiles()
Specified by:
getSandboxedFiles in interface Sandbox

setSandboxedFiles

public void setSandboxedFiles(java.util.List SandboxedFiles)
Specified by:
setSandboxedFiles in interface Sandbox

addSandboxedFiles

public void addSandboxedFiles(java.lang.String file)
Specified by:
addSandboxedFiles in interface Sandbox

InitializationCommands

public java.lang.String InitializationCommands()
Specified by:
InitializationCommands in interface Sandbox


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.