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
022/**
023 * Schedule entry.
024 * <p>
025 * Holds information about a schedule, including the event to send, the username to use to open the session, and the
026 * periodicity for the schedule.
027 */
028public interface Schedule {
029
030    /**
031     * Returns the schedule job id.
032     *
033     * @return the schedule job id.
034     */
035    String getId();
036
037    /**
038     * Returns an instance of the {@link EventJobFactory} ({@link DefaultEventJobFactory} by default).
039     *
040     * @since 10.2
041     * @return An instance of {@link EventJobFactory}.
042     */
043    EventJobFactory getJobFactory();
044
045    /**
046     * Returns the event id.
047     *
048     * @return the event id
049     */
050    String getEventId();
051
052    /**
053     * Returns the event category.
054     *
055     * @return the event category
056     */
057    String getEventCategory();
058
059    /**
060     * Returns the cron expression.
061     *
062     * @return the cron expression
063     */
064    String getCronExpression();
065
066    /**
067     * Returns the username.
068     *
069     * @return the username
070     */
071    String getUsername();
072
073    /**
074     * Returns true if the scheduler is enabled and the job scheduled for execution
075     *
076     * @since 5.7.3
077     */
078    boolean isEnabled();
079
080    /**
081     * Returns the timezone to be used for the Cron Expression.
082     *
083     * @since 10.2
084     * @return the timezone, or {@code null} if not specified
085     */
086    String getTimeZone();
087
088
089}