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.command.wf; 016 017 import org.apache.oozie.command.Command; 018 import org.apache.oozie.store.WorkflowStore; 019 import org.apache.oozie.store.Store; 020 021 public abstract class WorkflowCommand<T> extends Command<T, WorkflowStore> { 022 023 /** 024 * Create a command that uses a {@link WorkflowStore} instance. <p/> The current {@link XLog.Info} values are 025 * captured for execution. 026 * 027 * @param name command name. 028 * @param type command type. 029 * @param priority priority of the command, used when queuing for asynchronous execution. 030 * @param logMask log mask for the command logging calls. 031 */ 032 public WorkflowCommand(String name, String type, int priority, int logMask) { 033 super(name, type, priority, logMask, true); 034 } 035 036 /** 037 * Create a command. <p/> The current {@link XLog.Info} values are captured for execution. 038 * 039 * @param name command name. 040 * @param type command type. 041 * @param priority priority of the command, used when queuing for asynchronous execution. 042 * @param logMask log mask for the command logging calls. 043 * @param withStore indicates if the command needs a {@link org.apache.oozie.store.WorkflowStore} instance or not. 044 */ 045 public WorkflowCommand(String name, String type, int priority, int logMask, boolean withStore) { 046 super(name, type, priority, logMask, withStore); 047 } 048 049 /** 050 * Return the public interface of the Workflow Store. 051 * 052 * @return {@link WorkflowStore} 053 */ 054 public Class<? extends Store> getStoreClass() { 055 return WorkflowStore.class; 056 } 057 }