Package org.italiangrid.voms.util
Class VOMSFQANNamingScheme
- java.lang.Object
-
- org.italiangrid.voms.util.VOMSFQANNamingScheme
-
public class VOMSFQANNamingScheme extends Object
This class provides utility methods that are used for parsing, matching voms FQANs (Fully Qualified Attribute Names).- Author:
- Karoly Lorentey, Andrea Ceccanti
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
capabilityPattern
static String
capabilitySyntax
static Pattern
fqanPattern
static String
fqanSyntax
static Pattern
groupPattern
static String
groupSyntax
static Pattern
qualifiedRolePattern
static String
qualifiedRoleSyntax
static Pattern
rolePattern
static String
roleSyntax
-
Constructor Summary
Constructors Constructor Description VOMSFQANNamingScheme()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkGroup(String fqan)
This methods checks that the fqan passed as argument complies with the syntax used by voms to identify groups.static void
checkRole(String roleName)
This methods checks that the string passed as argument complies with the syntax used by voms to identify roles.static void
checkSyntax(String fqan)
This methods checks that the string passed as argument complies with the voms FQAN syntax.static String
getGroupName(String containerName)
This method extracts group name information from the FQAN passed as argument.static String
getRoleName(String containerName)
This method extracts the role name information from the FQAN passed as argument.static boolean
isGroup(String groupName)
This methods checks that the FQAN passed as argument identifies a voms group.static boolean
isQualifiedRole(String fqan)
This methods checks that the FQAN passed as argument identifies a qualified voms role, i.e., a role defined in the context of a voms group.static boolean
isRole(String roleName)
This methods checks that the FQAN passed as argument identifies a voms role.static String
toOldQualifiedRoleSyntax(String qualifiedRole)
-
-
-
Field Detail
-
fqanSyntax
public static final String fqanSyntax
- See Also:
- Constant Field Values
-
groupSyntax
public static final String groupSyntax
- See Also:
- Constant Field Values
-
roleSyntax
public static final String roleSyntax
- See Also:
- Constant Field Values
-
qualifiedRoleSyntax
public static final String qualifiedRoleSyntax
- See Also:
- Constant Field Values
-
capabilitySyntax
public static final String capabilitySyntax
- See Also:
- Constant Field Values
-
fqanPattern
public static final Pattern fqanPattern
-
groupPattern
public static final Pattern groupPattern
-
rolePattern
public static final Pattern rolePattern
-
qualifiedRolePattern
public static final Pattern qualifiedRolePattern
-
capabilityPattern
public static final Pattern capabilityPattern
-
-
Method Detail
-
checkSyntax
public static void checkSyntax(String fqan)
This methods checks that the string passed as argument complies with the voms FQAN syntax.- Parameters:
fqan
- the string that must be checked for compatibility with FQAN syntax.- Throws:
VOMSError
- If there's an error in the FQAN syntax.
-
checkGroup
public static void checkGroup(String fqan)
This methods checks that the fqan passed as argument complies with the syntax used by voms to identify groups.- Parameters:
fqan
- the string that has to be checked.- Throws:
VOMSError
- If the string passed as argument doens not comply with the voms sytax.
-
checkRole
public static void checkRole(String roleName)
This methods checks that the string passed as argument complies with the syntax used by voms to identify roles.- Parameters:
roleName
- the name of the role- Throws:
VOMSError
- If the string passed as argument doens not comply with the voms sytax.
-
isGroup
public static boolean isGroup(String groupName)
This methods checks that the FQAN passed as argument identifies a voms group.- Parameters:
groupName
- the string to check.- Returns:
- true, if the string passed as argument identifies a voms group.
- false, otherwise.
-
isRole
public static boolean isRole(String roleName)
This methods checks that the FQAN passed as argument identifies a voms role.- Parameters:
roleName
- the string to check.- Returns:
- true, if the string passed as argument identifies a voms role.
- false, otherwise.
-
isQualifiedRole
public static boolean isQualifiedRole(String fqan)
This methods checks that the FQAN passed as argument identifies a qualified voms role, i.e., a role defined in the context of a voms group.- Parameters:
fqan
- the string to check.- Returns:
- true, if the string passed as argument identifies a qualified voms role.
- false, otherwise.
-
getRoleName
public static String getRoleName(String containerName)
This method extracts the role name information from the FQAN passed as argument.- Parameters:
containerName
- the FQAN- Returns:
- A string containing the role name, if found
- null, if no role information is contained in the FQAN passed as argument
-
getGroupName
public static String getGroupName(String containerName)
This method extracts group name information from the FQAN passed as argument.- Parameters:
containerName
- the FQAN- Returns:
- A string containing the group name, if found
- null, if no group information is contained in the FQAN passed as argument
-
-