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