001    /**
002     * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
003     * Licensed under the Apache License, Version 2.0 (the "License");
004     * you may not use this file except in compliance with the License.
005     * You may obtain a copy of the License at
006     *
007     *   http://www.apache.org/licenses/LICENSE-2.0
008     *
009     *  Unless required by applicable law or agreed to in writing, software
010     *  distributed under the License is distributed on an "AS IS" BASIS,
011     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012     *  See the License for the specific language governing permissions and
013     *  limitations under the License. See accompanying LICENSE file.
014     */
015    package org.apache.oozie.service;
016    
017    import org.apache.oozie.util.XLogStreamer;
018    import org.apache.oozie.service.Service;
019    import org.apache.oozie.service.Services;
020    import org.apache.oozie.util.XLog;
021    
022    /**
023     * Set Dag specific log info parameters.
024     */
025    public class DagXLogInfoService implements Service {
026    
027        /**
028         * Token log info constant.
029         */
030        public static final String TOKEN = "TOKEN";
031    
032        /**
033         * App log info constant.
034         */
035        public static final String APP = "APP";
036    
037        /**
038         * Job log info constant.
039         */
040        public static final String JOB = "JOB";
041    
042        /**
043         * Action log info constant.
044         */
045        public static final String ACTION = "ACTION";
046    
047        /**
048         * Initialize the service.
049         *
050         * @param services services.
051         */
052        public void init(Services services) {
053            XLog.Info.defineParameter(TOKEN);
054            XLog.Info.defineParameter(APP);
055            XLog.Info.defineParameter(JOB);
056            XLog.Info.defineParameter(ACTION);
057    
058            XLogStreamer.Filter.defineParameter(TOKEN);
059            XLogStreamer.Filter.defineParameter(APP);
060            XLogStreamer.Filter.defineParameter(JOB);
061            XLogStreamer.Filter.defineParameter(ACTION);
062    
063        }
064    
065        /**
066         * Destroy the service.
067         */
068        public void destroy() {
069        }
070    
071        /**
072         * Return the public interface of the service.
073         *
074         * @return {@link DagXLogInfoService}.
075         */
076        public Class<? extends Service> getInterface() {
077            return DagXLogInfoService.class;
078        }
079    
080    }