org.jboss.security.mapping.providers
Class MappingProviderUtil

java.lang.Object
  extended by org.jboss.security.mapping.providers.MappingProviderUtil

public class MappingProviderUtil
extends Object

Utility class for Mapping Providers

Since:
Oct 10, 2006
Version:
$Revision$
Author:
Anil Saldhana

Field Summary
static org.jboss.logging.Logger log
           
 
Constructor Summary
MappingProviderUtil()
           
 
Method Summary
static Group addPrincipals(Group grp, Enumeration<? extends Principal> en)
          Add principals passed via an enumeration into a group
static Group addRoles(Group roles, String[] addRoles)
          Add the roles into the Group
static String[] getRolesFromCommaSeparatedString(String str)
          Given a comma-separated list of roles, return a string array
static Principal instantiatePrincipal(Class<?> cls, String role)
          Instantiate a Principal representing a principal
static Group removePrincipals(Group grp)
          Remove all the principals from the group
static Group removeRoles(Group roles, String[] removeRoles)
          Remove the roles from the Group
static Group replacePrincipals(Group fg, Group sg)
          Replace the principals in first group with those in the second
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.jboss.logging.Logger log
Constructor Detail

MappingProviderUtil

public MappingProviderUtil()
Method Detail

addPrincipals

public static Group addPrincipals(Group grp,
                                  Enumeration<? extends Principal> en)
Add principals passed via an enumeration into a group

Parameters:
grp -
en -
Returns:

addRoles

public static Group addRoles(Group roles,
                             String[] addRoles)
Add the roles into the Group

Parameters:
roles - Group of roles
addRoles -
Returns:
Group with the added roles

getRolesFromCommaSeparatedString

public static String[] getRolesFromCommaSeparatedString(String str)
Given a comma-separated list of roles, return a string array

Parameters:
str -
Returns:

instantiatePrincipal

public static Principal instantiatePrincipal(Class<?> cls,
                                             String role)
Instantiate a Principal representing a principal

Parameters:
cls - principal class
role - Name of the role
Returns:

removePrincipals

public static Group removePrincipals(Group grp)
Remove all the principals from the group

Parameters:
grp -
Returns:

removeRoles

public static Group removeRoles(Group roles,
                                String[] removeRoles)
Remove the roles from the Group

Parameters:
roles - Group of roles
removeRoles -
Returns:
Group with roles removed

replacePrincipals

public static Group replacePrincipals(Group fg,
                                      Group sg)
Replace the principals in first group with those in the second

Parameters:
fg -
sg -
Returns:


Copyright © 2009 JBoss Inc.. All Rights Reserved.