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
019package org.apache.oozie.sla.listener;
020
021import org.apache.hadoop.conf.Configuration;
022import org.apache.oozie.client.event.SLAEvent;
023
024/**
025 * Event listener for SLA related events, defining methods corresponding to
026 * SLA mets/misses
027 */
028public abstract class SLAEventListener {
029
030    /**
031     * Initialize the listener
032     * @param conf
033     */
034    public abstract void init(Configuration conf) throws Exception;
035
036    /**
037     * Destroy the listener
038     */
039    public abstract void destroy();
040
041    /**
042     * on SLA job start-time limit met
043     * @param work
044     */
045    public abstract void onStartMet(SLAEvent work);
046
047    /**
048     * on SLA job start-time limit missed
049     * @param event
050     */
051    public abstract void onStartMiss(SLAEvent event);
052
053    /**
054     * on SLA job end-time limit met
055     * @param work
056     */
057    public abstract void onEndMet(SLAEvent work);
058
059    /**
060     * on SLA job end-time limit missed
061     * @param event
062     */
063    public abstract void onEndMiss(SLAEvent event);
064
065    /**
066     * on SLA job duration limit met
067     * @param work
068     */
069    public abstract void onDurationMet(SLAEvent work);
070
071    /**
072     * on SLA job duration limit missed
073     * @param event
074     */
075    public abstract void onDurationMiss(SLAEvent event);
076
077}