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    import java.util.List;
019    
020    /**
021     * Bean that represents an Oozie application.
022     */
023    public interface CoordinatorJob {
024    
025        /**
026         * Defines the possible stati of an Oozie application.
027         */
028        public static enum Status {
029            PREP, PREMATER, RUNNING, SUSPENDED, SUCCEEDED, KILLED, FAILED
030        }
031    
032        /**
033         * Defines the possible execution order of an Oozie application.
034         */
035        public static enum Execution {
036            FIFO, LIFO, LAST_ONLY
037        }
038    
039        /**
040         * Defines the possible frequency unit of an Oozie application.
041         */
042        public static enum Timeunit {
043            MINUTE, HOUR, DAY, WEEK, MONTH, END_OF_DAY, END_OF_MONTH, NONE
044        }
045    
046        /**
047         * Return the path to the Oozie application.
048         *
049         * @return the path to the Oozie application.
050         */
051        String getAppPath();
052    
053        /**
054         * Return the name of the Oozie application (from the application definition).
055         *
056         * @return the name of the Oozie application.
057         */
058        String getAppName();
059    
060        /**
061         * Return the application ID.
062         *
063         * @return the application ID.
064         */
065        String getId();
066    
067        /**
068         * Return the application configuration.
069         *
070         * @return the application configuration.
071         */
072        String getConf();
073    
074        /**
075         * Return the application status.
076         *
077         * @return the application status.
078         */
079        Status getStatus();
080    
081        /**
082         * Return the frequency for the coord job in unit of minute
083         *
084         * @return the frequency for the coord job in unit of minute
085         */
086        int getFrequency();
087    
088        /**
089         * Return the timeUnit for the coord job, it could be, Timeunit enum, e.g. MINUTE, HOUR, DAY, WEEK or MONTH
090         *
091         * @return the time unit for the coord job
092         */
093        Timeunit getTimeUnit();
094    
095        /**
096         * Return the time zone information for the coord job
097         *
098         * @return the time zone information for the coord job
099         */
100        String getTimeZone();
101    
102        /**
103         * Return the concurrency for the coord job
104         *
105         * @return the concurrency for the coord job
106         */
107        int getConcurrency();
108    
109        /**
110         * Return the execution order policy for the coord job
111         *
112         * @return the execution order policy for the coord job
113         */
114        Execution getExecutionOrder();
115    
116        /**
117         * Return the time out value for the coord job
118         *
119         * @return the time out value for the coord job
120         */
121        int getTimeout();
122    
123        /**
124         * Return the date for the last action of the coord job
125         *
126         * @return the date for the last action of the coord job
127         */
128        Date getLastActionTime();
129    
130        /**
131         * Return the application next materialized time.
132         *
133         * @return the application next materialized time.
134         */
135        Date getNextMaterializedTime();
136    
137        /**
138         * Return the application start time.
139         *
140         * @return the application start time.
141         */
142        Date getStartTime();
143    
144        /**
145         * Return the application end time.
146         *
147         * @return the application end time.
148         */
149        Date getEndTime();
150    
151        /**
152         * Return the application user owner.
153         *
154         * @return the application user owner.
155         */
156        String getUser();
157    
158        /**
159         * Return the application group.
160         *
161         * @return the application group.
162         */
163        String getGroup();
164    
165        /**
166         * Return the BundleId.
167         *
168         * @return the BundleId.
169         */
170        String getBundleId();
171    
172        /**
173         * Return the application console URL.
174         *
175         * @return the application console URL.
176         */
177        String getConsoleUrl();
178    
179        /**
180         * Return list of coordinator actions.
181         *
182         * @return the list of coordinator actions.
183         */
184        List<CoordinatorAction> getActions();
185    }