001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.activemq.broker.scheduler; 018 019/** 020 * Interface for a scheduled Job object. 021 * 022 * Each Job is identified by a unique Job Id which can be used to reference the Job 023 * in the Job Scheduler store for updates or removal. 024 */ 025public interface Job { 026 027 /** 028 * @return the jobId 029 */ 030 public abstract String getJobId(); 031 032 /** 033 * @return the repeat 034 */ 035 public abstract int getRepeat(); 036 037 /** 038 * @return the start 039 */ 040 public abstract long getStart(); 041 042 /** 043 * @return the Delay 044 */ 045 public abstract long getDelay(); 046 047 /** 048 * @return the period 049 */ 050 public abstract long getPeriod(); 051 052 /** 053 * @return the cron entry 054 */ 055 public abstract String getCronEntry(); 056 057 /** 058 * @return the payload 059 */ 060 public abstract byte[] getPayload(); 061 062 /** 063 * Get the start time as a Date time string 064 * @return the date time 065 */ 066 public String getStartTime(); 067 068 /** 069 * Get the time the job is next due to execute 070 * @return the date time 071 */ 072 public String getNextExecutionTime(); 073 074 /** 075 * Gets the total number of times this job has executed. 076 * 077 * @returns the number of times this job has been executed. 078 */ 079 public int getExecutionCount(); 080 081}