[jboss-cvs] JBossAS SVN: r72457 - in projects/security/security-spi/trunk: parent and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Apr 18 20:16:44 EDT 2008
Author: anil.saldhana at jboss.com
Date: 2008-04-18 20:16:44 -0400 (Fri, 18 Apr 2008)
New Revision: 72457
Added:
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractEJBAuthorizationHelper.java
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractJavaEEHelper.java
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractWebAuthorizationHelper.java
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/EJBAuthenticationHelper.java
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityActions.java
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityHelperFactory.java
projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityRoleRef.java
Modified:
projects/security/security-spi/trunk/.classpath
projects/security/security-spi/trunk/parent/pom.xml
projects/security/security-spi/trunk/spi/pom.xml
Log:
SECURITY-198: helpers for javaee sec
Modified: projects/security/security-spi/trunk/.classpath
===================================================================
--- projects/security/security-spi/trunk/.classpath 2008-04-18 22:11:34 UTC (rev 72456)
+++ projects/security/security-spi/trunk/.classpath 2008-04-19 00:16:44 UTC (rev 72457)
@@ -9,6 +9,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-jaspi-api/1.0-BETA1/jboss-jaspi-api-1.0-BETA1.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/security/authorization-spi/2.0.2-SNAPSHOT/authorization-spi-2.0.2-SNAPSHOT.jar"/>
<classpathentry kind="output" path="target/eclipse-classes"/>
</classpath>
Modified: projects/security/security-spi/trunk/parent/pom.xml
===================================================================
--- projects/security/security-spi/trunk/parent/pom.xml 2008-04-18 22:11:34 UTC (rev 72456)
+++ projects/security/security-spi/trunk/parent/pom.xml 2008-04-19 00:16:44 UTC (rev 72457)
@@ -121,6 +121,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
Modified: projects/security/security-spi/trunk/spi/pom.xml
===================================================================
--- projects/security/security-spi/trunk/spi/pom.xml 2008-04-18 22:11:34 UTC (rev 72456)
+++ projects/security/security-spi/trunk/spi/pom.xml 2008-04-19 00:16:44 UTC (rev 72457)
@@ -55,6 +55,10 @@
<artifactId>authorization-spi</artifactId>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractEJBAuthorizationHelper.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractEJBAuthorizationHelper.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractEJBAuthorizationHelper.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+import java.lang.reflect.Method;
+import java.security.CodeSource;
+import java.security.Principal;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+
+import org.jboss.security.RunAs;
+import org.jboss.security.identity.RoleGroup;
+
+/**
+ * EJB Authorization Helper
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 17, 2008
+ * @version $Revision$
+ */
+public abstract class AbstractEJBAuthorizationHelper
+extends AbstractJavaEEHelper
+{
+ public abstract boolean authorize(String ejbName,
+ Method ejbMethod,
+ Principal ejbPrincipal,
+ String invocationInterfaceString,
+ CodeSource ejbCS,
+ Subject callerSubject,
+ RunAs callerRunAs,
+ String contextID,
+ RoleGroup methodRoles);
+
+ public abstract boolean isCallerInRole(String roleName,
+ String ejbName,
+ Principal ejbPrincipal,
+ Subject callerSubject,
+ String contextID,
+ Set<SecurityRoleRef> securityRoleRefs);
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractJavaEEHelper.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractJavaEEHelper.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractJavaEEHelper.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+import java.security.AccessController;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.security.SecurityContext;
+import org.jboss.security.audit.AuditEvent;
+import org.jboss.security.audit.AuditManager;
+import org.jboss.security.authorization.PolicyRegistration;
+import org.jboss.security.authorization.Resource;
+
+/**
+ * Abstract Java EE Security Helper
+ * that does both programmatic as well as
+ * regular security
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 17, 2008
+ * @version $Revision$
+ */
+public abstract class AbstractJavaEEHelper
+{
+ protected SecurityContext securityContext;
+ protected PolicyRegistration policyRegistration;
+
+ public SecurityContext getSecurityContext()
+ {
+ return this.securityContext;
+ }
+
+ public void setSecurityContext(SecurityContext sc)
+ {
+ if(sc == null)
+ throw new IllegalArgumentException("sc is null");
+ this.securityContext = sc;
+ }
+
+ public PolicyRegistration getPolicyRegistration()
+ {
+ return policyRegistration;
+ }
+
+ public void setPolicyRegistration(PolicyRegistration policyRegistration)
+ {
+ this.policyRegistration = policyRegistration;
+ }
+
+ public Principal getCallerPrincipal()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Principal>()
+ {
+ public Principal run()
+ {
+ Principal caller = null;
+
+ if(securityContext != null)
+ {
+ caller = securityContext.getIncomingRunAs();
+ //If there is no caller run as, use the call principal
+ if(caller == null)
+ caller = securityContext.getUtil().getUserPrincipal();
+ }
+ return caller;
+ }
+ });
+ }
+
+ protected void authorizationAudit(String level, Resource resource, Exception e)
+ {
+ if(securityContext.getAuditManager() == null)
+ return;
+ //Authorization Exception stacktrace is huge. Scale it down
+ //as the original stack trace can be seen in server.log (if needed)
+ String exceptionMessage = e != null ? e.getLocalizedMessage() : "";
+ Map<String,Object> cmap = new HashMap<String,Object>();
+ cmap.putAll(resource.getMap());
+ cmap.put("Resource:", resource.toString());
+ cmap.put("Exception:", exceptionMessage);
+ audit(level,cmap,null);
+ }
+
+ protected void audit(String level,
+ Map<String,Object> contextMap, Exception e)
+ {
+ AuditManager am = securityContext.getAuditManager();
+ if(am == null)
+ return;
+ contextMap.put("Source", getClass().getName());
+ AuditEvent ae = new AuditEvent(level,contextMap,e);
+ am.audit(ae);
+ }
+
+ protected Map<String,Object> getContextMap(Principal principal, String methodName)
+ {
+ Map<String,Object> cmap = new HashMap<String,Object>();
+ cmap.put("principal", principal);
+ cmap.put("method", methodName);
+ return cmap;
+ }
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractWebAuthorizationHelper.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractWebAuthorizationHelper.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/AbstractWebAuthorizationHelper.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+/**
+ * Abstract Web Authorization Helper
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 17, 2008
+ * @version $Revision$
+ */
+public abstract class AbstractWebAuthorizationHelper
+extends AbstractJavaEEHelper
+{
+ protected boolean enableAudit = false;
+
+ public boolean isEnableAudit()
+ {
+ return enableAudit;
+ }
+
+ public void setEnableAudit(boolean enableAudit)
+ {
+ this.enableAudit = enableAudit;
+ }
+
+ public abstract boolean checkResourcePermission(
+ Map<String, Object> contextMap,
+ ServletRequest request,
+ ServletResponse response,
+ Subject callerSubject,
+ String contextID,
+ String canonicalRequestURI);
+
+ public abstract boolean hasRole(
+ String roleName,
+ Principal principal,
+ String servletName,
+ Set<Principal> principalRoles,
+ String contextID,
+ Subject callerSubject);
+
+ public abstract boolean hasUserDataPermission(
+ Map<String,Object> contextMap,
+ ServletRequest request,
+ ServletResponse response,
+ String contextID,
+ Subject callerSubject);
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/EJBAuthenticationHelper.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/EJBAuthenticationHelper.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/EJBAuthenticationHelper.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+import java.security.Principal;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+
+import org.jboss.security.SecurityContext;
+import org.jboss.security.audit.AuditLevel;
+import org.jboss.security.identitytrust.IdentityTrustException;
+import org.jboss.security.identitytrust.IdentityTrustManager;
+import org.jboss.security.identitytrust.IdentityTrustManager.TrustDecision;
+
+/**
+ * Helper Class for EJB Authentication
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 18, 2008
+ * @version $Revision$
+ */
+public class EJBAuthenticationHelper extends AbstractJavaEEHelper
+{
+ public EJBAuthenticationHelper(SecurityContext sc)
+ {
+ if(sc == null)
+ throw new IllegalArgumentException("sc is null");
+ this.securityContext = sc;
+ }
+
+ public boolean isTrusted() throws IdentityTrustException
+ {
+ TrustDecision td = TrustDecision.NotApplicable;
+ IdentityTrustManager itm = securityContext.getIdentityTrustManager();
+ if(itm != null)
+ {
+ td = itm.isTrusted(securityContext);
+ if(td == TrustDecision.Deny)
+ throw new IdentityTrustException("Caller denied by identity trust framework");
+ }
+ return td == TrustDecision.Permit;
+ }
+
+ /**
+ * Authenticate the caller
+ * @param p
+ * @param cred
+ * @return
+ */
+ public boolean isValid(Subject subject, String methodName)
+ {
+ Principal p = securityContext.getUtil().getUserPrincipal();
+ Object cred = securityContext.getUtil().getCredential();
+
+ Map<String,Object> cMap = getContextMap(p, methodName);
+
+ boolean auth = securityContext.getAuthenticationManager().isValid(p, cred, subject);
+ if(auth == false)
+ {
+ // Check for the security association exception
+ String EX_KEY = "org.jboss.security.exception";
+ Exception ex = (Exception) securityContext.getData().get(EX_KEY);
+ audit(AuditLevel.ERROR, cMap ,ex);
+ if(ex == null)
+ {
+ audit(AuditLevel.FAILURE,cMap,null);
+ }
+ }
+ else
+ {
+ audit(AuditLevel.SUCCESS,cMap,null);
+ }
+ return auth;
+ }
+
+ /**
+ * Push the authenticated subject onto the security context
+ * IMPORTANT - this needs to be done after the isValid call
+ */
+ public void pushSubjectContext(Subject subject)
+ {
+ securityContext.getSubjectInfo().setAuthenticatedSubject(subject);
+ }
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityActions.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityActions.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityActions.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+
+/**
+ * Privileged Blocks
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 18, 2008
+ * @version $Revision$
+ */
+class SecurityActions
+{
+ static Class<?> loadClass(final String fqn) throws PrivilegedActionException
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>()
+ {
+ public Class<?> run() throws Exception
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ return tcl.loadClass(fqn);
+ }
+ });
+ }
+}
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityHelperFactory.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityHelperFactory.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityHelperFactory.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+import org.jboss.security.SecurityContext;
+
+/**
+ * Factory to get to the helpers
+ * @author Anil.Saldhana at redhat.com
+ * @since Apr 18, 2008
+ * @version $Revision$
+ */
+public class SecurityHelperFactory
+{
+ public static String WebAuthorizationHelperClass =
+ "org.jboss.security.plugins.javaee.WebAuthorizationHelper";
+
+ public static String EjbAuthorizationHelperClass =
+ "org.jboss.security.plugins.javaee.EJBAuthorizationHelper";
+
+ public static EJBAuthenticationHelper getEJBAuthenticationHelper(SecurityContext sc)
+ {
+ return new EJBAuthenticationHelper(sc);
+ }
+
+ public static AbstractWebAuthorizationHelper getWebAuthorizationHelper(SecurityContext sc)
+ throws Exception
+ {
+ Class<?> clazz = SecurityActions.loadClass(WebAuthorizationHelperClass);
+ AbstractWebAuthorizationHelper awh = (AbstractWebAuthorizationHelper) clazz.newInstance();
+ awh.setSecurityContext(sc);
+ return awh;
+ }
+
+ public static AbstractEJBAuthorizationHelper getEJBAuthorizationHelper(SecurityContext sc)
+ throws Exception
+ {
+ Class<?> clazz = SecurityActions.loadClass(EjbAuthorizationHelperClass);
+ AbstractEJBAuthorizationHelper awh = (AbstractEJBAuthorizationHelper) clazz.newInstance();
+ awh.setSecurityContext(sc);
+ return awh;
+ }
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityRoleRef.java
===================================================================
--- projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityRoleRef.java (rev 0)
+++ projects/security/security-spi/trunk/spi/src/main/org/jboss/security/javaee/SecurityRoleRef.java 2008-04-19 00:16:44 UTC (rev 72457)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.javaee;
+
+//$Id: SecurityRoleRef.java 68749 2008-01-09 20:25:39Z anil.saldhana at jboss.com $
+
+/**
+ * Represents a Security Role Ref element in the deployment descriptor
+ * @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ * @since Jul 21, 2006
+ * @version $Revision: 68749 $
+ */
+public class SecurityRoleRef
+{
+ private String name;
+ private String link;
+ private String description;
+
+ public SecurityRoleRef()
+ {
+ }
+
+ public SecurityRoleRef(String name, String link)
+ {
+ this.name = name;
+ this.link = link;
+ }
+
+ public SecurityRoleRef(String name, String link, String description)
+ {
+ this.name = name;
+ this.link = link;
+ this.description = description;
+ }
+
+ /**
+ * Get the description.
+ *
+ * @return the description.
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Set the description.
+ */
+ public void setDescription(String desc)
+ {
+ this.description = desc;
+ }
+
+ /**
+ * Get the link.
+ * @return link
+ */
+ public String getLink()
+ {
+ return this.link;
+ }
+
+
+ /**
+ * Set the link.
+ */
+ public void setLink(String l)
+ {
+ this.link = l;
+ }
+
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return this.name;
+ }
+
+
+ /**
+ * Set the name.
+ *
+ * @return the name.
+ */
+ public void setName(String n)
+ {
+ this.name = n;
+ }
+}
More information about the jboss-cvs-commits
mailing list