gov.bnl.gums
Class FQAN

java.lang.Object
  extended by gov.bnl.gums.FQAN

public class FQAN
extends java.lang.Object

Represent a VOMS extended proxy credential as defined in http://edg-wp2.web.cern.ch/edg-wp2/security/voms/edg-voms-credential.pdf.

A Fully Qualified Attribute Name consists of a VO, a group, a role and a capability. Only the VO is mandatory. The syntax is /VO[/group[/subgroup(s)]][/Role=role][/Capability=cap].

The class will always check that every modification matches the regex /[\w-\.]+(/[\w-\.]+)*(/Role=[\w-\.]+)?(/Capability=[\w-\.]+)? which fully defines all the characters allowed. This differs slightly from the one contained in the specification, as it cointained some small errors. It matches the description of the syntax of the document.

Author:
Gabriele Carcassi, Jay Packard

Constructor Summary
FQAN(java.lang.String fqan)
          Creates a FQAN based on String representation.
FQAN(java.lang.String vo, java.lang.String group, java.lang.String role, java.lang.String capability)
          Creates a FQAN based on the different pieces of information.
 
Method Summary
 boolean equals(java.lang.Object obj)
          FQANs are equals to each other if their vo, group, role and capability are the same.
 java.lang.String getCapability()
          The capability used within the FQAN.
 java.lang.String getFqan()
          A full String representation of the FQAN.
 java.lang.String getGroup()
          The path which includes the groups and subgroups within the FQAN.
 java.lang.String getRole()
          The role used within the FQAN.
 java.lang.String getVo()
          Returns the VO corresponding to the FQAN.
 int hashCode()
          A hashcode generated from the string representation.
 java.lang.String toString()
          Returns the full string representation of the FQAN.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FQAN

public FQAN(java.lang.String fqan)
Creates a FQAN based on String representation. If the parsing fails, it will throw an exception.

Parameters:
fqan - A VOMS FQAN (i.e. "/atlas/production/Role=Leader")

FQAN

public FQAN(java.lang.String vo,
            java.lang.String group,
            java.lang.String role,
            java.lang.String capability)
Creates a FQAN based on the different pieces of information.

Parameters:
vo - The VO name, which cannot be null (i.e. "atlas")
group - A group path, including subgroups (i.e. "/production")
role - The role (i.e. "Leader")
capability - A capability (i.e. "capability"). Note capabilities are being deprecated in VOMS.
Method Detail

equals

public boolean equals(java.lang.Object obj)
FQANs are equals to each other if their vo, group, role and capability are the same.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Another object.
Returns:
True if the object was a FQAN with equal information. False otherwise.

getCapability

public java.lang.String getCapability()
The capability used within the FQAN.

Returns:
The capability or null if none was specified.

getFqan

public java.lang.String getFqan()
A full String representation of the FQAN.

Returns:
The Fully Qualified Attribute name String representation (i.e. "/atlas/production/Role=Leader")

getGroup

public java.lang.String getGroup()
The path which includes the groups and subgroups within the FQAN.

Returns:
The group path (i.e. "/production")

getRole

public java.lang.String getRole()
The role used within the FQAN.

Returns:
The role or null if no role was specified

getVo

public java.lang.String getVo()
Returns the VO corresponding to the FQAN.

Returns:
The VO name (i.e. "atlas")

hashCode

public int hashCode()
A hashcode generated from the string representation.

Overrides:
hashCode in class java.lang.Object
Returns:
A hashcode.

toString

public java.lang.String toString()
Returns the full string representation of the FQAN.

Overrides:
toString in class java.lang.Object
Returns:
The full FQAN (i.e. "/atlas/production/Role=Leader")


Copyright © 2004-2008. All Rights Reserved.