net.shibboleth.metadata.dom.saml
Class SamlMetadataSupport

java.lang.Object
  extended by net.shibboleth.metadata.dom.saml.SamlMetadataSupport

@ThreadSafe
public final class SamlMetadataSupport
extends Object

Helper class for dealing with SAML metadata.


Field Summary
static QName CACHE_DURATION_ATTRIB_NAME
          cacheDuration attribute name.
static QName ENTITIES_DESCRIPTOR_NAME
          EntitiesDescriptor element name.
static QName ENTITY_DESCRIPTOR_NAME
          EntityDescriptor element name.
static QName EXTENSIONS_NAME
          Extensions element name.
static String MD_NS
          SAML Metadata namespace URI.
static String MD_PREFIX
          Default SAML Metadata namespace prefix.
static String RPI_NS
          SAML Registration and Publication Information namespace URI.
static QName VALID_UNTIL_ATTIB_NAME
          validUntil attribute name.
 
Constructor Summary
private SamlMetadataSupport()
          Constructor.
 
Method Summary
static void addDescriptorExtension(Element descriptor, Element extension)
          Adds a given extension to a given descriptor.
static Element getDescriptorExtensions(Element descriptor, QName extensionName)
          Gets the first instance of an extension element for a given descriptor.
static boolean isEntitiesDescriptor(Element e)
          Checks if the given element is an EntitiesDescriptor.
static boolean isEntityDescriptor(Element e)
          Checks if the given element is an EntityDescriptor.
static boolean isEntityOrEntitiesDescriptor(Element e)
          Check if the given element is an EntityDescriptor or EntitiesDescriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MD_NS

public static final String MD_NS
SAML Metadata namespace URI.

See Also:
Constant Field Values

MD_PREFIX

public static final String MD_PREFIX
Default SAML Metadata namespace prefix.

See Also:
Constant Field Values

RPI_NS

public static final String RPI_NS
SAML Registration and Publication Information namespace URI.

See Also:
Constant Field Values

ENTITIES_DESCRIPTOR_NAME

public static final QName ENTITIES_DESCRIPTOR_NAME
EntitiesDescriptor element name.


ENTITY_DESCRIPTOR_NAME

public static final QName ENTITY_DESCRIPTOR_NAME
EntityDescriptor element name.


EXTENSIONS_NAME

public static final QName EXTENSIONS_NAME
Extensions element name.


VALID_UNTIL_ATTIB_NAME

public static final QName VALID_UNTIL_ATTIB_NAME
validUntil attribute name.


CACHE_DURATION_ATTRIB_NAME

public static final QName CACHE_DURATION_ATTRIB_NAME
cacheDuration attribute name.

Constructor Detail

SamlMetadataSupport

private SamlMetadataSupport()
Constructor.

Method Detail

isEntityOrEntitiesDescriptor

public static boolean isEntityOrEntitiesDescriptor(@Nullable
                                                   Element e)
Check if the given element is an EntityDescriptor or EntitiesDescriptor.

Parameters:
e - element to check
Returns:
true if the element is an EntityDescriptor or EntitiesDescriptor

isEntitiesDescriptor

public static boolean isEntitiesDescriptor(@Nullable
                                           Element e)
Checks if the given element is an EntitiesDescriptor.

Parameters:
e - element to check
Returns:
true if the element is an EntitiesDescriptor, false otherwise

isEntityDescriptor

public static boolean isEntityDescriptor(@Nullable
                                         Element e)
Checks if the given element is an EntityDescriptor.

Parameters:
e - element to check
Returns:
true if the element is an EntityDescriptor, false otherwise

getDescriptorExtensions

public static Element getDescriptorExtensions(@Nullable
                                              Element descriptor,
                                              @Nullable
                                              QName extensionName)
Gets the first instance of an extension element for a given descriptor.

Parameters:
descriptor - the entity or entities descriptor, never null
extensionName - the name of the extension element, never null
Returns:
the first instance of the extension element or null if either argument is null, the given element is not an EntitiesDescriptor or EntityDescriptor, or no such element exists as an extension of the descriptor

addDescriptorExtension

public static void addDescriptorExtension(@Nullable
                                          Element descriptor,
                                          @Nullable
                                          Element extension)
Adds a given extension to a given descriptor. If the given descriptor does not yet have an extensions element then one is added, otherwise the given extension is added as after any existing extensions.

Parameters:
descriptor - descriptor to which the extension will be added
extension - extension to be added to the descriptor


Copyright © 1999-2012. All Rights Reserved.