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.schedule;
020
021import java.net.URL;
022
023import lucee.commons.io.res.Resource;
024import lucee.commons.security.Credentials;
025import lucee.runtime.net.proxy.ProxyData;
026import lucee.runtime.type.dt.Date;
027import lucee.runtime.type.dt.Time;
028
029
030/**
031 * a single scheduler task
032 */
033public interface ScheduleTask {
034
035    /**
036     * Field <code>OPERATION_HTTP_REQUEST</code>
037     */
038    public static final short OPERATION_HTTP_REQUEST = 0;
039
040    /**
041     * Field <code>INTERVAL_ONCE</code>
042     */
043    public static final int INTERVAL_ONCE = 0;
044
045    /**
046     * Field <code>INTERVAL_DAY</code>
047     */
048    public static final int INTERVAL_DAY = 1;
049
050    /**
051     * Field <code>INTERVAL_WEEK</code>
052     */
053    public static final int INTERVAL_WEEK = 2;
054
055    /**
056     * Field <code>INTERVAL_MONTH</code>
057     */
058    public static final int INTERVAL_MONTH = 3;
059
060    /**
061     * @return Returns the credentials.
062     */
063    public abstract Credentials getCredentials();
064
065    /**
066     * @return Returns has credentials.
067     */
068    public abstract boolean hasCredentials();
069
070
071    /**
072     * @return Returns the file.
073     */
074    public abstract Resource getResource();
075
076    /**
077     * @return Returns the interval.
078     */
079    public abstract int getInterval();
080
081    /**
082     * @return Returns the operation.
083     */
084    public abstract short getOperation();
085
086    /**
087     * @return Returns the proxyHost.
088     */
089    public abstract ProxyData getProxyData();
090
091
092    /**
093     * @return Returns the resolveURL.
094     */
095    public abstract boolean isResolveURL();
096
097    /**
098     * @return Returns the task.
099     */
100    public abstract String getTask();
101
102    /**
103     * @return Returns the timeout.
104     */
105    public abstract long getTimeout();
106
107    /**
108     * @return Returns the url.
109     */
110    public abstract URL getUrl();
111
112    /**
113     * @param nextExecution
114     */
115    public abstract void setNextExecution(long nextExecution);
116
117    /**
118     * @return Returns the nextExecution.
119     */
120    public abstract long getNextExecution();
121
122    /**
123     * @return Returns the endDate.
124     */
125    public abstract Date getEndDate();
126
127    /**
128     * @return Returns the startDate.
129     */
130    public abstract Date getStartDate();
131
132    /**
133     * @return Returns the endTime.
134     */
135    public abstract Time getEndTime();
136
137    /**
138     * @return Returns the startTime.
139     */
140    public abstract Time getStartTime();
141
142    /**
143     * @return returns interval definition as String
144     */
145    public abstract String getIntervalAsString();
146
147    /**
148     * @return Returns the strInterval.
149     */
150    public abstract String getStringInterval();
151
152    /**
153     * @return Returns the publish.
154     */
155    public abstract boolean isPublish();
156
157    /**
158     * @return Returns the valid.
159     */
160    public abstract boolean isValid();
161
162    /**
163     * @param valid The valid to set.
164     */
165    public abstract void setValid(boolean valid);
166
167        /**
168         * @return the hidden
169         */
170        public boolean isHidden();
171
172        /**
173         * @param hidden the hidden to set
174         */
175        public void setHidden(boolean hidden);
176
177        public boolean isPaused();
178}