1 23 package com.sun.enterprise.diagnostics; 24 25 import java.util.Map ; 26 import java.util.Date ; 27 28 29 34 public class CLIOptions { 35 36 private static final String OUTPUT_FILE ="outputfile"; 37 private static final String FILE ="file"; 38 private static final String CUSTOMER_INPUT ="input"; 39 private static final String BUG_IDS = "bugids"; 40 private static final String LOG_START_DATE = "logstartdate"; 41 private static final String LOG_END_DATE = "logenddate"; 42 private static final String TARGET_DIR = "targetdir"; 43 private static final String TARGET ="target"; 45 private static final String USER = "user"; 46 private static final String PASSWD = "passwd"; 47 private static final String LOCAL_FLAG = "local"; 48 private Date startDate ; 49 private Date endDate; 50 private String customerInput; 51 private String customerInputFile; 52 private String bugIds; 53 private String destReportFile; 54 private String reportDir; 56 private String targetDir; 57 private String targetName; 58 private String targetType; 59 private String user; 60 private String passwd; 61 private boolean local; 62 63 private Map map; 64 public CLIOptions(Map options) { 65 66 this((Date )options.get(LOG_START_DATE), 67 (Date )options.get(LOG_END_DATE), 68 (String )options.get(FILE), 69 (String )options.get(CUSTOMER_INPUT), 70 (String )options.get(BUG_IDS), 71 (String )options.get(OUTPUT_FILE), 72 (String )options.get(TARGET_DIR), 73 (String )options.get(TARGET), 74 (String )options.get(USER), 75 (String )options.get(PASSWD), 76 Boolean.valueOf((String )options.get(LOCAL_FLAG)).booleanValue()); 77 this.map = options; 78 79 80 } 81 82 public CLIOptions(Date startDate, Date endDate, String file, 83 String customerInput, String bugIds, String destReportFile, 84 String targetDir,String targetName, String user, String passwd, 85 boolean local) { 86 this.startDate = startDate; 87 this.endDate = endDate; 88 this.targetName = targetName; 89 this.targetDir = targetDir; 90 this.destReportFile = destReportFile; 91 this.local = local; 92 this.customerInputFile = file; 93 this.customerInput = customerInput; 94 this.bugIds = bugIds; 95 this.user = user; 96 this.passwd = passwd; 97 } 98 99 102 public Date getStartDate() { 103 return startDate; 104 } 105 106 109 public Date getEndDate() { 110 return endDate; 111 } 112 113 116 public boolean isLocal() { 117 return local; 118 } 119 120 124 public String getTargetDir() { 125 return targetDir; 126 } 127 128 131 public String getTargetName() { 132 return targetName; 133 } 134 135 136 139 public String getReportFile() { 140 return destReportFile; 141 } 142 143 147 public String getCustomerInputFile() { 148 return customerInputFile; 149 } 150 151 155 public String getCustomerInput() { 156 return customerInput; 157 } 158 159 160 164 public String getBugIds() { 165 return bugIds; 166 } 167 168 171 public String getUser() { 172 return user; 173 } 174 175 178 public String getPasswd() { 179 return passwd; 180 } 181 182 public String toString() { 183 return getTargetDir() + "," + getTargetName() + "," + 184 getCustomerInputFile() + "," + getBugIds() + 185 "," + getStartDate() + 186 "," + getEndDate() + "," + getReportFile(); 187 188 } 189 190 public Map getMap() { 191 return map; 192 } 193 } 194 | Popular Tags |