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.service;
020
021import org.apache.oozie.util.XLogFilter;
022import org.apache.oozie.service.Service;
023import org.apache.oozie.service.Services;
024import org.apache.oozie.util.XLog;
025
026/**
027 * Set Dag specific log info parameters.
028 */
029public class DagXLogInfoService implements Service {
030
031    /**
032     * Token log info constant.
033     */
034    public static final String TOKEN = "TOKEN";
035
036    /**
037     * App log info constant.
038     */
039    public static final String APP = "APP";
040
041    /**
042     * Job log info constant.
043     */
044    public static final String JOB = "JOB";
045
046    public static final String AUDIT_JOBID = "JOBID";
047
048    /**
049     * Action log info constant.
050     */
051    public static final String ACTION = "ACTION";
052
053    /**
054     * Initialize the service.
055     *
056     * @param services services.
057     */
058    public void init(Services services) {
059        XLog.Info.defineParameter(TOKEN);
060        XLog.Info.defineParameter(APP);
061        XLog.Info.defineParameter(JOB);
062        XLog.Info.defineParameter(ACTION);
063
064        XLogFilter.defineParameter(TOKEN);
065        XLogFilter.defineParameter(APP);
066        XLogFilter.defineParameter(JOB);
067        XLogFilter.defineParameter(ACTION);
068
069    }
070
071    /**
072     * Destroy the service.
073     */
074    public void destroy() {
075    }
076
077    /**
078     * Return the public interface of the service.
079     *
080     * @return {@link DagXLogInfoService}.
081     */
082    public Class<? extends Service> getInterface() {
083        return DagXLogInfoService.class;
084    }
085
086}