001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *      http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    package org.apache.oozie.sla.listener;
019    
020    import org.apache.hadoop.conf.Configuration;
021    import org.apache.oozie.client.event.SLAEvent;
022    
023    /**
024     * Event listener for SLA related events, defining methods corresponding to
025     * SLA mets/misses
026     */
027    public abstract class SLAEventListener {
028    
029        /**
030         * Initialize the listener
031         * @param conf
032         */
033        public abstract void init(Configuration conf) throws Exception;
034    
035        /**
036         * Destroy the listener
037         */
038        public abstract void destroy();
039    
040        /**
041         * on SLA job start-time limit met
042         * @param SLAEvent
043         */
044        public abstract void onStartMet(SLAEvent work);
045    
046        /**
047         * on SLA job start-time limit missed
048         * @param SLAEvent
049         */
050        public abstract void onStartMiss(SLAEvent event);
051    
052        /**
053         * on SLA job end-time limit met
054         * @param SLAEvent
055         */
056        public abstract void onEndMet(SLAEvent work);
057    
058        /**
059         * on SLA job end-time limit missed
060         * @param SLAEvent
061         */
062        public abstract void onEndMiss(SLAEvent event);
063    
064        /**
065         * on SLA job duration limit met
066         * @param SLAEvent
067         */
068        public abstract void onDurationMet(SLAEvent work);
069    
070        /**
071         * on SLA job duration limit missed
072         * @param SLAEvent
073         */
074        public abstract void onDurationMiss(SLAEvent event);
075    
076    }