001    /*
002     * $RCSfile: Dispatcher.java,v $ 
003     *
004     * Created on July 12, 2002, 10:56 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    /** Allows to dispatch a job to a remote machine and to retrieve it's output.
029     *
030     * @author  Gabriele Carcassi
031     * @version $Revision: 1.16 $ $Date: 2006/11/21 00:41:32 $
032     */
033    public interface Dispatcher {
034        /** Dispatches the processes described in the job request.
035         * To dispatch the job,
036         * the dispatcher will also recreate the remote environment needed
037         * by the job as specified in the JobDescription
038         * @param request job description and requirements, include input and output file and environment
039         * variables
040         */
041        void dispatch(Request request, List jobs);
042    
043        /** Retrieves the output of the job from the target machine. It will first
044         * check whether the job has terminated, and than it will retrieve the
045         * output files and delete any temporary files on the target machine.
046         * @param job job description and requirements, include input and output file and environment
047         * variables
048         */
049        void retrieveOutput(Request job, List jobs);
050        
051        /**
052        Kills the processes associated with this job.
053        */
054        void Kill(Request request, List jobs);
055        
056        /**
057        Returns The status of the job
058        */
059        String Status(Job job, int Processe);
060        
061        
062        /**
063        Cases the dispacher to stop dispaching and trys to kill dispached jobs
064        This is currently not implemented by any dispatchers.
065        */
066        void stop();
067        
068        
069        /**
070        Runs test(s) on underlying components to determine if submitting jobs should be attempted.
071        Will return true to indicate everything is alright and false if the test has failed.
072        */
073        boolean test(Queue queue);
074         
075          
076    }