001    /**
002     * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
003     * Licensed under the Apache License, Version 2.0 (the "License");
004     * you may not use this file except in compliance with the License.
005     * You may obtain a copy of the License at
006     *
007     *   http://www.apache.org/licenses/LICENSE-2.0
008     *
009     *  Unless required by applicable law or agreed to in writing, software
010     *  distributed under the License is distributed on an "AS IS" BASIS,
011     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012     *  See the License for the specific language governing permissions and
013     *  limitations under the License. See accompanying LICENSE file.
014     */
015    package org.apache.oozie.client;
016    
017    import java.util.Date;
018    
019    /**
020     * Interface that represents an Oozie Job.
021     */
022    public interface Job {
023        /**
024         * Defines the possible status of an Oozie JOB.
025         */
026        public static enum Status {
027            PREMATER, PREP, RUNNING, SUSPENDED, SUCCEEDED, KILLED, FAILED, PAUSED, PREPPAUSED, PREPSUSPENDED, RUNNINGWITHERROR, SUSPENDEDWITHERROR, PAUSEDWITHERROR, DONEWITHERROR
028        }
029    
030        /**
031         * Return the path to the Oozie application.
032         *
033         * @return the path to the Oozie application.
034         */
035        String getAppPath();
036    
037        /**
038         * Return the name of the Oozie application (from the application definition).
039         *
040         * @return the name of the Oozie application.
041         */
042        String getAppName();
043    
044        /**
045         * Return the JOB ID.
046         *
047         * @return the JOB ID.
048         */
049        String getId();
050    
051        /**
052         * Return the JOB configuration.
053         *
054         * @return the JOB configuration.
055         */
056        String getConf();
057    
058        /**
059         * Return the JOB status.
060         *
061         * @return the JOB status.
062         */
063        Status getStatus();
064    
065        /**
066         * Return the JOB user owner.
067         *
068         * @return the JOB user owner.
069         */
070        String getUser();
071    
072        /**
073         * Return the JOB group.
074         *
075         * @return the JOB group.
076         */
077        String getGroup();
078    
079        /**
080         * Return the JOB console URL.
081         *
082         * @return the JOB console URL.
083         */
084        String getConsoleUrl();
085    
086        /**
087         * Return the JOB start time.
088         *
089         * @return the JOB start time.
090         */
091        Date getStartTime();
092    
093        /**
094         * Return the JOB end time.
095         *
096         * @return the JOB end time.
097         */
098        Date getEndTime();
099    
100        /**
101         * Set the status of the job
102         *
103         * @param status
104         */
105        void setStatus(Job.Status status);
106    
107        /**
108         * Set pending to true
109         */
110        void setPending();
111    
112        /**
113         * Set pending to
114         */
115        void resetPending();
116    
117        /**
118         * Get pauseTime
119         *
120         * @return pauseTime
121         */
122        public Date getPauseTime();
123    
124            /**
125         * Return externalId
126         *
127         * @return externalId
128         */
129        public String getExternalId();
130    
131    }