net.geant.edugain.validation
Class eduGAINComponentID

java.lang.Object
  extended by net.geant.edugain.validation.eduGAINComponentID
All Implemented Interfaces:
ComponentID

public class eduGAINComponentID
extends java.lang.Object
implements ComponentID

This class represents component identificators and allows to manipulate them easily.

Author:
Jaime Perez, Manuela Stanica

Field Summary
private  java.lang.String entity
           
private  java.lang.String federation
           
private  java.lang.String kind
           
private  org.apache.log4j.Logger log
           
private  java.lang.String namespace
           
private  org.opensaml.common.SignableSAMLObject object
           
private  java.lang.String service
           
private  java.lang.String urn
           
private  java.lang.String[] values
           
 
Constructor Summary
eduGAINComponentID(org.opensaml.SAMLSignedObject obj)
          Creates a new ComponentID from an OpenSAML 1 signed document.
eduGAINComponentID(org.opensaml.common.SignableSAMLObject obj)
          Creates a new ComponentID from an OpenSAML 2 signed document.
eduGAINComponentID(java.lang.String cid)
          Creates a new instance of eduGAINComponentID
 
Method Summary
 void checkEntityName()
          This method verifies the match between the entity name in the Component ID retrieved from the signature of a metadata object, the one from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.
 void checkEntityName(java.lang.String fromURL)
          This method verifies the match between the entity name in the Component ID retrieved from the signature of a metadata object, the one from the URL (if existent),from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.
 void checkFederationName()
          This method verifies the match between the federation name in the Component ID retrieved from the signature of a metadata object, the one from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.
 void checkFederationName(java.lang.String fromURL)
          This method verifies the match between the federation name in the Component ID retrieved from the signature of a metadata object, the one from the URL (if existent), from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.
 java.lang.String getEntityName()
          Returns the entity name of this component identifier.
 java.lang.String getFederationName()
          Returns the federation name of this component identifier.
 java.lang.String getNameSpace()
          Returns the namespace for this component identifier.
 java.lang.String getServiceIdentifier()
          Returns the local service identifier identifier (if present) of this component identifier.
 java.lang.String getURN()
          Returns the full urn for this component identifier.
 java.lang.String[] getValues()
          Returns all the values (not including namespace) for this URN.
 boolean isBE()
          Determines if this component identifier relates to a Bridging Element.
 boolean isFPP()
          Determines if this component identifier relates to a Federation Peering Point.
 boolean isIDP()
          Determines if this component identifier relates to an Identity Provider.
 boolean isMDS()
          Determines if this component identifier relates to a Metadata Service.
 boolean isSP()
          Determines if this component identifier relates to a Service Provider.
private  void parse(java.lang.String cid)
           
 java.lang.String toString()
          Returns the full urn for this component identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

namespace

private java.lang.String namespace

kind

private java.lang.String kind

federation

private java.lang.String federation

entity

private java.lang.String entity

service

private java.lang.String service

object

private org.opensaml.common.SignableSAMLObject object

urn

private java.lang.String urn

values

private java.lang.String[] values

log

private org.apache.log4j.Logger log
Constructor Detail

eduGAINComponentID

public eduGAINComponentID(java.lang.String cid)
                   throws ValidationException
Creates a new instance of eduGAINComponentID

Throws:
ValidationException

eduGAINComponentID

public eduGAINComponentID(org.opensaml.common.SignableSAMLObject obj)
                   throws ValidationException
Creates a new ComponentID from an OpenSAML 2 signed document.

Parameters:
obj - A signed object to extract the ComponentID from.
Throws:
ValidationException

eduGAINComponentID

public eduGAINComponentID(org.opensaml.SAMLSignedObject obj)
                   throws ValidationException
Creates a new ComponentID from an OpenSAML 1 signed document.

Parameters:
obj - A signed object to extract the ComponentID from.
Throws:
ValidationException
Method Detail

parse

private void parse(java.lang.String cid)
            throws ValidationException
Throws:
ValidationException

getFederationName

public java.lang.String getFederationName()
Returns the federation name of this component identifier.

Returns:
the federation name of the component identifier.

getEntityName

public java.lang.String getEntityName()
Returns the entity name of this component identifier.

Returns:
the entity name of the component identifier.

getServiceIdentifier

public java.lang.String getServiceIdentifier()
Returns the local service identifier identifier (if present) of this component identifier.

Returns:
the local service identifier (if present) of the component identifier.

isMDS

public boolean isMDS()
Determines if this component identifier relates to a Metadata Service.

Returns:
true if this is a Metadata Service, false otherwise.

isFPP

public boolean isFPP()
Determines if this component identifier relates to a Federation Peering Point.

Returns:
true if this is a Federation Peering Point, false otherwise.

isBE

public boolean isBE()
Determines if this component identifier relates to a Bridging Element.

Returns:
true if this is a Bridging Element, false otherwise.

isSP

public boolean isSP()
Determines if this component identifier relates to a Service Provider.

Returns:
true if this is a Service Provider, false otherwise.

isIDP

public boolean isIDP()
Determines if this component identifier relates to an Identity Provider.

Returns:
true if this is an Identity Provider, false otherwise.

checkFederationName

public void checkFederationName(java.lang.String fromURL)
                         throws ValidationException
This method verifies the match between the federation name in the Component ID retrieved from the signature of a metadata object, the one from the URL (if existent), from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.

Parameters:
fromURL - The federation name extracted from the URL.
Throws:
ValidationException

checkFederationName

public void checkFederationName()
                         throws ValidationException
This method verifies the match between the federation name in the Component ID retrieved from the signature of a metadata object, the one from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.

Throws:
ValidationException

checkEntityName

public void checkEntityName(java.lang.String fromURL)
                     throws ValidationException
This method verifies the match between the entity name in the Component ID retrieved from the signature of a metadata object, the one from the URL (if existent),from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.

Parameters:
fromURL - The federation name extracted from the URL
Throws:
ValidationException

checkEntityName

public void checkEntityName()
                     throws ValidationException
This method verifies the match between the entity name in the Component ID retrieved from the signature of a metadata object, the one from the EntitiesDescriptor@Name attribute (if existent) and from the EntityDescriptor@EntityID attribute.

Throws:
ValidationException

getNameSpace

public java.lang.String getNameSpace()
Returns the namespace for this component identifier.

Specified by:
getNameSpace in interface ComponentID
Returns:
the namespace for this component identifier.

getURN

public java.lang.String getURN()
Returns the full urn for this component identifier.

Specified by:
getURN in interface ComponentID
Returns:
the full urn for this component identifier.

getValues

public java.lang.String[] getValues()
Returns all the values (not including namespace) for this URN.

Specified by:
getValues in interface ComponentID
Returns:
an array of strings with all the values (not including namespace) for this urn.

toString

public java.lang.String toString()
Returns the full urn for this component identifier. The same as getURN().

Specified by:
toString in interface ComponentID
Overrides:
toString in class java.lang.Object
Returns:
the full urn for this component identifier.