1 61 62 package org.objectweb.jonas.webapp.jonasadmin; 63 64 import java.util.ArrayList ; 65 import java.util.Collection ; 66 import java.util.Iterator ; 67 import java.util.List ; 68 import java.util.StringTokenizer ; 69 70 import org.objectweb.jonas.webapp.taglib.LabelValueBean; 71 72 81 82 public class Jlists { 83 84 86 public final static String SEPARATOR = ","; 87 88 90 93 protected Jlists() {} 94 95 97 100 private static List debugLevels = new ArrayList (); 101 102 static { 103 debugLevels.add(new LabelValueBean("0", "0")); 104 debugLevels.add(new LabelValueBean("1", "1")); 105 debugLevels.add(new LabelValueBean("2", "2")); 106 debugLevels.add(new LabelValueBean("3", "3")); 107 debugLevels.add(new LabelValueBean("4", "4")); 108 debugLevels.add(new LabelValueBean("5", "5")); 109 debugLevels.add(new LabelValueBean("6", "6")); 110 debugLevels.add(new LabelValueBean("7", "7")); 111 debugLevels.add(new LabelValueBean("8", "8")); 112 debugLevels.add(new LabelValueBean("9", "9")); 113 } 114 115 118 private static List verbosityLevels = new ArrayList (); 119 120 static { 121 verbosityLevels.add(new LabelValueBean("0", "0")); 122 verbosityLevels.add(new LabelValueBean("1", "1")); 123 verbosityLevels.add(new LabelValueBean("2", "2")); 124 verbosityLevels.add(new LabelValueBean("3", "3")); 125 verbosityLevels.add(new LabelValueBean("4", "4")); 126 } 127 128 131 private static List loggerJonasLevels = new ArrayList (); 132 133 static { 134 loggerJonasLevels.add(new LabelValueBean("DEBUG", "DEBUG")); 135 loggerJonasLevels.add(new LabelValueBean("WARN", "WARN")); 136 loggerJonasLevels.add(new LabelValueBean("INFO", "INFO")); 137 loggerJonasLevels.add(new LabelValueBean("ERROR", "ERROR")); 138 loggerJonasLevels.add(new LabelValueBean("INHERIT", "INHERIT")); 139 } 140 141 144 private static List booleanValues = new ArrayList (); 145 146 static { 147 booleanValues.add(new LabelValueBean("True", "true")); 148 booleanValues.add(new LabelValueBean("False", "false")); 149 } 150 151 154 private static List jdbcConnectionCheckingLevels = new ArrayList (); 155 156 static { 157 jdbcConnectionCheckingLevels.add(new LabelValueBean("0", "0")); 158 jdbcConnectionCheckingLevels.add(new LabelValueBean("1", "1")); 159 jdbcConnectionCheckingLevels.add(new LabelValueBean("2", "2")); 160 } 161 162 165 private static List securityAuthenticationLdapValues = new ArrayList (); 166 167 static { 168 securityAuthenticationLdapValues.add(new LabelValueBean("none", "none")); 169 securityAuthenticationLdapValues.add(new LabelValueBean("simple", "simple")); 170 securityAuthenticationLdapValues.add(new LabelValueBean("strong", "strong")); 171 securityAuthenticationLdapValues.add(new LabelValueBean("CRAM-MD5", "CRAM-MD5")); 172 securityAuthenticationLdapValues.add(new LabelValueBean("DIGEST-MD5", "DIGEST-MD5")); 173 } 174 175 178 private static List authenticationModeLdapValues = new ArrayList (); 179 180 static { 181 authenticationModeLdapValues.add(new LabelValueBean("compare", "compare")); 182 authenticationModeLdapValues.add(new LabelValueBean("bind", "bind")); 183 } 184 185 188 private static List securityAlgorithms = new ArrayList (); 189 190 static { 191 securityAlgorithms.add(new LabelValueBean("", "")); 192 securityAlgorithms.add(new LabelValueBean("MD5", "MD5")); 193 securityAlgorithms.add(new LabelValueBean("MD2", "MD2")); 194 securityAlgorithms.add(new LabelValueBean("SHA-1", "SHA-1")); 195 securityAlgorithms.add(new LabelValueBean("SHA", "SHA")); 196 } 197 198 200 204 public static List getDebugLevels() { 205 return (debugLevels); 206 } 207 208 212 public static List getVerbosityLevels() { 213 return (verbosityLevels); 214 } 215 216 220 public static List getBooleanValues() { 221 return (booleanValues); 222 } 223 224 228 public static List getLoggerJonasLevels() { 229 return (loggerJonasLevels); 230 } 231 232 236 public static List getJdbcConnectionCheckingLevels() { 237 return (jdbcConnectionCheckingLevels); 238 } 239 240 244 public static List getSecurityAuthenticationLdapValues() { 245 return (securityAuthenticationLdapValues); 246 } 247 248 252 public static List getAuthenticationModeLdapValues() { 253 return (authenticationModeLdapValues); 254 } 255 256 260 public static List getSecurityAlgorithms() { 261 return (securityAlgorithms); 262 } 263 264 271 public static String getString(Collection p_Collection, String p_Separator) { 272 StringBuffer sb = new StringBuffer (); 273 Iterator it = p_Collection.iterator(); 274 while (it.hasNext()) { 275 sb.append(it.next()); 276 if (it.hasNext()) { 277 sb.append(p_Separator); 278 } 279 } 280 return sb.toString(); 281 } 282 283 290 public static ArrayList getArrayList(String p_String, String p_Separator) { 291 ArrayList al = new ArrayList (); 292 StringTokenizer st = new StringTokenizer (p_String, p_Separator); 293 while (st.hasMoreTokens()) { 294 al.add(st.nextToken().trim()); 295 } 296 return al; 297 } 298 } 299 | Popular Tags |