001/*
002 * (C) Copyright 2007-2018 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Florent Guillaume
018 *     Florent Munch
019 */
020package org.nuxeo.ecm.core.scheduler;
021
022import java.io.Serializable;
023
024/**
025 * Schedule entry.
026 * <p>
027 * Holds information about a schedule, including the event to send, the username to use to open the session, and the
028 * periodicity for the schedule.
029 */
030public interface Schedule extends Serializable {
031
032    /**
033     * Returns the schedule job id.
034     *
035     * @return the schedule job id.
036     */
037    String getId();
038
039    /**
040     * Returns an instance of the {@link EventJobFactory} ({@link DefaultEventJobFactory} by default).
041     *
042     * @since 10.2
043     * @return An instance of {@link EventJobFactory}.
044     */
045    EventJobFactory getJobFactory();
046
047    /**
048     * Returns the event id.
049     *
050     * @return the event id
051     */
052    String getEventId();
053
054    /**
055     * Returns the event category.
056     *
057     * @return the event category
058     */
059    String getEventCategory();
060
061    /**
062     * Returns the cron expression.
063     *
064     * @return the cron expression
065     */
066    String getCronExpression();
067
068    /**
069     * Returns the username.
070     *
071     * @return the username
072     */
073    String getUsername();
074
075    /**
076     * Returns true if the scheduler is enabled and the job scheduled for execution
077     *
078     * @since 5.7.3
079     * @return
080     */
081    boolean isEnabled();
082
083    /**
084     * Returns the timezone to be used for the Cron Expression.
085     *
086     * @since 10.2
087     * @return the timezone, or {@code null} if not specified
088     */
089    String getTimeZone();
090
091
092}