001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 * 
010 *      http://www.apache.org/licenses/LICENSE-2.0
011 * 
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.oozie.client;
019
020import java.util.Date;
021
022/**
023 * Bean that represents an Oozie application instance.
024 */
025
026public interface CoordinatorAction {
027    /**
028     * Defines the possible status of an application instance.
029     */
030    public static enum Status {
031        WAITING,
032        READY,
033        SUBMITTED,
034        RUNNING,
035        SUSPENDED,
036        TIMEDOUT,
037        SUCCEEDED,
038        KILLED,
039        FAILED,
040        IGNORED,
041        SKIPPED
042    }
043
044    /**
045     * Return the coordinator job ID.
046     *
047     * @return the coordinator job ID.
048     */
049    String getJobId();
050
051    /**
052     * Return the application instance ID.
053     *
054     * @return the application instance ID.
055     */
056    String getId();
057
058    /**
059     * Return the nominal time for the application instance
060     *
061     * @return the nominal time for the application instance
062     */
063    Date getNominalTime();
064
065    /**
066     * Return the creation time for the application instance
067     *
068     * @return the creation time for the application instance
069     */
070    Date getCreatedTime();
071
072    /**
073     * Return the application instance ?? created configuration.
074     *
075     * @return the application instance configuration.
076     */
077    String getCreatedConf();
078
079
080    /**
081     * Return the last modified time
082     *
083     * @return the last modified time
084     */
085    Date getLastModifiedTime();
086
087    /**
088     * Return the action number
089     *
090     * @return the action number
091     */
092    int getActionNumber();
093
094    /**
095     * Return the run-time configuration
096     *
097     * @return the run-time configuration
098     */
099    String getRunConf();
100
101    /**
102     * Return the current status of the application instance.
103     *
104     * @return the current status of the application instance.
105     */
106    Status getStatus();
107
108    /**
109     * Return the PULL-based (directory based) missing dependencies for the
110     * particular action
111     *
112     * @return the missing dependencies for the particular action
113     */
114    String getMissingDependencies();
115
116    /**
117     * Return the PUSH-based (e.d HCatalog partition-based ) missing
118     * dependencies for the particular action
119     *
120     * @return the missing dependencies for the particular action
121     */
122    String getPushMissingDependencies();
123
124    /**
125     * Return the external status of the application instance.
126     *
127     * @return the external status of the application instance.
128     */
129    String getExternalStatus();
130
131    /**
132     * Return the URL to programmatically track the status of the application instance.
133     *
134     * @return the URL to programmatically track the status of the application instance.
135     */
136    String getTrackerUri();
137
138    /**
139     * Return the URL to the web console of the system executing the application instance.
140     *
141     * @return the URL to the web console of the system executing the application instance.
142     */
143    String getConsoleUrl();
144
145    /**
146     * Return the error code of the application instance, if it ended in ERROR.
147     *
148     * @return the error code of the application instance.
149     */
150    String getErrorCode();
151
152    /**
153     * Return the error message of the application instance, if it ended in ERROR.
154     *
155     * @return the error message of the application instance.
156     */
157    String getErrorMessage();
158
159    void setErrorCode(String errorCode);
160
161    void setErrorMessage(String errorMessage);
162
163    String getExternalId();
164
165}