KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > setup > ClientRestrictionItem


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.setup;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.List JavaDoc;
24
25 import org.apache.struts.util.LabelValueBean;
26
27 import com.sslexplorer.security.ClientRestriction;
28
29 public class ClientRestrictionItem {
30   
31   final static List JavaDoc ALLOW_DENY_LIST = new ArrayList JavaDoc();
32   static {
33     ALLOW_DENY_LIST.add(new LabelValueBean("Allow all", "true"));
34     ALLOW_DENY_LIST.add(new LabelValueBean("Deny all", "false"));
35   }
36
37   private ClientRestriction clientRestriction;
38   private int index;
39   
40   public ClientRestrictionItem(int index, ClientRestriction clientRestriction) {
41     this.clientRestriction = clientRestriction;
42     this.index = index;
43   }
44   
45   public String JavaDoc getIndexString() {
46     return String.valueOf(index);
47   }
48   
49   public int getIndex() {
50     return index;
51   }
52   
53   public void setIndex(int index) {
54     this.index = index;
55   }
56   
57   public ClientRestriction getClientRestriction() {
58     return clientRestriction;
59   }
60   
61   public void setAllowDeny(String JavaDoc allowDeny) {
62     clientRestriction.setAllow(Boolean.valueOf(allowDeny).booleanValue());
63   }
64   
65   public List JavaDoc getAllowDenyList() {
66     return ALLOW_DENY_LIST;
67   }
68   
69   public String JavaDoc getAllowDeny() {
70     return String.valueOf(clientRestriction.getAllow());
71   }
72
73 }
74
Popular Tags