gov.bnl.gums
Class FQAN

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

public class FQAN
extends 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 contained some small errors. It matches the description of the syntax of the document.

Author:
Gabriele Carcassi, Jay Packard

Constructor Summary
FQAN(String fqan)
          Creates a FQAN based on String representation.
FQAN(String fqan, boolean checkFormedness)
          Creates a FQAN based on String representation.
FQAN(String vo, String group, String role, String capability)
          Creates a FQAN based on the different pieces of information.
 
Method Summary
 boolean equals(Object obj)
          FQANs are equals to each other if their vo, group, role and capability are the same.
 String getCapability()
          The capability used within the FQAN.
 String getFqan()
          A full String representation of the FQAN.
 String getGroup()
          The path which includes the groups and subgroups within the FQAN.
 String getRole()
          The role used within the FQAN.
 String getVo()
          Returns the VO corresponding to the FQAN.
 int hashCode()
          A hashcode generated from the string representation.
 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(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(String fqan,
            boolean checkFormedness)
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(String vo,
            String group,
            String role,
            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(Object obj)
FQANs are equals to each other if their vo, group, role and capability are the same.

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

getCapability

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

Returns:
The capability or null if none was specified.

getFqan

public 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 String getGroup()
The path which includes the groups and subgroups within the FQAN.

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

getRole

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

Returns:
The role or null if no role was specified

getVo

public 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 Object
Returns:
A hashcode.

toString

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

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


Copyright © 2004-2009. All Rights Reserved.