001 /* 002 * Sandbox.java 003 * 004 * Created on October 25, 2005, 1:16 PM 005 * 006 * This file is part of the STAR Scheduler. 007 * Copyright (c) 2003-2006 STAR Collaboration - Brookhaven National Laboratory 008 * 009 * STAR Scheduler is free software; you can redistribute it and/or modify 010 * it under the terms of the GNU General Public License as published by 011 * the Free Software Foundation; either version 2 of the License, or 012 * (at your option) any later version. 013 * 014 * STAR Scheduler is distributed in the hope that it will be useful, 015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 017 * GNU General Public License for more details. 018 * 019 * You should have received a copy of the GNU General Public License 020 * along with STAR Scheduler; if not, write to the Free Software 021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 022 */ 023 024 package gov.bnl.star.offline.scheduler.util.sandbox; 025 026 import gov.bnl.star.offline.scheduler.util.sandbox.SandboxPackage; 027 import gov.bnl.star.offline.scheduler.request.Request; 028 import gov.bnl.star.offline.scheduler.Job; 029 030 import java.util.List; 031 import java.util.ArrayList; 032 033 /** 034 * Base interface for all sandboxs 035 * 036 * @author Levente Hajdu 037 */ 038 public interface Sandbox { 039 040 /** Creates a new instance of Sandbox */ 041 public void Sandbox(); 042 043 /** Used to add a package to the sand box */ 044 public void addPackage(SandboxPackage sandboxPackage); 045 /** Returns a List of sandboxPackage object that are part of the sandbox */ 046 public List getPackages(); 047 /** Sets the list of packages that make up the sand box, it is best to set one by one using addPackage(SandboxPackage sandboxPackage) */ 048 public void setPackages(List packages); 049 050 /** Make the package if possible. 051 * @return true if the package was made */ 052 public boolean MakePackage(SandboxPackage packageObj, Request request); 053 054 /** @return true of the package exists */ 055 public boolean PackageExists(SandboxPackage packageObj); 056 057 public String InitializationCommands(); 058 059 /**@return the install command to install the package*/ 060 public String installCommand(SandboxPackage packageObj, Job job); 061 062 /** @return the cammand to copy the pakege*/ 063 public String CopyCommand(SandboxPackage packageObj); 064 065 /* Gets the files that the sand box has packed. */ 066 public List getSandboxedFiles(); 067 /* Sets the files that the sand box has packed. */ 068 public void setSandboxedFiles(List SandboxedFiles); 069 /* Adds a file to the list of sandboxed files. */ 070 public void addSandboxedFiles(String file); 071 072 073 074 075 }