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