00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 package org.objectweb.jonas.webapp.jonasadmin.logging;
00027
00028 import java.util.List;
00029
00030 import javax.servlet.http.HttpServletRequest;
00031
00032 import org.apache.struts.action.ActionError;
00033 import org.apache.struts.action.ActionErrors;
00034 import org.apache.struts.action.ActionMapping;
00035 import org.objectweb.jonas.webapp.jonasadmin.Jlists;
00036
00041 public final class CatalinaAccessLogValveForm extends CatalinaValveForm {
00042
00043
00044
00045 private String directory = null;
00046 private String pattern = null;
00047 private String prefix = null;
00048 private String suffix = null;
00049 private boolean rotatable = true;
00050 private boolean resolveHosts = false;
00051
00052 private List booleanValues = Jlists.getBooleanValues();
00053
00054
00055
00056 public void reset(ActionMapping mapping, HttpServletRequest request) {
00057
00058 super.reset(mapping, request);
00059 directory = "logs";
00060 prefix = "access_log.";
00061 suffix = ".txt";
00062 pattern = "%h %l %u %t \"%r\" %s %b";
00063 resolveHosts = false;
00064 rotatable = true;
00065 }
00066
00067 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00068 ActionErrors oErrors = new ActionErrors();
00069
00070 if ((prefix == null) || (prefix.length() < 1)) {
00071 oErrors.add("pattern", new ActionError("error.logger.catalina.access.prefix.required"));
00072 }
00073
00074 if ((suffix == null) || (suffix.length() < 1)) {
00075 suffix = "";
00076 }
00077
00078 if ((pattern == null) || (pattern.length() < 1)) {
00079 oErrors.add("pattern", new ActionError("error.logger.catalina.access.pattern.required"));
00080 }
00081 return oErrors;
00082 }
00083
00084
00085
00086 public List getBooleanValues() {
00087 return booleanValues;
00088 }
00089
00090 public void setBooleanValues(List booleanValues) {
00091 this.booleanValues = booleanValues;
00092 }
00093
00094 public String getDirectory() {
00095 return this.directory;
00096 }
00097
00098 public void setDirectory(String directory) {
00099 this.directory = directory;
00100 }
00101
00102 public String getPattern() {
00103 return this.pattern;
00104 }
00105
00106 public void setPattern(String pattern) {
00107 this.pattern = pattern;
00108 }
00109
00110 public String getPrefix() {
00111 return this.prefix;
00112 }
00113
00114 public void setPrefix(String prefix) {
00115 this.prefix = prefix;
00116 }
00117
00118 public String getSuffix() {
00119 return this.suffix;
00120 }
00121
00122 public void setSuffix(String suffix) {
00123 this.suffix = suffix;
00124 }
00125
00126 public boolean isResolveHosts() {
00127 return this.resolveHosts;
00128 }
00129
00130 public void setResolveHosts(boolean resolveHosts) {
00131 this.resolveHosts = resolveHosts;
00132 }
00133
00134 public boolean isRotatable() {
00135 return this.rotatable;
00136 }
00137
00138 public void setRotatable(boolean rotatable) {
00139 this.rotatable = rotatable;
00140 }
00141 }