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     */
018    package org.apache.oozie.client;
019    
020    import java.util.Date;
021    
022    /**
023     * Bean that represents an Oozie application instance.
024     */
025    
026    public interface CoordinatorAction {
027        /**
028         * Defines the possible stati 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            DISCARDED
041        }
042    
043        /**
044         * Return the coordinator job ID.
045         *
046         * @return the coordinator job ID.
047         */
048        String getJobId();
049    
050        /**
051         * Return the application instance ID.
052         *
053         * @return the application instance ID.
054         */
055        String getId();
056    
057        /**
058         * Return the nominal time for the application instance
059         *
060         * @return the nominal time for the application instance
061         */
062        Date getNominalTime();
063    
064        /**
065         * Return the creation time for the application instance
066         *
067         * @return the creation time for the application instance
068         */
069        Date getCreatedTime();
070    
071        /**
072         * Return the application instance ?? created configuration.
073         *
074         * @return the application instance configuration.
075         */
076        String getCreatedConf();
077    
078    
079        /**
080         * Return the last modified time
081         *
082         * @return the last modified time
083         */
084        Date getLastModifiedTime();
085    
086        /**
087         * Return the action number
088         *
089         * @return the action number
090         */
091        int getActionNumber();
092    
093        /**
094         * Return the run-time configuration
095         *
096         * @return the run-time configuration
097         */
098        String getRunConf();
099    
100        /**
101         * Return the current status of the application instance.
102         *
103         * @return the current status of the application instance.
104         */
105        Status getStatus();
106    
107        /**
108         * Return the missing dependencies for the particular action
109         *
110         * @return the missing dependencies for the particular action
111         */
112        String getMissingDependencies();
113    
114    
115        /**
116         * Return the external status of the application instance.
117         *
118         * @return the external status of the application instance.
119         */
120        String getExternalStatus();
121    
122        /**
123         * Return the URL to programmatically track the status of the application instance.
124         *
125         * @return the URL to programmatically track the status of the application instance.
126         */
127        String getTrackerUri();
128    
129        /**
130         * Return the URL to the web console of the system executing the application instance.
131         *
132         * @return the URL to the web console of the system executing the application instance.
133         */
134        String getConsoleUrl();
135    
136        /**
137         * Return the error code of the application instance, if it ended in ERROR.
138         *
139         * @return the error code of the application instance.
140         */
141        String getErrorCode();
142    
143        /**
144         * Return the error message of the application instance, if it ended in ERROR.
145         *
146         * @return the error message of the application instance.
147         */
148        String getErrorMessage();
149    
150        void setErrorCode(String errorCode);
151    
152        void setErrorMessage(String errorMessage);
153    
154        String getExternalId();
155    
156    }