KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.Calendar JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25 import com.sslexplorer.boot.PropertyList;
26 import com.sslexplorer.core.CoreEvent;
27 import com.sslexplorer.policyframework.LaunchSession;
28
29 /**
30  *
31  */

32 public class ReplacementProxyWebForward extends AbstractAuthenticatingWebForward {
33
34     private PropertyList restrictToHosts;
35     private String JavaDoc encoding;
36
37     /**
38      * @param id
39      * @param destinationURL
40      * @param shortName
41      * @param description
42      * @param category
43      * @param authenticationUsername
44      * @param authenticationPassword
45      * @param preferredAuthenticationMethod
46      * @param encoding
47      * @param restrictToHosts
48      * @param formType
49      * @param formParameters
50      * @param dateCreated
51      * @param dateAmended
52      */

53     public ReplacementProxyWebForward(int realmID, int id, String JavaDoc destinationURL, String JavaDoc shortName, String JavaDoc description, String JavaDoc category,
54                     String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc preferredAuthenticationMethod,
55                     String JavaDoc encoding, PropertyList restrictToHosts, String JavaDoc formType, String JavaDoc formParameters,
56                     Calendar JavaDoc dateCreated, Calendar JavaDoc dateAmended) {
57         super(realmID, id, WebForward.TYPE_REPLACEMENT_PROXY, destinationURL, shortName, description, category, authenticationUsername,
58                         authenticationPassword, preferredAuthenticationMethod, formType, formParameters,
59                         dateCreated, dateAmended);
60         this.restrictToHosts = restrictToHosts;
61         this.encoding = encoding;
62     }
63
64     public PropertyList getRestrictToHosts() {
65         return restrictToHosts;
66     }
67
68     public void setRestrictToHosts(PropertyList restrictToHosts) {
69         this.restrictToHosts = restrictToHosts;
70     }
71
72     public String JavaDoc getEncoding() {
73        return encoding;
74     }
75
76     public void setEncoding(String JavaDoc encoding) {
77         this.encoding = encoding;
78     }
79     
80     public void addRestrictToHostsToEvent(CoreEvent evt, String JavaDoc key){
81         int counter = 1;
82         Iterator JavaDoc itr = this.restrictToHosts.iterator();
83         while (itr.hasNext()) {
84             String JavaDoc element = (String JavaDoc) itr.next();
85             evt.addAttribute(key+" "+counter, element);
86             counter++;
87         }
88     }
89
90     public String JavaDoc getLaunchUri(LaunchSession launchSession) {
91         return "launchReplacementProxy.do?" + LaunchSession.LAUNCH_ID + "=" + launchSession.getId();
92     }
93
94 }
95
Popular Tags