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