001    package railo.runtime.spooler;
002    
003    import java.io.Serializable;
004    
005    import railo.runtime.config.Config;
006    import railo.runtime.exp.PageException;
007    import railo.runtime.type.Array;
008    import railo.runtime.type.Struct;
009    
010    
011    
012    public interface SpoolerTask extends Serializable {
013            
014            public String getId();
015            
016            public void setId(String id);
017            
018            /**
019             * execute Task
020             * @param config 
021             * @throws SpoolerException
022             */
023            public Object execute(Config config) throws PageException; 
024    
025            /**
026             * returns a short info to the task
027             * @return Task subject
028             */
029            public String subject();
030            
031            /**
032             * returns task type as String
033             * @return Task subject
034             */
035            public String getType();
036            
037            /**
038             * returns advanced info to the task
039             * @return Task detail
040             */
041            public Struct detail();
042    
043            /**
044             * return last execution of this task
045             * @return last execution
046             */
047            public long lastExecution();
048    
049            public void setNextExecution(long nextExecution);
050    
051            public long nextExecution();
052            
053            /**
054             * returns how many tries to send are already done
055             * @return tries
056             */
057            public int tries();
058    
059            /**
060             * @return the exceptions
061             */
062            public Array getExceptions();
063    
064            public void setClosed(boolean closed);
065            
066            public boolean closed();
067    
068    
069            /**
070             * @return the plans
071             */
072            public ExecutionPlan[] getPlans();
073    
074    
075            /**
076             * @return the creation
077             */
078            public long getCreation();
079    
080    
081            public void setLastExecution(long lastExecution);
082    
083    }