01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer: Florent BENOIT
22: * --------------------------------------------------------------------------
23: * $Id: ServletDesc.java 4854 2004-06-01 11:24:01Z benoitf $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas_web.deployment.api;
26:
27: import java.util.ArrayList;
28: import java.util.Iterator;
29: import java.util.List;
30:
31: import org.objectweb.jonas_lib.deployment.api.SecurityRoleRefDesc;
32: import org.objectweb.jonas_lib.deployment.xml.SecurityRoleRef;
33:
34: import org.objectweb.jonas_web.deployment.xml.Servlet;
35:
36: /**
37: * Defines a Servlet object.
38: * It manages classname and security-role-ref
39: * @author Florent Benoit
40: */
41:
42: public class ServletDesc {
43:
44: /**
45: * Internal servlet object
46: */
47: private Servlet servlet = null;
48:
49: /**
50: * List of securityRoleRef
51: */
52: private List securityRoleRefDescList = null;
53:
54: /**
55: * Constructor : Build a new Servlet object
56: * @param servlet Servlet object
57: */
58: public ServletDesc(Servlet servlet) {
59: this .servlet = servlet;
60: securityRoleRefDescList = new ArrayList();
61: for (Iterator it = servlet.getSecurityRoleRefList().iterator(); it
62: .hasNext();) {
63: SecurityRoleRef securityRoleRef = (SecurityRoleRef) it
64: .next();
65: SecurityRoleRefDesc securityRoleRefDesc = new SecurityRoleRefDesc(
66: getServletName(), securityRoleRef, false);
67: securityRoleRefDescList.add(securityRoleRefDesc);
68: }
69:
70: }
71:
72: /**
73: * @return the name of the servlet
74: */
75: public String getServletName() {
76: return servlet.getServletName();
77: }
78:
79: /**
80: * @return the class of the servlet
81: */
82: public String getServletClass() {
83: return servlet.getServletClass();
84: }
85:
86: /**
87: * Gets the security-role-ref
88: * @return the security-role-ref
89: */
90: public List getSecurityRoleRefList() {
91: return securityRoleRefDescList;
92: }
93:
94: }
|