KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > webforwards > WebForwardTypes


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.webforwards;
21
22 import java.nio.charset.Charset JavaDoc;
23 import java.util.ArrayList JavaDoc;
24 import java.util.Iterator JavaDoc;
25 import java.util.List JavaDoc;
26
27 import org.apache.struts.util.LabelValueBean;
28
29 import com.maverick.http.HttpAuthenticatorFactory;
30
31 public class WebForwardTypes {
32
33     public static final String JavaDoc DEFAULT_ENCODING = "Default";
34
35     public static final String JavaDoc FORM_SUBMIT_NONE = "NONE";
36     public static final String JavaDoc FORM_SUBMIT_GET = "GET";
37     public static final String JavaDoc FORM_SUBMIT_POST = "POST";
38     public static final String JavaDoc FORM_SUBMIT_JAVASCRIPT = "JavaScript";
39     
40     public final static List JavaDoc WEB_FORWARD_TYPES = new ArrayList JavaDoc();
41     public final static List JavaDoc PREFERED_SCHEMES = new ArrayList JavaDoc();
42     public final static List JavaDoc FORM_SUBMIT_TYPES = new ArrayList JavaDoc();
43     public final static List JavaDoc ENCODING_TYPES = new ArrayList JavaDoc();
44     
45     static {
46         WEB_FORWARD_TYPES.add(new WebForwardTypeItem(WebForward.TYPE_TUNNELED_SITE, WebForward.ATTR_TUNNELED_SITE));
47         WEB_FORWARD_TYPES.add(new WebForwardTypeItem(WebForward.TYPE_REPLACEMENT_PROXY, WebForward.ATTR_REPLACEMENT_PROXY));
48         WEB_FORWARD_TYPES.add(new WebForwardTypeItem(WebForward.TYPE_PATH_BASED_REVERSE_PROXY, WebForward.ATTR_PATH_BASED_REVERSE_PROXY));
49         WEB_FORWARD_TYPES.add(new WebForwardTypeItem(WebForward.TYPE_HOST_BASED_REVERSE_PROXY, WebForward.ATTR_HOST_BASED_REVERSE_PROXY));
50         
51         PREFERED_SCHEMES.add(new LabelValueBean(HttpAuthenticatorFactory.BASIC, HttpAuthenticatorFactory.BASIC));
52         PREFERED_SCHEMES.add(new LabelValueBean(HttpAuthenticatorFactory.DIGEST, HttpAuthenticatorFactory.DIGEST));
53         PREFERED_SCHEMES.add(new LabelValueBean(HttpAuthenticatorFactory.NTLM, HttpAuthenticatorFactory.NTLM));
54         PREFERED_SCHEMES.add(new LabelValueBean(HttpAuthenticatorFactory.NONE, HttpAuthenticatorFactory.NONE));
55
56         FORM_SUBMIT_TYPES.add(new LabelValueBean(FORM_SUBMIT_NONE, FORM_SUBMIT_NONE));
57         FORM_SUBMIT_TYPES.add(new LabelValueBean(FORM_SUBMIT_POST, FORM_SUBMIT_POST));
58         FORM_SUBMIT_TYPES.add(new LabelValueBean(FORM_SUBMIT_GET, FORM_SUBMIT_GET));
59         FORM_SUBMIT_TYPES.add(new LabelValueBean(FORM_SUBMIT_JAVASCRIPT, FORM_SUBMIT_JAVASCRIPT));
60         
61         ENCODING_TYPES.add(new LabelValueBean(DEFAULT_ENCODING, DEFAULT_ENCODING));
62         for(Iterator JavaDoc i = Charset.availableCharsets().values().iterator(); i.hasNext(); ) {
63             Charset JavaDoc cs = (Charset JavaDoc)i.next();
64             ENCODING_TYPES.add(new LabelValueBean(cs.toString(), cs.toString()));
65         }
66     }
67 }
68
Popular Tags