|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for checking the syntax of container names and distinguishing between different container types by their names.
Note: The implementation must not access the VOMS database for these syntactical checks. A name may be well-formed even if the named container does not exist in the database.
Implementations of this interface must also define a static
getInstance()
method returning an instance of this
interface.
SimpleNamingScheme
Method Summary | |
void |
checkCapabilityName(java.lang.String name)
Check that name is a capability name. |
void |
checkDirectSubgroup(java.lang.String parent,
java.lang.String child)
Check that child is a direct subcontainer of parent . |
void |
checkGroupName(java.lang.String name)
Check that name is a group name. |
void |
checkQualifiedRoleName(java.lang.String name)
Check that name is a fully qualified role name. |
void |
checkRoleName(java.lang.String name)
Check that name is a role name. |
void |
checkSyntax(java.lang.String name)
Check if the given name has correct syntax for a container DN. |
java.lang.String |
fromDatabaseCapabilityName(java.lang.String capability)
Convert a capability name in database form to display form. |
java.lang.String |
fromDatabaseGroupName(java.lang.String groupname)
Convert a group name in database form to display form. |
java.lang.String |
fromDatabaseRoleName(java.lang.String rolename)
Convert a role name in database form to display form. |
java.lang.String |
getGroupFromQualifiedRoleName(java.lang.String name)
Return the base group part of a qualified role name. |
java.lang.String |
getParentGroup(java.lang.String group)
Return the name of the parent group, if any. |
java.lang.String |
getRoleFromQualifiedRoleName(java.lang.String name)
Return the role name part of a qualified role name. |
boolean |
isCapability(java.lang.String name)
Returns true if name corresponds to a capability. |
boolean |
isDirectSubgroup(java.lang.String parent,
java.lang.String child)
Returns true if child is syntactically a direct or indirect
subcontainer of parent .
|
boolean |
isGroup(java.lang.String name)
Returns true if name corresponds to a group. |
boolean |
isQualifiedRole(java.lang.String name)
Returns true if name corresponds to a qualified role. |
boolean |
isRole(java.lang.String name)
Returns true if name corresponds to a role. |
boolean |
isSubgroup(java.lang.String parent,
java.lang.String child)
Returns true if child is syntactically a direct or
indirect subcontainer of parent .
|
java.lang.String |
toDatabaseCapabilityName(java.lang.String capability)
Convert a capability name in display form to database form. |
java.lang.String |
toDatabaseGroupName(java.lang.String groupname)
Convert a group name in display form to database form. |
java.lang.String |
toDatabaseRoleName(java.lang.String rolename)
Convert a role name in display form to database form. |
Method Detail |
public void checkSyntax(java.lang.String name) throws ArgumentException
name
- A string supplied by the client.
ArgumentException
- if name
is not well-formed.
Invariant: if this method returns normally, exactly one of
isGroup
, isRole
or
isCapability
must return true.public boolean isGroup(java.lang.String name) throws ArgumentException
name
corresponds to a group.
name
- A string supplied by the client.
ArgumentException
- if name
is not well-formed.public boolean isRole(java.lang.String name) throws ArgumentException
name
corresponds to a role.
name
- A string supplied by the client.
ArgumentException
- if name
is not well-formed.public boolean isQualifiedRole(java.lang.String name) throws ArgumentException
name
corresponds to a qualified role.
name
- A string supplied by the client.
ArgumentException
- if name
is not well-formed.public boolean isCapability(java.lang.String name) throws ArgumentException
name
corresponds to a capability.
name
- A string supplied by the client.
ArgumentException
- if name
is not well-formed.public void checkGroupName(java.lang.String name) throws ArgumentException
name
is a group name. Note that the null
string designates the VO group, so null
is a
well-formed group name.
name
- A string supplied by the client.
ArgumentException
- if name
is not a well-formed group name.public void checkRoleName(java.lang.String name) throws ArgumentException
name
is a role name.
name
- A string supplied by the client.
ArgumentException
- if name
is not a well-formed role name.public void checkCapabilityName(java.lang.String name) throws ArgumentException
name
is a capability name.
name
- A string supplied by the client.
ArgumentException
- if name
is not a well-formed capability name.public void checkQualifiedRoleName(java.lang.String name) throws ArgumentException
name
is a fully qualified role name.
name
- A string supplied by the client.
ArgumentException
- if name
is not a well-formed role name.public java.lang.String getGroupFromQualifiedRoleName(java.lang.String name) throws ArgumentException
name
- A string supplied by the client.
ArgumentException
- if name
is not a well-formed qualified role name.public java.lang.String getRoleFromQualifiedRoleName(java.lang.String name) throws ArgumentException
name
- A string supplied by the client.
ArgumentException
- if name
is not a well-formed qualified role name.public boolean isSubgroup(java.lang.String parent, java.lang.String child) throws ArgumentException
child
is syntactically a direct or
indirect subcontainer of parent
.
In more detail, it must return true if (and only if)
parent
is the VO group (or null
, and child is a
primary group, a nested group, a capability or a VO-level role, or
parent
is a primary group or subgroup, and child
is
one of its (direct or indirect) subgroups, orparent
is a primary group or subgroup, and child
is
associated with parent
or one of its subgroups.
ArgumentException
- if either parent
or child
is not well-formed.public java.lang.String getParentGroup(java.lang.String group) throws ArgumentException
ArgumentException
- if group> is not well-formed, or if it is null.
public boolean isDirectSubgroup(java.lang.String parent, java.lang.String child) throws ArgumentException
child
is syntactically a direct or indirect
subcontainer of parent
.
In more detail, it must return true if (and only if)
parent
is the VO group, and child is a primary group, a capability or a VO-level role, or
parent
is a primary group or subgroup, and child
is one of its direct subgroups, orparent
is a primary group or subgroup, and child
is one of its associated roles.
ArgumentException
- if either parent
or child
is not well-formed, or if parent
is null.public void checkDirectSubgroup(java.lang.String parent, java.lang.String child) throws ArgumentException
child
is a direct subcontainer of parent
.
ArgumentException
- if child
is not a direct subgroup of parent
public java.lang.String toDatabaseGroupName(java.lang.String groupname) throws ArgumentException
ArgumentException
- if name
is not a well-formed group name.public java.lang.String fromDatabaseGroupName(java.lang.String groupname) throws ArgumentException
ArgumentException
- if name
is not a well-formed group name.public java.lang.String toDatabaseRoleName(java.lang.String rolename) throws ArgumentException
ArgumentException
- if name
is not a well-formed role name.public java.lang.String fromDatabaseRoleName(java.lang.String rolename) throws ArgumentException
ArgumentException
- if name
is not a well-formed role name.public java.lang.String toDatabaseCapabilityName(java.lang.String capability) throws ArgumentException
ArgumentException
- if name
is not a well-formed capability name.public java.lang.String fromDatabaseCapabilityName(java.lang.String capability) throws ArgumentException
ArgumentException
- if name
is not a well-formed capability name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |