001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.scheduler;
016    
017    import com.liferay.portal.kernel.messaging.Message;
018    import com.liferay.portal.kernel.scheduler.messaging.SchedulerRequest;
019    
020    import java.util.List;
021    
022    /**
023     * @author Michael C. Han
024     * @author Bruno Farache
025     * @author Shuyang Zhou
026     */
027    public interface SchedulerEngine {
028    
029            public static final String DESCRIPTION = "description";
030    
031            public static final int DESCRIPTION_MAX_LENGTH = 120;
032    
033            public static final String DESTINATION = "destination";
034    
035            public static final String DISABLE = "disable";
036    
037            public static final int GROUP_NAME_MAX_LENGTH = 80;
038    
039            public static final int JOB_NAME_MAX_LENGTH = 80;
040    
041            public static final String MESSAGE = "message";
042    
043            public static final String RECEIVER_KEY = "receiver_key";
044    
045            public List<SchedulerRequest> getScheduledJobs(String groupName)
046                    throws SchedulerException;
047    
048            public void schedule(
049                            Trigger trigger, String description, String destinationName,
050                            Message message)
051                    throws SchedulerException;
052    
053            public void shutdown() throws SchedulerException;
054    
055            public void start() throws SchedulerException;
056    
057            public void unschedule(Trigger trigger) throws SchedulerException;
058    
059    }