001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.activemq.broker.jmx;
018    
019    import javax.management.openmbean.TabularData;
020    
021    
022    
023    public interface JobSchedulerViewMBean {
024        /**
025         * remove all jobs scheduled to run at this time
026         * @param time
027         * @throws Exception
028         */
029        @MBeanInfo("remove jobs with matching execution time")
030        public abstract void removeJobAtScheduledTime(@MBeanInfo("time: yyyy-MM-dd hh:mm:ss")String time) throws Exception;
031    
032        /**
033         * remove a job with the matching jobId
034         * @param jobId
035         * @throws Exception
036         */
037        @MBeanInfo("remove jobs with matching jobId")
038        public abstract void removeJob(@MBeanInfo("jobId")String jobId) throws Exception;
039        
040        /**
041         * remove all the Jobs from the scheduler
042         * @throws Exception
043         */
044        @MBeanInfo("remove all scheduled jobs")
045        public abstract void removeAllJobs() throws Exception;
046        
047        /**
048         * remove all the Jobs from the scheduler that are due between the start and finish times
049         * @param start time 
050         * @param finish time
051         * @throws Exception
052         */
053        @MBeanInfo("remove all scheduled jobs between time ranges ")
054        public abstract void removeAllJobs(@MBeanInfo("start: yyyy-MM-dd hh:mm:ss")String start,@MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String finish) throws Exception;
055        
056    
057        
058        /**
059         * Get the next time jobs will be fired
060         * @return the time in milliseconds
061         * @throws Exception 
062         */
063        @MBeanInfo("get the next time a job is due to be scheduled ")
064        public abstract String getNextScheduleTime() throws Exception;
065        
066        /**
067         * Get all the jobs scheduled to run next
068         * @return a list of jobs that will be scheduled next
069         * @throws Exception
070         */
071        @MBeanInfo("get the next job(s) to be scheduled. Not HTML friendly ")
072        public abstract TabularData getNextScheduleJobs() throws Exception;
073        
074        /**
075         * Get all the outstanding Jobs
076         * @return a  table of all jobs
077         * @throws Exception
078    
079         */
080        @MBeanInfo("get the scheduled Jobs in the Store. Not HTML friendly ")
081        public abstract TabularData getAllJobs() throws Exception;
082        
083        /**
084         * Get all outstanding jobs due to run between start and finish
085         * @param start
086         * @param finish
087         * @return a table of jobs in the range
088         * @throws Exception
089    
090         */
091        @MBeanInfo("get the scheduled Jobs in the Store within the time range. Not HTML friendly ")
092        public abstract TabularData getAllJobs(@MBeanInfo("start: yyyy-MM-dd hh:mm:ss")String start,@MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String finish)throws Exception;
093    }