View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.oodt.cas.pge.config;
18  
19  //JDK imports
20  import java.util.List;
21  
22  //Google imports
23  import com.google.common.base.Strings;
24  import com.google.common.collect.Lists;
25  
26  /** 
27   * Configuration file for CAS-PGE.
28   *
29   * @author bfoster (Brian Foster)
30   */
31  public class PgeConfig {
32  
33      private List<DynamicConfigFile> dynamicConfigFiles;
34      private List<OutputDir> outputDirs;
35      private Object[] propertyAdderCustomArgs;
36      private String exeDir;
37      private String shellType;
38      private List<String> exeCmds;
39      private FileStagingInfo fileStagingInfo;
40  
41      public PgeConfig() {
42          shellType = "sh";
43          outputDirs = Lists.newArrayList();
44          dynamicConfigFiles = Lists.newArrayList();
45          exeCmds = Lists.newArrayList();
46      }
47  
48      public void addDynamicConfigFile(DynamicConfigFile dynamicConfigFile) {
49          dynamicConfigFiles.add(dynamicConfigFile);
50      }
51  
52      public List<DynamicConfigFile> getDynamicConfigFiles() {
53          return dynamicConfigFiles;
54      }
55  
56      public void addOuputDirAndExpressions(OutputDir outputDir) {
57          outputDirs.add(outputDir);
58      }
59  
60      public List<OutputDir> getOuputDirs() {
61          return outputDirs;
62      }
63  
64      public void setExeDir(String exeDir) {
65          this.exeDir = exeDir;
66      }
67  
68      public String getExeDir() {
69          return exeDir;
70      }
71  
72      public void setShellType(String shellType) {
73          if (!Strings.isNullOrEmpty(shellType)) {
74              this.shellType = shellType;
75          }
76      }
77  
78      public String getShellType() {
79          return shellType;
80      }
81  
82      public void setExeCmds(List<String> exeCmds) {
83          this.exeCmds = exeCmds;
84      }
85  
86      public List<String> getExeCmds() {
87          return exeCmds;
88      }
89  
90      public void setPropertyAdderCustomArgs(Object[] args) {
91          propertyAdderCustomArgs = args;
92      }
93  
94      public Object[] getPropertyAdderCustomArgs() {
95          return propertyAdderCustomArgs != null ? propertyAdderCustomArgs
96                  : new Object[0];
97      }
98  
99      public void setFileStagingInfo(FileStagingInfo fileStagingInfo) {
100        this.fileStagingInfo = fileStagingInfo;
101     }
102 
103     public FileStagingInfo getFileStagingInfo() {
104        return fileStagingInfo;
105     }
106 }