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 019package org.apache.oozie.client; 020 021import java.util.Date; 022 023/** 024 * Interface that represents an Oozie Job. 025 */ 026public interface Job { 027 /** 028 * Defines the possible status of an Oozie JOB. 029 */ 030 enum Status { 031 PREMATER, PREP, RUNNING, SUSPENDED, SUCCEEDED, KILLED, FAILED, PAUSED,PREPPAUSED, 032 PREPSUSPENDED, RUNNINGWITHERROR, SUSPENDEDWITHERROR, PAUSEDWITHERROR, DONEWITHERROR, IGNORED 033 } 034 035 /** 036 * Return the path to the Oozie application. 037 * 038 * @return the path to the Oozie application. 039 */ 040 String getAppPath(); 041 042 /** 043 * Return the name of the Oozie application (from the application definition). 044 * 045 * @return the name of the Oozie application. 046 */ 047 String getAppName(); 048 049 /** 050 * Return the JOB ID. 051 * 052 * @return the JOB ID. 053 */ 054 String getId(); 055 056 /** 057 * Return the JOB configuration. 058 * 059 * @return the JOB configuration. 060 */ 061 String getConf(); 062 063 /** 064 * Return the JOB status. 065 * 066 * @return the JOB status. 067 */ 068 Status getStatus(); 069 070 /** 071 * Return the JOB user owner. 072 * 073 * @return the JOB user owner. 074 */ 075 String getUser(); 076 077 /** 078 * Return the JOB group. 079 * 080 * @return the JOB group. 081 */ 082 @Deprecated 083 String getGroup(); 084 085 /** 086 * Return the workflow job group. 087 * 088 * @return the workflow job group. 089 */ 090 String getAcl(); 091 092 /** 093 * Return the JOB console URL. 094 * 095 * @return the JOB console URL. 096 */ 097 String getConsoleUrl(); 098 099 /** 100 * Return the JOB start time. 101 * 102 * @return the JOB start time. 103 */ 104 Date getStartTime(); 105 106 /** 107 * Return the JOB end time. 108 * 109 * @return the JOB end time. 110 */ 111 Date getEndTime(); 112 113 /** 114 * Set the status of the job 115 * 116 * @param status 117 */ 118 void setStatus(Job.Status status); 119 120 /** 121 * Set pending to true 122 */ 123 void setPending(); 124 125 /** 126 * Set pending to 127 */ 128 void resetPending(); 129 130 /** 131 * Get pauseTime 132 * 133 * @return pauseTime 134 */ 135 Date getPauseTime(); 136 137 /** 138 * Return externalId 139 * 140 * @return externalId 141 */ 142 String getExternalId(); 143 144}