001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.spooler; 020 021import java.io.Serializable; 022 023import lucee.runtime.config.Config; 024import lucee.runtime.exp.PageException; 025import lucee.runtime.type.Array; 026import lucee.runtime.type.Struct; 027 028 029// FUTURE extend interface task 030public interface SpoolerTask extends Serializable { 031 032 public String getId(); 033 034 public void setId(String id); 035 036 /** 037 * execute Task 038 * @param config 039 * @throws SpoolerException 040 */ 041 public Object execute(Config config) throws PageException; 042 043 /** 044 * returns a short info to the task 045 * @return Task subject 046 */ 047 public String subject(); 048 049 /** 050 * returns task type as String 051 * @return Task subject 052 */ 053 public String getType(); 054 055 /** 056 * returns advanced info to the task 057 * @return Task detail 058 */ 059 public Struct detail(); 060 061 /** 062 * return last execution of this task 063 * @return last execution 064 */ 065 public long lastExecution(); 066 067 public void setNextExecution(long nextExecution); 068 069 public long nextExecution(); 070 071 /** 072 * returns how many tries to send are already done 073 * @return tries 074 */ 075 public int tries(); 076 077 /** 078 * @return the exceptions 079 */ 080 public Array getExceptions(); 081 082 public void setClosed(boolean closed); 083 084 public boolean closed(); 085 086 087 /** 088 * @return the plans 089 */ 090 public ExecutionPlan[] getPlans(); 091 092 093 /** 094 * @return the creation 095 */ 096 public long getCreation(); 097 098 099 public void setLastExecution(long lastExecution); 100 101}