1 23 24 28 29 package com.sun.enterprise.config.serverbeans; 30 31 import org.w3c.dom.*; 32 import org.netbeans.modules.schema2beans.*; 33 import java.beans.*; 34 import java.util.*; 35 import java.io.Serializable ; 36 import com.sun.enterprise.config.ConfigBean; 37 import com.sun.enterprise.config.ConfigException; 38 import com.sun.enterprise.config.StaleWriteConfigException; 39 import com.sun.enterprise.util.i18n.StringManager; 40 41 43 public class HttpAccessLog extends ConfigBean implements Serializable 44 { 45 46 static Vector comparators = new Vector(); 47 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 48 49 50 public HttpAccessLog() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public HttpAccessLog(int options) 55 { 56 super(comparators, runtimeVersion); 57 initPropertyTables(0); 59 this.initialize(options); 60 } 61 62 void initialize(int options) { 64 65 } 66 67 71 public String getLogDirectory() { 72 return getAttributeValue(ServerTags.LOG_DIRECTORY); 73 } 74 79 public void setLogDirectory(String v, boolean overwrite) throws StaleWriteConfigException { 80 setAttributeValue(ServerTags.LOG_DIRECTORY, v, overwrite); 81 } 82 86 public void setLogDirectory(String v) { 87 setAttributeValue(ServerTags.LOG_DIRECTORY, v); 88 } 89 92 public static String getDefaultLogDirectory() { 93 return "${com.sun.aas.instanceRoot}/logs/access".trim(); 94 } 95 99 public boolean isIponly() { 100 return toBoolean(getAttributeValue(ServerTags.IPONLY)); 101 } 102 107 public void setIponly(boolean v, boolean overwrite) throws StaleWriteConfigException { 108 setAttributeValue(ServerTags.IPONLY, ""+(v==true), overwrite); 109 } 110 114 public void setIponly(boolean v) { 115 setAttributeValue(ServerTags.IPONLY, ""+(v==true)); 116 } 117 120 public static String getDefaultIponly() { 121 return "true".trim(); 122 } 123 128 protected String getRelativeXPath() { 129 String ret = null; 130 ret = "http-access-log"; 131 return (null != ret ? ret.trim() : null); 132 } 133 134 137 public static String getDefaultAttributeValue(String attr) { 138 if(attr == null) return null; 139 attr = attr.trim(); 140 if(attr.equals(ServerTags.LOG_DIRECTORY)) return "${com.sun.aas.instanceRoot}/logs/access".trim(); 141 if(attr.equals(ServerTags.IPONLY)) return "true".trim(); 142 return null; 143 } 144 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 146 comparators.add(c); 147 } 148 149 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 151 comparators.remove(c); 152 } 153 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 154 } 155 156 public void dump(StringBuffer str, String indent){ 158 String s; 159 Object o; 160 org.netbeans.modules.schema2beans.BaseBean n; 161 } 162 public String dumpBeanNode(){ 163 StringBuffer str = new StringBuffer (); 164 str.append("HttpAccessLog\n"); this.dump(str, "\n "); return str.toString(); 167 }} 168 169 171 | Popular Tags |