[jboss-cvs] JBossAS SVN: r65396 - projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/plugins.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Sep 14 12:05:46 EDT 2007
Author: anil.saldhana at jboss.com
Date: 2007-09-14 12:05:46 -0400 (Fri, 14 Sep 2007)
New Revision: 65396
Removed:
projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/plugins/SecurityDomainContext.java
Log:
remove duplicate class
Deleted: projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/plugins/SecurityDomainContext.java
===================================================================
--- projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/plugins/SecurityDomainContext.java 2007-09-14 14:19:12 UTC (rev 65395)
+++ projects/security/security-jboss-sx/trunk/src/main/org/jboss/security/plugins/SecurityDomainContext.java 2007-09-14 16:05:46 UTC (rev 65396)
@@ -1,124 +0,0 @@
-/*
-* 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.plugins;
-
-import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
-import javax.security.auth.Subject;
-
-import org.jboss.security.AuthorizationManager;
-import org.jboss.security.RealmMapping;
-import org.jboss.security.AuthenticationManager;
-import org.jboss.security.SubjectSecurityManager;
-import org.jboss.util.CachePolicy;
-
-/** An encapsulation of the JNDI security context infomation
- *
- * @author Scott.Stark at jboss.org
- * @author Anil.Saldhana at jboss.org
- * @version
- */
-public class SecurityDomainContext
-{
- static final String ACTIVE_SUBJECT = "subject";
- static final String AUTHENTICATION_MGR = "securityMgr";
- static final String REALM_MAPPING = "realmMapping";
- static final String AUTHORIZATION_MGR = "authorizationMgr";
- static final String AUTH_CACHE = "authenticationCache";
- static final String DOMAIN_CONTEXT = "domainContext";
-
- AuthenticationManager securityMgr;
- AuthorizationManager authorizationMgr;
- CachePolicy authenticationCache;
-
- /** Creates new SecurityDomainContextHandler */
- public SecurityDomainContext(AuthenticationManager securityMgr,
- CachePolicy authenticationCache)
- {
- this.securityMgr = securityMgr;
- this.authenticationCache = authenticationCache;
- }
-
- public Object lookup(String name) throws NamingException
- {
- Object binding = null;
- if( name == null || name.length() == 0 )
- throw new InvalidNameException("name cannot be null or empty");
-
- if( name.equals(ACTIVE_SUBJECT) )
- binding = getSubject();
- else if( name.equals(AUTHENTICATION_MGR) )
- binding = securityMgr;
- else if( name.equals(REALM_MAPPING) )
- binding = getRealmMapping();
- else if( name.equals(AUTHORIZATION_MGR) )
- binding = getAuthorizationManager();
- else if( name.equals(AUTH_CACHE) )
- binding = authenticationCache;
- else if( name.equals(DOMAIN_CONTEXT) )
- binding = this;
-
- return binding;
- }
- public Subject getSubject()
- {
- Subject subject = null;
- if( securityMgr instanceof SubjectSecurityManager )
- {
- subject = ((SubjectSecurityManager)securityMgr).getActiveSubject();
- }
- return subject;
- }
- public AuthenticationManager getSecurityManager()
- {
- return securityMgr;
- }
- public RealmMapping getRealmMapping()
- {
- RealmMapping realmMapping = null;
- if(authorizationMgr != null && authorizationMgr instanceof RealmMapping)
- {
- realmMapping = (RealmMapping)authorizationMgr;
- }
- else
- if( securityMgr instanceof RealmMapping )
- {
- realmMapping = (RealmMapping)securityMgr;
- }
- return realmMapping;
- }
-
- public void setAuthorizationManager(AuthorizationManager am)
- {
- this.authorizationMgr = am;
- }
-
- public AuthorizationManager getAuthorizationManager()
- {
- return authorizationMgr;
- }
-
- public CachePolicy getAuthenticationCache()
- {
- return authenticationCache;
- }
-}
More information about the jboss-cvs-commits
mailing list