com.caucho.security
Class XmlRoleMap

java.lang.Object
  extended by com.caucho.security.AbstractRoleMap
      extended by com.caucho.security.XmlRoleMap
All Implemented Interfaces:
RoleMap
Direct Known Subclasses:
XmlRoleMap

@Service
public class XmlRoleMap
extends AbstractRoleMap

The XML role-map reads a static file for authentication.

 <role-map url="xml:path=WEB-INF/role-map.xml"/>
 

The format of the static file is as follows:

 <role-map>
   <role name="admin" user="Harry Potter"/>
   ...
 </users>
 


Nested Class Summary
static class XmlRoleMap.Role
           
 
Constructor Summary
XmlRoleMap()
           
 
Method Summary
 void addRole(XmlRoleMap.Role role)
          Adds a user from the configuration.
 Path getPath()
          Gets the path to the XML file.
 void init()
          Initialize the XML authenticator.
 java.lang.Boolean isUserInRole(java.lang.String roleName, java.security.Principal user)
          Returns the PasswordUser
 void reload()
          Reload the authenticator.
 void setPath(Path path)
          Sets the path to the XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRoleMap

public XmlRoleMap()
Method Detail

setPath

public void setPath(Path path)
Sets the path to the XML file.


getPath

public Path getPath()
Gets the path to the XML file.


addRole

public void addRole(XmlRoleMap.Role role)
Adds a user from the configuration.
 <init user='Harry Potter:quidditch:user,webdav'/>
 


init

@PostConstruct
public void init()
Initialize the XML authenticator.

Overrides:
init in class AbstractRoleMap

isUserInRole

public java.lang.Boolean isUserInRole(java.lang.String roleName,
                                      java.security.Principal user)
Returns the PasswordUser


reload

public void reload()
Reload the authenticator.