001    /*
002     * $RCSfile: Policy.java,v $ 
003     *
004     * Created on July 12, 2002, 10:25 AM
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    package gov.bnl.star.offline.scheduler;
024    
025    import gov.bnl.star.offline.scheduler.request.Request;
026    import java.util.*;
027    
028    /** A policy to decide how and where a job should be dispatched. A policy class
029     *  will be needed to create any scheduler.
030     *  @author Gabriele Carcassi
031     *  @version $Revision: 1.13 $ $Date: 2006/11/21 00:41:32 $
032     */
033    public interface Policy {
034        /** Decides how and where to run the job according to its
035         * requirements. The policy has to fill in the process list of the job
036         * description. This will be used by the dispatcher to execute the job.
037         * A policy, therefore, will receive a JobRequest with no processes, and it should
038         * return a JobRequest with all the necessary processes created and fully
039         * configured.
040         * <p>
041         * The Policy is allowed to query the farm status, use the catalog and
042         * trigger file movements. It can slice the job into more than one
043         * process, according to, for example, where the input files are located.
044         * @param request the job description and its requirements
045         */
046        List assignTargetMachine(Request request);
047    }