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