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 * Bean that represents a workflow action in a workflow job.
021 */
022 public interface WorkflowAction {
023
024 /**
025 * Defines the possible stati of a action.
026 */
027 public static enum Status {
028 PREP,
029 RUNNING,
030 OK,
031 ERROR,
032 START_RETRY,
033 START_MANUAL,
034 DONE,
035 END_RETRY,
036 END_MANUAL,
037 KILLED,
038 FAILED, }
039
040 /**
041 * Return the action action ID.
042 *
043 * @return the action action ID.
044 */
045 String getId();
046
047 /**
048 * Return the action name.
049 *
050 * @return the action name.
051 */
052 String getName();
053
054 /**
055 * Return the action type.
056 *
057 * @return the action type.
058 */
059 String getType();
060
061
062 /**
063 * Return the action configuration.
064 *
065 * @return the action configuration.
066 */
067 String getConf();
068
069 /**
070 * Return the current status of the action action.
071 *
072 * @return the current status of the action action.
073 */
074 Status getStatus();
075
076 /**
077 * Return the number of retries of the action.
078 *
079 * @return the number of retries of the action.
080 */
081 int getRetries();
082
083 /**
084 * Return the start time of the action action.
085 *
086 * @return the start time of the action action.
087 */
088 Date getStartTime();
089
090 /**
091 * Return the end time of the action action.
092 *
093 * @return the end time of the action action.
094 */
095 Date getEndTime();
096
097 /**
098 * Return the transition a action took.
099 *
100 * @return the transition a action took.
101 */
102 String getTransition();
103
104 /**
105 * Return the action data.
106 *
107 * @return the action data.
108 */
109 String getData();
110
111 /**
112 * Return the external ID of the action.
113 *
114 * @return the external ID of the action.
115 */
116 String getExternalId();
117
118 /**
119 * Return the external status of the action.
120 *
121 * @return the external status of the action.
122 */
123 String getExternalStatus();
124
125 /**
126 * Return the URL to programmatically track the status of the action.
127 *
128 * @return the URL to programmatically track the status of the action.
129 */
130 String getTrackerUri();
131
132 /**
133 * Return the URL to the web console of the system executing the action.
134 *
135 * @return the URL to the web console of the system executing the action.
136 */
137 String getConsoleUrl();
138
139 /**
140 * Return the error code of the action, if it ended in ERROR.
141 *
142 * @return the error code of the action.
143 */
144 String getErrorCode();
145
146 /**
147 * Return the error message of the action, if it ended in ERROR.
148 *
149 * @return the error message of the action.
150 */
151 String getErrorMessage();
152 }