net.geant.edugain.meta.publish
Class MetaDataMarshaller

java.lang.Object
  extended by net.geant.edugain.meta.publish.MetaDataMarshaller

public class MetaDataMarshaller
extends java.lang.Object

This class performs the mapping of eduGAIN metadata objects to SAML2 metadata objects and their marshalling to the XML representation.

Author:
Manuela Stanica

Field Summary
protected static org.opensaml.xml.XMLObjectBuilderFactory builderFactory
          XMLObject builder factory.
private static org.slf4j.Logger log
          Class logger.
protected static org.opensaml.xml.io.MarshallerFactory marshallerFactory
          XMLObject marshaller factory.
protected static org.opensaml.xml.parse.BasicParserPool parser
          Parser manager used to parse XML.
 
Constructor Summary
MetaDataMarshaller()
          Constructor
 
Method Summary
 org.opensaml.saml2.metadata.AttributeAuthorityDescriptor mapToAADescriptor(AAInterface aaInterf)
          Maps the given eduGAIN AAInterface object to a SAML2 AttributeAuthorityDescriptor
 OnlineCADescriptorType mapToCADescriptor(CAInterface caInterf)
          Maps the given eduGAIN CAInterface object to an OnlineCADescriptorType object, which is an eduGAIN extension to SAML2 metadata.
 org.opensaml.saml2.metadata.ContactPerson mapToContactPerson(Contact contact)
          Maps the given eduGAIN Contact object to a SAML2 ContactPerson object
 org.opensaml.saml2.metadata.EntityDescriptor mapToEntityDescriptor(BEMetaData bemd)
          Maps the given eduGAIN BEMetaData object to a SAML2 EntityDescriptor
 org.opensaml.saml2.metadata.IDPSSODescriptor mapToIDPDescriptor(IDPInterface idpInterf)
          Maps the given eduGAIN IDPInterface object to a SAML2 IDPSSODescriptor
 org.opensaml.saml2.metadata.Organization mapToOrganization(Organisation org, java.util.ArrayList<HLPattern> hlPatterns)
          Builds an SAML2 Organization object and maps the given 'home locator patterns' as Extensions to the Organization element
 org.opensaml.saml2.metadata.SPSSODescriptor mapToSPDescriptor(SPInterface spInterf)
          Maps the given eduGAIN SPInterface object to a SAML2 SPSSODescriptor
 java.lang.String mapToXMLString(org.w3c.dom.Element root)
          Obtains the XML representation for a given root element in the form of a String
 org.w3c.dom.Element marshallMetaData(java.util.ArrayList<BEMetaData> bemdlist, java.lang.String fppCompID, java.lang.String federationID)
          Maps the given list of BEMetaData objects to the corresponding SAML2 representation (EntitiesDescriptor) and marshalls the latter to a DOM element.
 org.w3c.dom.Element marshallMetaData(BEMetaData bemd)
          Maps the given BEMetaData object to the corresponding SAML2 representation (EntityDescriptor) and marshalls the latter to a DOM element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected static org.opensaml.xml.parse.BasicParserPool parser
Parser manager used to parse XML.


builderFactory

protected static org.opensaml.xml.XMLObjectBuilderFactory builderFactory
XMLObject builder factory.


marshallerFactory

protected static org.opensaml.xml.io.MarshallerFactory marshallerFactory
XMLObject marshaller factory.


log

private static org.slf4j.Logger log
Class logger.

Constructor Detail

MetaDataMarshaller

public MetaDataMarshaller()
Constructor

Method Detail

marshallMetaData

public org.w3c.dom.Element marshallMetaData(BEMetaData bemd)
Maps the given BEMetaData object to the corresponding SAML2 representation (EntityDescriptor) and marshalls the latter to a DOM element

Parameters:
bemd - the BE metadata object
Returns:
the XML representation of the BE metadata

marshallMetaData

public org.w3c.dom.Element marshallMetaData(java.util.ArrayList<BEMetaData> bemdlist,
                                            java.lang.String fppCompID,
                                            java.lang.String federationID)
Maps the given list of BEMetaData objects to the corresponding SAML2 representation (EntitiesDescriptor) and marshalls the latter to a DOM element. Only possible from a central point (FPP) within a federation, cannot be called from a BE.

Parameters:
bemdlist - the list of BE metadata object
fppCompID - the component ID of the publishing FPP
Returns:
the XML representation of the BE metadata

mapToEntityDescriptor

public org.opensaml.saml2.metadata.EntityDescriptor mapToEntityDescriptor(BEMetaData bemd)
Maps the given eduGAIN BEMetaData object to a SAML2 EntityDescriptor

Parameters:
bemd - the BE metadata object
Returns:
the SAML2 representation obtained

mapToIDPDescriptor

public org.opensaml.saml2.metadata.IDPSSODescriptor mapToIDPDescriptor(IDPInterface idpInterf)
Maps the given eduGAIN IDPInterface object to a SAML2 IDPSSODescriptor

Parameters:
idpInterf - the IDPInterface object
Returns:
the SAML2 representation obtained

mapToAADescriptor

public org.opensaml.saml2.metadata.AttributeAuthorityDescriptor mapToAADescriptor(AAInterface aaInterf)
Maps the given eduGAIN AAInterface object to a SAML2 AttributeAuthorityDescriptor

Parameters:
aaInterf - the AAInterface object
Returns:
the SAML2 representation obtained

mapToSPDescriptor

public org.opensaml.saml2.metadata.SPSSODescriptor mapToSPDescriptor(SPInterface spInterf)
Maps the given eduGAIN SPInterface object to a SAML2 SPSSODescriptor

Parameters:
spInterf - the SPInterface object
Returns:
the SAML2 representation obtained

mapToCADescriptor

public OnlineCADescriptorType mapToCADescriptor(CAInterface caInterf)
Maps the given eduGAIN CAInterface object to an OnlineCADescriptorType object, which is an eduGAIN extension to SAML2 metadata.

Parameters:
caInterf - the CAInterface object
Returns:
the SAML2 extension object obtained

mapToOrganization

public org.opensaml.saml2.metadata.Organization mapToOrganization(Organisation org,
                                                                  java.util.ArrayList<HLPattern> hlPatterns)
Builds an SAML2 Organization object and maps the given 'home locator patterns' as Extensions to the Organization element

Parameters:
hlPatterns - the home locator patterns to be included
Returns:
the created Organization object

mapToContactPerson

public org.opensaml.saml2.metadata.ContactPerson mapToContactPerson(Contact contact)
Maps the given eduGAIN Contact object to a SAML2 ContactPerson object

Parameters:
contact - the eduGAIN object to be mapped
Returns:
the SAML2 ContactPerson representation

mapToXMLString

public java.lang.String mapToXMLString(org.w3c.dom.Element root)
Obtains the XML representation for a given root element in the form of a String

Parameters:
root - the element to be mapped to an xml string
Returns:
the xml string