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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 package org.objectweb.jonas.webapp.jonasadmin;
00063
00064 import java.util.ArrayList;
00065 import java.util.Collection;
00066 import java.util.Iterator;
00067 import java.util.List;
00068 import java.util.StringTokenizer;
00069
00070 import org.objectweb.jonas.webapp.taglib.LabelValueBean;
00071
00082 public class Jlists {
00083
00084
00085
00086 public final static String SEPARATOR = ",";
00087
00088
00089
00093 protected Jlists() {}
00094
00095
00096
00100 private static List debugLevels = new ArrayList();
00101
00102 static {
00103 debugLevels.add(new LabelValueBean("0", "0"));
00104 debugLevels.add(new LabelValueBean("1", "1"));
00105 debugLevels.add(new LabelValueBean("2", "2"));
00106 debugLevels.add(new LabelValueBean("3", "3"));
00107 debugLevels.add(new LabelValueBean("4", "4"));
00108 debugLevels.add(new LabelValueBean("5", "5"));
00109 debugLevels.add(new LabelValueBean("6", "6"));
00110 debugLevels.add(new LabelValueBean("7", "7"));
00111 debugLevels.add(new LabelValueBean("8", "8"));
00112 debugLevels.add(new LabelValueBean("9", "9"));
00113 }
00114
00118 private static List verbosityLevels = new ArrayList();
00119
00120 static {
00121 verbosityLevels.add(new LabelValueBean("0", "0"));
00122 verbosityLevels.add(new LabelValueBean("1", "1"));
00123 verbosityLevels.add(new LabelValueBean("2", "2"));
00124 verbosityLevels.add(new LabelValueBean("3", "3"));
00125 verbosityLevels.add(new LabelValueBean("4", "4"));
00126 }
00127
00131 private static List loggerJonasLevels = new ArrayList();
00132
00133 static {
00134 loggerJonasLevels.add(new LabelValueBean("DEBUG", "DEBUG"));
00135 loggerJonasLevels.add(new LabelValueBean("WARN", "WARN"));
00136 loggerJonasLevels.add(new LabelValueBean("INFO", "INFO"));
00137 loggerJonasLevels.add(new LabelValueBean("ERROR", "ERROR"));
00138 loggerJonasLevels.add(new LabelValueBean("INHERIT", "INHERIT"));
00139 }
00140
00144 private static List booleanValues = new ArrayList();
00145
00146 static {
00147 booleanValues.add(new LabelValueBean("True", "true"));
00148 booleanValues.add(new LabelValueBean("False", "false"));
00149 }
00150
00154 private static List jdbcConnectionCheckingLevels = new ArrayList();
00155
00156 static {
00157 jdbcConnectionCheckingLevels.add(new LabelValueBean("0", "0"));
00158 jdbcConnectionCheckingLevels.add(new LabelValueBean("1", "1"));
00159 jdbcConnectionCheckingLevels.add(new LabelValueBean("2", "2"));
00160 }
00161
00165 private static List securityAuthenticationLdapValues = new ArrayList();
00166
00167 static {
00168 securityAuthenticationLdapValues.add(new LabelValueBean("none", "none"));
00169 securityAuthenticationLdapValues.add(new LabelValueBean("simple", "simple"));
00170 securityAuthenticationLdapValues.add(new LabelValueBean("strong", "strong"));
00171 securityAuthenticationLdapValues.add(new LabelValueBean("CRAM-MD5", "CRAM-MD5"));
00172 securityAuthenticationLdapValues.add(new LabelValueBean("DIGEST-MD5", "DIGEST-MD5"));
00173 }
00174
00178 private static List authenticationModeLdapValues = new ArrayList();
00179
00180 static {
00181 authenticationModeLdapValues.add(new LabelValueBean("compare", "compare"));
00182 authenticationModeLdapValues.add(new LabelValueBean("bind", "bind"));
00183 }
00184
00188 private static List securityAlgorithms = new ArrayList();
00189
00190 static {
00191 securityAlgorithms.add(new LabelValueBean("", ""));
00192 securityAlgorithms.add(new LabelValueBean("MD5", "MD5"));
00193 securityAlgorithms.add(new LabelValueBean("MD2", "MD2"));
00194 securityAlgorithms.add(new LabelValueBean("SHA-1", "SHA-1"));
00195 securityAlgorithms.add(new LabelValueBean("SHA", "SHA"));
00196 }
00197
00198
00199
00204 public static List getDebugLevels() {
00205 return (debugLevels);
00206 }
00207
00212 public static List getVerbosityLevels() {
00213 return (verbosityLevels);
00214 }
00215
00220 public static List getBooleanValues() {
00221 return (booleanValues);
00222 }
00223
00228 public static List getLoggerJonasLevels() {
00229 return (loggerJonasLevels);
00230 }
00231
00236 public static List getJdbcConnectionCheckingLevels() {
00237 return (jdbcConnectionCheckingLevels);
00238 }
00239
00244 public static List getSecurityAuthenticationLdapValues() {
00245 return (securityAuthenticationLdapValues);
00246 }
00247
00252 public static List getAuthenticationModeLdapValues() {
00253 return (authenticationModeLdapValues);
00254 }
00255
00260 public static List getSecurityAlgorithms() {
00261 return (securityAlgorithms);
00262 }
00263
00271 public static String getString(Collection p_Collection, String p_Separator) {
00272 StringBuffer sb = new StringBuffer();
00273 Iterator it = p_Collection.iterator();
00274 while (it.hasNext()) {
00275 sb.append(it.next());
00276 if (it.hasNext()) {
00277 sb.append(p_Separator);
00278 }
00279 }
00280 return sb.toString();
00281 }
00282
00290 public static ArrayList getArrayList(String p_String, String p_Separator) {
00291 ArrayList al = new ArrayList();
00292 StringTokenizer st = new StringTokenizer(p_String, p_Separator);
00293 while (st.hasMoreTokens()) {
00294 al.add(st.nextToken().trim());
00295 }
00296 return al;
00297 }
00298 }