|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.voms.service.SimpleNamingScheme
A singleton class implementing a simple DN-style naming scheme. Note that the core service and VOMS-enabled services don't understand this.
Field Summary | |
private static java.util.regex.Pattern |
capabilitySyntax
Deprecated. |
private static java.util.regex.Pattern |
groupSyntax
Deprecated. |
private static org.apache.log4j.Logger |
log
Deprecated. Logger. |
private static java.util.regex.Pattern |
roleSyntax
Deprecated. |
private static SimpleNamingScheme |
sns
Deprecated. The single instance of this class. |
private static java.util.regex.Pattern |
syntax
Deprecated. The regular expression that describes well-formed container names. |
private static java.lang.String |
voName
Deprecated. The VO name. |
Constructor Summary | |
private |
SimpleNamingScheme()
Deprecated. Private constructor. |
Method Summary | |
void |
checkCapabilityName(java.lang.String name)
Deprecated. Check that name is a capability name. |
void |
checkDirectSubgroup(java.lang.String parent,
java.lang.String child)
Deprecated. Check that child is a direct subcontainer of parent . |
void |
checkGroupName(java.lang.String name)
Deprecated. Check that name is a group name. |
void |
checkRoleName(java.lang.String name)
Deprecated. Check that name is a role name. |
void |
checkSyntax(java.lang.String name)
Deprecated. Check that the given name matches the following regexp: "^(/[^/=]+=[^/=]+)+$" Examples of such names: /C=CH/O=CERN/OU=cern.ch/VO=CMS/Group=Foo (primary group) /C=CH/O=CERN/OU=cern.ch/VO=CMS/Group=Foo/Group=Bar (nested group) /Role=Fred (role) /Capability=Barney (capability) /C=CH/O=CERN/OU=cern.ch/VO=CMS (VO Group) |
private static int |
countCharsInString(java.lang.String s,
char c)
Deprecated. |
java.lang.String |
fromDatabaseCapabilityName(java.lang.String capability)
Deprecated. Convert a capability name in database form to display form. |
java.lang.String |
fromDatabaseGroupName(java.lang.String groupname)
Deprecated. Convert a group name in database form to display form. |
java.lang.String |
fromDatabaseRoleName(java.lang.String rolename)
Deprecated. Convert a role name in database form to display form. |
static ContainerNamingScheme |
getInstance()
Deprecated. Returns an instance of this naming scheme. |
java.lang.String |
getParentGroup(java.lang.String group)
Deprecated. Return the name of the parent group, if any. |
boolean |
isCapability(java.lang.String name)
Deprecated. Returns true if the given name matches the following regexp: "^/Capability=[^/=]+$" Example: /C=CH/O=CERN/OU=cern.ch/Group=Foo/Capability=Bar ^^^^^^^^^^^^^^^ |
boolean |
isDirectSubgroup(java.lang.String parent,
java.lang.String child)
Deprecated. Returns true if parent is a well-formed prefix of child .
|
boolean |
isGroup(java.lang.String name)
Deprecated. Returns true if the given name is well-formed, but it's not a role or capability. |
boolean |
isRole(java.lang.String name)
Deprecated. Returns true if the given name matches the following regexp: "^/Role=[^/=]+$" Example: /C=CH/O=CERN/OU=cern.ch/Group=Foo/Role=Bar ^^^^^^^^^ |
boolean |
isSubgroup(java.lang.String parent,
java.lang.String child)
Deprecated. Returns true if parent is a well-formed real prefix of child .
|
java.lang.String |
toDatabaseCapabilityName(java.lang.String capability)
Deprecated. Convert a capability name in display form to database form. |
java.lang.String |
toDatabaseGroupName(java.lang.String groupname)
Deprecated. Convert a group name in display form to database form. |
java.lang.String |
toDatabaseRoleName(java.lang.String rolename)
Deprecated. Convert a role name in display form to database form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static SimpleNamingScheme sns
private static final org.apache.log4j.Logger log
private static final java.lang.String voName
private static final java.util.regex.Pattern syntax
private static final java.util.regex.Pattern groupSyntax
private static final java.util.regex.Pattern roleSyntax
private static final java.util.regex.Pattern capabilitySyntax
Constructor Detail |
private SimpleNamingScheme() throws ArgumentException
Method Detail |
public static ContainerNamingScheme getInstance() throws ArgumentException
ArgumentException
public void checkSyntax(java.lang.String name) throws ArgumentException
"^(/[^/=]+=[^/=]+)+$"Examples of such names:
/C=CH/O=CERN/OU=cern.ch/VO=CMS/Group=Foo (primary group) /C=CH/O=CERN/OU=cern.ch/VO=CMS/Group=Foo/Group=Bar (nested group) /Role=Fred (role) /Capability=Barney (capability) /C=CH/O=CERN/OU=cern.ch/VO=CMS (VO Group)
checkSyntax
in interface ContainerNamingScheme
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
Examples:
null (alias for VO group) /C=CH/O=CERN/OU=cern.ch (VO group) /C=CH/O=CERN/OU=cern.ch/Group=Foo (primary group) /C=CH/O=CERN/OU=cern.ch/Group=Foo/Group=Bar (nested group)
isGroup
in interface ContainerNamingScheme
ArgumentException
- if name
is not well-formed.public boolean isRole(java.lang.String name) throws ArgumentException
"^/Role=[^/=]+$"Example:
/C=CH/O=CERN/OU=cern.ch/Group=Foo/Role=Bar ^^^^^^^^^
isRole
in interface ContainerNamingScheme
ArgumentException
- if name
is not well-formed.public boolean isCapability(java.lang.String name) throws ArgumentException
"^/Capability=[^/=]+$"Example:
/C=CH/O=CERN/OU=cern.ch/Group=Foo/Capability=Bar ^^^^^^^^^^^^^^^
isCapability
in interface ContainerNamingScheme
ArgumentException
- if name
is not well-formed.public boolean isSubgroup(java.lang.String parent, java.lang.String child) throws ArgumentException
parent
is a well-formed real prefix of child
.
For example, /O=Sample/Group=Foo/Group=Bar
is a
subcontainer of /O=Sample/Group=Foo
.
isSubgroup
in interface ContainerNamingScheme
ArgumentException
- if either parent
or child
is not well-formed.private static int countCharsInString(java.lang.String s, char c)
public boolean isDirectSubgroup(java.lang.String parent, java.lang.String child) throws ArgumentException
parent
is a well-formed prefix of child
.
For example, /O=Sample/VO=Foo/Capability=Bar
is a
subcontainer of /O=Sample/VO=Foo
.
isDirectSubgroup
in interface ContainerNamingScheme
ArgumentException
- if either parent
or child
is not well-formed, or if parent
is null.public void checkGroupName(java.lang.String name) throws ArgumentException
ContainerNamingScheme
name
is a group name. Note that the null
string designates the VO group, so null
is a
well-formed group name.
checkGroupName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed group name.public void checkRoleName(java.lang.String name) throws ArgumentException
ContainerNamingScheme
name
is a role name.
checkRoleName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed role name.public void checkCapabilityName(java.lang.String name) throws ArgumentException
ContainerNamingScheme
name
is a capability name.
checkCapabilityName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed capability name.public void checkDirectSubgroup(java.lang.String parent, java.lang.String child) throws ArgumentException
ContainerNamingScheme
child
is a direct subcontainer of parent
.
checkDirectSubgroup
in interface ContainerNamingScheme
ArgumentException
- if child
is not a direct subgroup of parent
public java.lang.String toDatabaseGroupName(java.lang.String groupname) throws ArgumentException
ContainerNamingScheme
toDatabaseGroupName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed group name.public java.lang.String fromDatabaseGroupName(java.lang.String groupname) throws ArgumentException
ContainerNamingScheme
fromDatabaseGroupName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed group name.public java.lang.String toDatabaseRoleName(java.lang.String rolename) throws ArgumentException
ContainerNamingScheme
toDatabaseRoleName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed role name.public java.lang.String fromDatabaseRoleName(java.lang.String rolename) throws ArgumentException
ContainerNamingScheme
fromDatabaseRoleName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed role name.public java.lang.String toDatabaseCapabilityName(java.lang.String capability) throws ArgumentException
ContainerNamingScheme
toDatabaseCapabilityName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed capability name.public java.lang.String fromDatabaseCapabilityName(java.lang.String capability) throws ArgumentException
ContainerNamingScheme
fromDatabaseCapabilityName
in interface ContainerNamingScheme
ArgumentException
- if name
is not a well-formed capability name.public java.lang.String getParentGroup(java.lang.String group) throws ArgumentException
ContainerNamingScheme
getParentGroup
in interface ContainerNamingScheme
ArgumentException
- if group> is not well-formed, or if it is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |