Jlists.java

00001 /*
00002  * $Header: /cvsroot/jonas/jonas/src/org/objectweb/jonas/webapp/jonasadmin/Jlists.java,v 1.9 2003/11/12 17:19:34 antonma Exp $
00003  * $Revision: 1.9 $
00004  * $Date: 2003/11/12 17:19:34 $
00005  *
00006  * ====================================================================
00007  *
00008  * The Apache Software License, Version 1.1
00009  *
00010  * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
00011  * reserved.
00012  *
00013  * Redistribution and use in source and binary forms, with or without
00014  * modification, are permitted provided that the following conditions
00015  * are met:
00016  *
00017  * 1. Redistributions of source code must retain the above copyright
00018  *    notice, this list of conditions and the following disclaimer.
00019  *
00020  * 2. Redistributions in binary form must reproduce the above copyright
00021  *    notice, this list of conditions and the following disclaimer in
00022  *    the documentation and/or other materials provided with the
00023  *    distribution.
00024  *
00025  * 3. The end-user documentation included with the redistribution, if
00026  *    any, must include the following acknowlegement:
00027  *       "This product includes software developed by the
00028  *        Apache Software Foundation (http://www.apache.org/)."
00029  *    Alternately, this acknowlegement may appear in the software itself,
00030  *    if and wherever such third-party acknowlegements normally appear.
00031  *
00032  * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
00033  *    Foundation" must not be used to endorse or promote products derived
00034  *    from this software without prior written permission. For written
00035  *    permission, please contact apache@apache.org.
00036  *
00037  * 5. Products derived from this software may not be called "Apache"
00038  *    nor may "Apache" appear in their names without prior written
00039  *    permission of the Apache Group.
00040  *
00041  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00042  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00043  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00044  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00045  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00046  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00047  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00048  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00049  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00050  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00051  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00052  * SUCH DAMAGE.
00053  * ====================================================================
00054  *
00055  * This software consists of voluntary contributions made by many
00056  * individuals on behalf of the Apache Software Foundation.  For more
00057  * information on the Apache Software Foundation, please see
00058  * <http://www.apache.org/>.
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 // --------------------------------------------------------- Constants
00085 
00086     public final static String SEPARATOR = ",";
00087 
00088 // ----------------------------------------------------------- Constructors
00089 
00093     protected Jlists() {}
00094 
00095 // ------------------------------------------------------- Static Variables
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 // --------------------------------------------------------- Public Methods
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 }

Generated on Tue Feb 15 15:05:26 2005 for JOnAS by  doxygen 1.3.9.1