KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > metadata > SecurityRoleRefMetaData


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.metadata;
23
24 import org.w3c.dom.Element JavaDoc;
25
26 import org.jboss.deployment.DeploymentException;
27
28 /**
29  * The metadata object for the security-role-ref element. The security-role-ref
30  * element contains the declaration of a security role reference in the
31  * enterprise bean�s code. The declaration con-sists of an optional description,
32  * the security role name used in the code, and an optional link to a defined
33  * security role. The value of the role-name element must be the String used as
34  * the parameter to the EJBContext.isCallerInRole(String roleName) method. The
35  * value of the role-link element must be the name of one of the security roles
36  * defined in the security-role elements.
37  *
38  * Used in: entity and session
39  *
40  * @author <a HREF="mailto:sebastien.alborini@m4x.org">Sebastien Alborini</a>
41  * @author Scott.Stark@jboss.org
42  * @version $Revision: 57300 $
43  */

44 public class SecurityRoleRefMetaData extends MetaData
45 {
46    // Constants -----------------------------------------------------
47

48    // Attributes ----------------------------------------------------
49
private String JavaDoc name;
50
51    private String JavaDoc link;
52
53    private String JavaDoc description;
54
55    // Static --------------------------------------------------------
56

57    // Constructors --------------------------------------------------
58
public SecurityRoleRefMetaData()
59    {
60    }
61
62    // Public --------------------------------------------------------
63

64    public String JavaDoc getDescription()
65    {
66       return description;
67    }
68
69    public void setDescription(String JavaDoc description)
70    {
71       this.description = description;
72    }
73
74    public String JavaDoc getLink()
75    {
76       return link;
77    }
78
79    public void setLink(String JavaDoc link)
80    {
81       this.link = link;
82    }
83
84    public String JavaDoc getName()
85    {
86       return name;
87    }
88
89    public void setName(String JavaDoc name)
90    {
91       this.name = name;
92    }
93
94    public void importEjbJarXml(Element JavaDoc element) throws DeploymentException
95    {
96       name = getElementContent(getUniqueChild(element, "role-name"));
97       link = getElementContent(getOptionalChild(element, "role-link"));
98       description = getElementContent(getOptionalChild(element, "description"));
99    }
100
101 }
102
Popular Tags