}
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) {
EntitiesDescriptor entitiesDescriptor = (EntitiesDescriptor) samlElement;
// Set the ID attribute
if (entitiesDescriptor.getID() != null) {
log.debug("Writing ID attribute to EntitiesDescriptor DOM element.");
domElement.setAttributeNS(null, EntitiesDescriptor.ID_ATTRIB_NAME, entitiesDescriptor.getID());
domElement.setIdAttributeNS(null, EntitiesDescriptor.ID_ATTRIB_NAME, true);
}
// Set the validUntil attribute
if (entitiesDescriptor.getValidUntil() != null) {
log.debug("Writting validUntil attribute to EntitiesDescriptor DOM element");
String validUntilStr = Configuration.getSAMLDateFormatter().print(entitiesDescriptor.getValidUntil());
domElement.setAttributeNS(null, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME, validUntilStr);
}
// Set the cacheDuration attribute
if (entitiesDescriptor.getCacheDuration() != null) {
log.debug("Writting cacheDuration attribute to EntitiesDescriptor DOM element");
String cacheDuration = XMLHelper.longToDuration(entitiesDescriptor.getCacheDuration());
domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME, cacheDuration);
}
// Set the Name attribute
if (entitiesDescriptor.getName() != null) {
log.debug("Writting Name attribute to EntitiesDescriptor DOM element");
domElement.setAttributeNS(null, EntitiesDescriptor.NAME_ATTRIB_NAME, entitiesDescriptor.getName());
}
}