001 /* 002 * AbstractResourceStrategy.java 003 * 004 * Created on May 11, 2005, 3:19 PM 005 * 006 * This file is part of the STAR Scheduler. 007 * Copyright (c) 2002-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.Dispatchers; 025 026 import gov.bnl.star.offline.scheduler.Job; 027 028 /** 029 * This is an intrface for Resource Strategys. 030 * 031 *Resource Strategies are SUMS scheduler objects that allow the SUMS administrator 032 *to configure SUMS to define the quantity of resources a job is consuming to the 033 *batch system. Dispatchers that use resource strategies will except any 034 *combination of these classes and concatenate the output in to one delimitated 035 *string. Basically you must describe to the Resource Strategies how to generate 036 *the required string for the particular batch system. The good Resource 037 *Strategies are designed to be as generic as possible, to be able to meat the 038 *formatting needs of all batch systems. 039 * 040 * @author Levente Hajdu 041 */ 042 public interface AbstractResourceStrategy { 043 044 /** This function returns a string that represents the resource usage of the job, in such a format that it can be passed to the batch system. 045 * @param job The job from which the resource usage string will be generated 046 */ 047 public String prepareResourceUsageSwitch(Job job); 048 049 /**Returns the character that is used as the delimiter, this is most usaly the "," and this is the default if not set.*/ 050 public String getDelimiterCharacter(); 051 /**Sets the character that is used as the delimiter, this is most usaly the "," and this is the default if not set.*/ 052 public void setDelimiterCharacter(String delimiterCharacter); 053 054 }