org.jboss.jms.server.security
Class SecurityMetadataStore

java.lang.Object
  extended byorg.jboss.jms.server.security.SecurityMetadataStore
All Implemented Interfaces:
SecurityManager

public class SecurityMetadataStore
extends java.lang.Object
implements SecurityManager

A security metadate store for JMS. Stores security information for destinations and delegates authentication and authorization to a JaasSecurityManager.

Version:
$Revision: 2257 $ $Id: SecurityMetadataStore.java 2257 2007-02-11 01:07:47Z ovidiu.feodorov@jboss.com $
Author:
Peter Antman, Scott Stark, Tim Fox, Ovidiu Feodorov

Constructor Summary
SecurityMetadataStore()
           
 
Method Summary
 javax.security.auth.Subject authenticate(java.lang.String user, java.lang.String password)
          Authenticate the specified user with the given password.
 boolean authorize(java.lang.String user, java.util.Set rolePrincipals)
          Authorize that the subject has at least one of the specified roles.
 void clearSecurityConfig(boolean isQueue, java.lang.String name)
           
 org.w3c.dom.Element getDefaultSecurityConfig()
           
 java.lang.String getSecurityDomain()
           
 SecurityMetadata getSecurityMetadata(boolean isQueue, java.lang.String destName)
           
 void setDefaultSecurityConfig(org.w3c.dom.Element conf)
           
 void setSecurityConfig(boolean isQueue, java.lang.String destName, org.w3c.dom.Element conf)
           
 void setSecurityDomain(java.lang.String securityDomain)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityMetadataStore

public SecurityMetadataStore()
Method Detail

getSecurityMetadata

public SecurityMetadata getSecurityMetadata(boolean isQueue,
                                            java.lang.String destName)
Specified by:
getSecurityMetadata in interface SecurityManager
Returns:
the security meta-data for the given destination.

setSecurityConfig

public void setSecurityConfig(boolean isQueue,
                              java.lang.String destName,
                              org.w3c.dom.Element conf)
                       throws java.lang.Exception
Specified by:
setSecurityConfig in interface SecurityManager
Throws:
java.lang.Exception

clearSecurityConfig

public void clearSecurityConfig(boolean isQueue,
                                java.lang.String name)
                         throws java.lang.Exception
Specified by:
clearSecurityConfig in interface SecurityManager
Throws:
java.lang.Exception

authenticate

public javax.security.auth.Subject authenticate(java.lang.String user,
                                                java.lang.String password)
                                         throws JMSSecurityException
Description copied from interface: SecurityManager
Authenticate the specified user with the given password. Implementations are most likely to delegates to a JBoss AuthenticationManager. Successful autentication will place a new SubjectContext on thread local, which will be used in the authorization process. However, we need to make sure we clean up thread local immediately after we used the information, otherwise some other people security my be screwed up, on account of thread local security stack being corrupted.

Specified by:
authenticate in interface SecurityManager
Throws:
JMSSecurityException

authorize

public boolean authorize(java.lang.String user,
                         java.util.Set rolePrincipals)
Description copied from interface: SecurityManager
Authorize that the subject has at least one of the specified roles. Implementations are most likely to delegates to a JBoss AuthenticationManager.

Specified by:
authorize in interface SecurityManager
Parameters:
rolePrincipals - - The set of roles allowed to read/write/create the destination.
Returns:
true if the subject is authorized, or false if not.

start

public void start()
           throws javax.naming.NamingException
Throws:
javax.naming.NamingException

stop

public void stop()
          throws java.lang.Exception
Throws:
java.lang.Exception

getSecurityDomain

public java.lang.String getSecurityDomain()

setSecurityDomain

public void setSecurityDomain(java.lang.String securityDomain)

getDefaultSecurityConfig

public org.w3c.dom.Element getDefaultSecurityConfig()

setDefaultSecurityConfig

public void setDefaultSecurityConfig(org.w3c.dom.Element conf)
                              throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2006 JBoss Inc. All Rights Reserved.