[java-opensaml] branch master updated: JSPT-79 - Review date and time handling for Java 8
Scott Cantor
cantor.2 at osu.edu
Wed Mar 20 14:27:25 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=ea202bca4f3b079e5dd96673643c384305501948
The following commit(s) were added to refs/heads/master by this push:
new ea202bc JSPT-79 - Review date and time handling for Java 8
ea202bc is described below
commit ea202bca4f3b079e5dd96673643c384305501948
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Mar 20 14:27:22 2019 -0400
JSPT-79 - Review date and time handling for Java 8
https://issues.shibboleth.net/jira/browse/JSPT-79
Revert some earlier changes and move to java-support
classes for all XML DateTime and Duration parsing
and outputting.
Remove piecemeal DateTimeFormatter override features.
---
.../org/opensaml/core/xml/schema/XSDateTime.java | 24 ++------
.../core/xml/schema/impl/XSDateTimeImpl.java | 20 +-----
.../core/xml/schema/impl/XSDateTimeMarshaller.java | 5 +-
.../xml/schema/impl/XSDateTimeUnmarshaller.java | 6 +-
.../opensaml/core/xml/schema/XSDateTimeTest.java | 1 -
.../profile/logic/EntityAttributesPredicate.java | 3 +-
.../opensaml/saml/config/SAMLConfiguration.java | 29 ---------
.../saml/config/SAMLConfigurationSupport.java | 21 -------
.../saml/ext/saml2delrestrict/Delegate.java | 8 ++-
.../opensaml/saml/ext/saml2mdrpi/Publication.java | 11 +++-
.../saml/ext/saml2mdrpi/PublicationInfo.java | 11 +++-
.../saml/ext/saml2mdrpi/RegistrationInfo.java | 13 ++--
.../org/opensaml/saml/saml1/core/Assertion.java | 5 ++
.../saml/saml1/core/AuthenticationStatement.java | 53 ++++++++--------
.../org/opensaml/saml/saml1/core/Conditions.java | 38 +++++++-----
.../saml/saml1/core/RequestAbstractType.java | 37 ++++++-----
.../saml/saml1/core/ResponseAbstractType.java | 43 +++++++------
.../saml/saml2/common/CacheableSAMLObject.java | 6 ++
.../saml/saml2/common/TimeBoundSAMLObject.java | 6 ++
.../org/opensaml/saml/saml2/core/Assertion.java | 58 ++++++++++--------
.../opensaml/saml/saml2/core/AuthnStatement.java | 43 +++++++------
.../org/opensaml/saml/saml2/core/Conditions.java | 38 +++++++-----
.../opensaml/saml/saml2/core/LogoutRequest.java | 47 +++++++-------
.../saml/saml2/core/RequestAbstractType.java | 61 ++++++++++---------
.../saml/saml2/core/StatusResponseType.java | 71 ++++++++++++----------
.../saml/saml2/core/SubjectConfirmationData.java | 48 +++++++++------
.../saml2delrestrict/impl/DelegateMarshaller.java | 8 +--
.../impl/DelegateUnmarshaller.java | 6 +-
.../saml2mdrpi/impl/PublicationInfoMarshaller.java | 8 +--
.../impl/PublicationInfoUnmarshaller.java | 6 +-
.../ext/saml2mdrpi/impl/PublicationMarshaller.java | 9 +--
.../impl/RegistrationInfoMarshaller.java | 8 +--
.../impl/RegistrationInfoUnmarshaller.java | 6 +-
.../saml/saml1/core/impl/AssertionMarshaller.java | 8 +--
.../saml1/core/impl/AssertionUnmarshaller.java | 6 +-
.../impl/AuthenticationStatementMarshaller.java | 7 ++-
.../impl/AuthenticationStatementUnmarshaller.java | 7 ++-
.../saml/saml1/core/impl/ConditionsMarshaller.java | 12 ++--
.../saml1/core/impl/ConditionsUnmarshaller.java | 8 +--
.../core/impl/RequestAbstractTypeMarshaller.java | 7 ++-
.../core/impl/RequestAbstractTypeUnmarshaller.java | 6 +-
.../core/impl/ResponseAbstractTypeMarshaller.java | 14 ++---
.../impl/ResponseAbstractTypeUnmarshaller.java | 6 +-
.../saml/saml2/core/impl/AssertionMarshaller.java | 8 +--
.../saml2/core/impl/AssertionUnmarshaller.java | 6 +-
.../saml2/core/impl/AuthnStatementMarshaller.java | 10 +--
.../core/impl/AuthnStatementUnmarshaller.java | 4 +-
.../saml/saml2/core/impl/ConditionsMarshaller.java | 11 ++--
.../saml2/core/impl/ConditionsUnmarshaller.java | 8 +--
.../saml2/core/impl/LogoutRequestMarshaller.java | 7 ++-
.../saml2/core/impl/LogoutRequestUnmarshaller.java | 6 +-
.../core/impl/RequestAbstractTypeMarshaller.java | 10 +--
.../core/impl/RequestAbstractTypeUnmarshaller.java | 6 +-
.../core/impl/StatusResponseTypeMarshaller.java | 9 +--
.../core/impl/StatusResponseTypeUnmarshaller.java | 8 +--
.../impl/SubjectConfirmationDataMarshaller.java | 14 ++---
.../impl/SubjectConfirmationDataUnmarshaller.java | 8 +--
.../impl/AffiliationDescriptorMarshaller.java | 21 +++----
.../impl/AffiliationDescriptorUnmarshaller.java | 4 +-
.../impl/EntitiesDescriptorMarshaller.java | 21 ++-----
.../impl/EntitiesDescriptorUnmarshaller.java | 4 +-
.../metadata/impl/EntityDescriptorMarshaller.java | 21 +++----
.../impl/EntityDescriptorUnmarshaller.java | 4 +-
.../metadata/impl/RoleDescriptorMarshaller.java | 22 ++-----
.../metadata/impl/RoleDescriptorUnmarshaller.java | 3 +-
.../AffiliationDescriptorOptionalAttributes.xml | 2 +-
.../AuthnAuthorityDescriptorOptionalAttributes.xml | 2 +-
.../impl/EntitiesDescriptorOptionalAttributes.xml | 2 +-
.../impl/EntityDescriptorOptionalAttributes.xml | 2 +-
.../impl/IDPSSODescriptorOptionalAttributes.xml | 2 +-
.../impl/PDPDescriptorOptionalAttributes.xml | 2 +-
.../impl/SPSSODescriptorOptionalAttributes.xml | 2 +-
.../soap/wssecurity/AttributedDateTime.java | 24 --------
.../wssecurity/impl/AttributedDateTimeImpl.java | 27 ++------
74 files changed, 537 insertions(+), 581 deletions(-)
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSDateTime.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSDateTime.java
index 76961e2..9f38206 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSDateTime.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/XSDateTime.java
@@ -18,12 +18,12 @@
package org.opensaml.core.xml.schema;
import java.time.Instant;
-import java.time.format.DateTimeFormatter;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.namespace.QName;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.xml.XMLConstants;
import org.opensaml.core.xml.XMLObject;
@@ -34,10 +34,11 @@ import org.opensaml.core.xml.XMLObject;
public interface XSDateTime extends XMLObject {
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "dateTime";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "dateTime";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(XMLConstants.XSD_NS, TYPE_LOCAL_NAME, XMLConstants.XSD_PREFIX);
+ @Nonnull public static final QName TYPE_NAME =
+ new QName(XMLConstants.XSD_NS, TYPE_LOCAL_NAME, XMLConstants.XSD_PREFIX);
/**
* Gets the dateTime value.
@@ -53,21 +54,4 @@ public interface XSDateTime extends XMLObject {
*/
public void setValue(@Nullable final Instant newValue);
- /**
- * Get the {@link DateTimeFormatter} to be used when stringifying
- * the {@link DateTime} value.
- *
- * <p>Defaults to {@link DateTimeFormatter.ISO_INSTANT}.</p>
- *
- * @return the currently configured formatter
- */
- @Nonnull public DateTimeFormatter getDateTimeFormatter();
-
- /**
- * Set the {@link DateTimeFormatter} to be used when stringifying
- * the {@link DateTime} value.
- *
- * @param newFormatter the new formatter
- */
- public void setDateTimeFormatter(@Nonnull final DateTimeFormatter newFormatter);
}
\ No newline at end of file
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeImpl.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeImpl.java
index 9fc35e5..460d1c3 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeImpl.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeImpl.java
@@ -18,7 +18,6 @@
package org.opensaml.core.xml.schema.impl;
import java.time.Instant;
-import java.time.format.DateTimeFormatter;
import java.util.Collections;
import java.util.List;
@@ -26,7 +25,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.logic.Constraint;
import org.opensaml.core.xml.AbstractXMLObject;
import org.opensaml.core.xml.XMLObject;
@@ -41,9 +39,6 @@ public class XSDateTimeImpl extends AbstractXMLObject implements XSDateTime {
/** Value of this dateTime element. */
private Instant value;
- /** The date time formatter to use. */
- private DateTimeFormatter formatter;
-
/**
* Constructor.
*
@@ -54,16 +49,15 @@ public class XSDateTimeImpl extends AbstractXMLObject implements XSDateTime {
protected XSDateTimeImpl(@Nullable final String namespaceURI, @Nonnull @NotEmpty final String elementLocalName,
@Nullable final String namespacePrefix) {
super(namespaceURI, elementLocalName, namespacePrefix);
- formatter = DateTimeFormatter.ISO_INSTANT;
}
/** {@inheritDoc} */
- public Instant getValue() {
+ @Nullable public Instant getValue() {
return value;
}
/** {@inheritDoc} */
- public void setValue(final Instant newValue) {
+ public void setValue(@Nullable final Instant newValue) {
value = prepareForAssignment(value, newValue);
}
@@ -72,14 +66,4 @@ public class XSDateTimeImpl extends AbstractXMLObject implements XSDateTime {
return Collections.emptyList();
}
- /** {@inheritDoc} */
- public DateTimeFormatter getDateTimeFormatter() {
- return formatter;
- }
-
- /** {@inheritDoc} */
- public void setDateTimeFormatter(final DateTimeFormatter newFormatter) {
- formatter = Constraint.isNotNull(newFormatter, "The formatter cannot be null");
- }
-
}
\ No newline at end of file
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java
index cd805b6..cf720a3 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeMarshaller.java
@@ -17,6 +17,7 @@
package org.opensaml.core.xml.schema.impl;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
import net.shibboleth.utilities.java.support.xml.ElementSupport;
import org.opensaml.core.xml.XMLObject;
@@ -38,7 +39,7 @@ public class XSDateTimeMarshaller extends BaseXMLObjectMarshaller {
throws MarshallingException {
final XSDateTime xsDateTime = (XSDateTime) xmlObject;
- ElementSupport.appendTextContent(domElement, xsDateTime.getDateTimeFormatter().format(xsDateTime.getValue()));
+ ElementSupport.appendTextContent(domElement, DOMTypeSupport.instantToDateTime(xsDateTime.getValue()));
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java
index 5503047..aeee037 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/schema/impl/XSDateTimeUnmarshaller.java
@@ -17,12 +17,12 @@
package org.opensaml.core.xml.schema.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.BaseXMLObjectUnmarshaller;
import org.opensaml.core.xml.schema.XSDateTime;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* Thread-safe unmarshaller for {@link org.opensaml.core.xml.schema.XSDateTime} objects.
*/
@@ -35,7 +35,7 @@ public class XSDateTimeUnmarshaller extends BaseXMLObjectUnmarshaller{
protected void processElementContent(final XMLObject xmlObject, final String elementContent) {
final XSDateTime xsDateTime = (XSDateTime) xmlObject;
- xsDateTime.setValue(Instant.from(xsDateTime.getDateTimeFormatter().parse(elementContent)));
+ xsDateTime.setValue(DOMTypeSupport.dateTimeToInstant(elementContent));
}
}
\ No newline at end of file
diff --git a/opensaml-core/src/test/java/org/opensaml/core/xml/schema/XSDateTimeTest.java b/opensaml-core/src/test/java/org/opensaml/core/xml/schema/XSDateTimeTest.java
index f5a95ba..530d4ca 100644
--- a/opensaml-core/src/test/java/org/opensaml/core/xml/schema/XSDateTimeTest.java
+++ b/opensaml-core/src/test/java/org/opensaml/core/xml/schema/XSDateTimeTest.java
@@ -48,7 +48,6 @@ public class XSDateTimeTest extends XMLObjectBaseTestCase {
@BeforeMethod
protected void setUp() throws Exception{
expectedXMLObjectQName = new QName("urn:example.org:foo", "bar", "foo");
- //expectedValue = new DateTime(2010, 04, 05, 18, 52, 42, 790, ISOChronology.getInstanceUTC());
expectedValue = Instant.parse("2010-04-05T18:52:42.790Z");
}
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
index 7d3118e..537bbf3 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
@@ -56,6 +56,7 @@ import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.logic.Predicate;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
/**
* Predicate to determine whether an {@link EntityDescriptor} or its parent groups contain an {@link EntityAttributes}
@@ -422,7 +423,7 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
} else if (object instanceof XSDateTime) {
final Instant dt = ((XSDateTime) object).getValue();
if (dt != null) {
- toMatch = ((XSDateTime) object).getDateTimeFormatter().format(dt);
+ toMatch = DOMTypeSupport.instantToDateTime(dt);
}
} else if (object instanceof XSBase64Binary) {
toMatch = ((XSBase64Binary) object).getValue();
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfiguration.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfiguration.java
index 94a7b33..2486809 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfiguration.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfiguration.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.config;
-import java.time.ZoneOffset;
-import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -53,9 +51,6 @@ public class SAMLConfiguration {
/** Lowercase string function. */
private static Function<String, String> lowercaseFunction = new LowercaseFunction();
- /** Formatter used to write dates. */
- private DateTimeFormatter dateFormatter;
-
/** SAML 1 Artifact factory. */
private SAML1ArtifactBuilderFactory saml1ArtifactBuilderFactory;
@@ -76,30 +71,6 @@ public class SAMLConfiguration {
}
/**
- * Gets the date format used to string'ify SAML's date/time information.
- *
- * @return date format used to string'ify date objects
- */
- public DateTimeFormatter getSAMLDateFormatter() {
- if (dateFormatter == null) {
- dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withZone(ZoneOffset.UTC);
- }
-
- return dateFormatter;
- }
-
- /**
- * Sets the date format used to string'ify SAML's date/time objects.
- *
- * See the {@link java.text.SimpleDateFormat} documentation for format syntax.
- *
- * @param format date format used to string'ify date objects
- */
- public void setSAMLDateFormat(final String format) {
- dateFormatter = DateTimeFormatter.ofPattern(format).withZone(ZoneOffset.UTC);
- }
-
- /**
* Gets the artifact factory for the library.
*
* @return artifact factory for the library
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfigurationSupport.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfigurationSupport.java
index 0630f5b..f9e3695 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfigurationSupport.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/config/SAMLConfigurationSupport.java
@@ -17,7 +17,6 @@
package org.opensaml.saml.config;
-import java.time.format.DateTimeFormatter;
import java.util.List;
import org.opensaml.core.config.ConfigurationService;
@@ -35,26 +34,6 @@ public final class SAMLConfigurationSupport {
private SAMLConfigurationSupport() {}
/**
- * Gets the date format used to string'ify SAML's date/time objects.
- *
- * @return date format used to string'ify date objects
- */
- public static DateTimeFormatter getSAMLDateFormatter() {
- return ConfigurationService.get(SAMLConfiguration.class).getSAMLDateFormatter();
- }
-
- /**
- * Sets the date format used to string'ify SAML's date/time objects.
- *
- * See the {@link java.text.SimpleDateFormat} documentation for format syntax.
- *
- * @param format date format used to string'ify date objects
- */
- public static void setSAMLDateFormat(final String format) {
- ConfigurationService.get(SAMLConfiguration.class).setSAMLDateFormat(format);
- }
-
- /**
* Gets the artifact factory for the library.
*
* @return artifact factory for the library
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2delrestrict/Delegate.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2delrestrict/Delegate.java
index cc0fd8f..835254f 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2delrestrict/Delegate.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2delrestrict/Delegate.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.ext.saml2delrestrict;
import java.time.Instant;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -48,10 +49,13 @@ public interface Delegate extends SAMLObject {
/** DelegationInstant attribute name. */
public static final String DELEGATION_INSTANT_ATTRIB_NAME = "DelegationInstant";
+
+ /** DelegationInstant attribute QName. */
+ public static final QName DELEGATION_INSTANT_ATTRIB_QNAME =
+ new QName(null, DELEGATION_INSTANT_ATTRIB_NAME, XMLConstants.DEFAULT_NS_PREFIX);
/** ConfirmationMethod attribute name. */
- public static final String CONFIRMATION_METHOD_ATTRIB_NAME = "ConfirmationMethod";
-
+ public static final String CONFIRMATION_METHOD_ATTRIB_NAME = "ConfirmationMethod";
/**
* Gets the BaseID child element of the delegate.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/Publication.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/Publication.java
index 7ea0c0d..249036e 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/Publication.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/Publication.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.ext.saml2mdrpi;
import java.time.Instant;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -47,13 +48,17 @@ public interface Publication extends SAMLObject {
new QName(SAMLConstants.SAML20MDRPI_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20MDRPI_PREFIX);
/** publisher attribute name. */
- public String PUBLISHER_ATTRIB_NAME = "publisher";
+ public static String PUBLISHER_ATTRIB_NAME = "publisher";
/** creation attribute name. */
- public String CREATION_INSTANT_ATTRIB_NAME = "creationInstant";
+ public static String CREATION_INSTANT_ATTRIB_NAME = "creationInstant";
+ /** QName of the creation attribute. */
+ public static final QName CREATION_INSTANT_ATTRIB_QNAME =
+ new QName(null, CREATION_INSTANT_ATTRIB_NAME, XMLConstants.DEFAULT_NS_PREFIX);
+
/** publication id attribute name. */
- public String PUBLICATION_ID_ATTRIB_NAME = "publicationId";
+ public static String PUBLICATION_ID_ATTRIB_NAME = "publicationId";
/**
* Get the publisher.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/PublicationInfo.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/PublicationInfo.java
index bd0d3f7..d2cfcfd 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/PublicationInfo.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/PublicationInfo.java
@@ -20,6 +20,7 @@ package org.opensaml.saml.ext.saml2mdrpi;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -48,13 +49,17 @@ public interface PublicationInfo extends SAMLObject {
new QName(SAMLConstants.SAML20MDRPI_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20MDRPI_PREFIX);
/** publisher attribute name. */
- public String PUBLISHER_ATTRIB_NAME = "publisher";
+ public static String PUBLISHER_ATTRIB_NAME = "publisher";
/** creation attribute name. */
- public String CREATION_INSTANT_ATTRIB_NAME = "creationInstant";
+ public static String CREATION_INSTANT_ATTRIB_NAME = "creationInstant";
+ /** QName of the creation attribute. */
+ public static final QName CREATION_INSTANT_ATTRIB_QNAME =
+ new QName(null, CREATION_INSTANT_ATTRIB_NAME, XMLConstants.DEFAULT_NS_PREFIX);
+
/** publication id attribute name. */
- public String PUBLICATION_ID_ATTRIB_NAME = "publicationId";
+ public static String PUBLICATION_ID_ATTRIB_NAME = "publicationId";
/**
* Get the publisher.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/RegistrationInfo.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/RegistrationInfo.java
index cf6d50a..b9f7044 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/RegistrationInfo.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdrpi/RegistrationInfo.java
@@ -20,6 +20,7 @@ package org.opensaml.saml.ext.saml2mdrpi;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -47,12 +48,16 @@ public interface RegistrationInfo extends SAMLObject {
public static final QName TYPE_NAME =
new QName(SAMLConstants.SAML20MDRPI_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20MDRPI_PREFIX);
- /** Registration Authority attribute name. */
- public String REGISTRATION_AUTHORITY_ATTRIB_NAME = "registrationAuthority";
+ /** registrationAuthority attribute name. */
+ public static String REGISTRATION_AUTHORITY_ATTRIB_NAME = "registrationAuthority";
- /** Registration Instant attribute name. */
- public String REGISTRATION_INSTANT_ATTRIB_NAME = "registrationInstant";
+ /** registrationInstant attribute name. */
+ public static String REGISTRATION_INSTANT_ATTRIB_NAME = "registrationInstant";
+ /** QName of the registrationInstant attribute. */
+ public static final QName REGISTRATION_INSTANT_ATTRIB_QNAME =
+ new QName(null, REGISTRATION_INSTANT_ATTRIB_NAME, XMLConstants.DEFAULT_NS_PREFIX);
+
/**
* Get the registration authority.
*
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Assertion.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Assertion.java
index 01c85af..64e9ecd 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Assertion.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Assertion.java
@@ -22,6 +22,7 @@ import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
@@ -65,6 +66,10 @@ public interface Assertion extends SignableSAMLObject, Evidentiary {
/** Name for the attribute which defines the issue instant. */
@Nonnull @NotEmpty static final String ISSUEINSTANT_ATTRIB_NAME = "IssueInstant";
+ /** QName for the attribute which defines the issue instant. */
+ @Nonnull static final QName ISSUEINSTANT_ATTRIB_QNAME =
+ new QName(null, "IssueInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** Name for the attribute which defines the Issue Instant. */
@Nonnull @NotEmpty static final String ID_ATTRIB_NAME = "AssertionID";
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/AuthenticationStatement.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/AuthenticationStatement.java
index 72d7139..ad09395 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/AuthenticationStatement.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/AuthenticationStatement.java
@@ -20,6 +20,7 @@ package org.opensaml.saml.saml1.core;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -31,105 +32,109 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface AuthenticationStatement extends SAMLObject, SubjectStatement {
/** Element name, no namespace. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AuthenticationStatement";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "AuthenticationStatement";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME =
+ static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML1_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "AuthenticationStatementType";
+ static final String TYPE_LOCAL_NAME = "AuthenticationStatementType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME =
+ static final QName TYPE_NAME =
new QName(SAMLConstants.SAML1_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
/** Name of the AuthenticationMethod attribute. */
- public static final String AUTHENTICATIONMETHOD_ATTRIB_NAME = "AuthenticationMethod";
+ static final String AUTHENTICATIONMETHOD_ATTRIB_NAME = "AuthenticationMethod";
/** Name of the AuthenticationInstant attribute. */
- public static final String AUTHENTICATIONINSTANT_ATTRIB_NAME = "AuthenticationInstant";
+ static final String AUTHENTICATIONINSTANT_ATTRIB_NAME = "AuthenticationInstant";
+
+ /** QName of the AuthenticationInstant attribute. */
+ static final QName AUTHENTICATIONINSTANT_ATTRIB_QNAME =
+ new QName(null, "AuthenticationInstant", XMLConstants.DEFAULT_NS_PREFIX);
/** URI for Kerberos authentication method. */
- public static final String KERBEROS_AUTHN_METHOD = "urn:ietf:rfc:1510";
+ static final String KERBEROS_AUTHN_METHOD = "urn:ietf:rfc:1510";
/** URI for Hardware Token authentication method. */
- public static final String HARDWARE_TOKEN_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:HardwareToken";
+ static final String HARDWARE_TOKEN_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:HardwareToken";
/** URI for Password authentication method. */
- public static final String PASSWORD_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:password";
+ static final String PASSWORD_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:password";
/** URI for X509 Public Key authentication method. */
- public static final String X509_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:X509-PKI";
+ static final String X509_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:X509-PKI";
/** URI for PGP authentication method. */
- public static final String PGP_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:PGP";
+ static final String PGP_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:PGP";
/** URI for SPKI authentication method. */
- public static final String SPKI_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:SPKI";
+ static final String SPKI_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:SPKI";
/** URI for XKMS authentication method. */
- public static final String XKMS_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:XKMS";
+ static final String XKMS_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:XKMS";
/** URI for XML Digital Signature authentication method. */
- public static final String XML_DSIG_AUTHN_METHOD = "urn:ietf:rfc:3075";
+ static final String XML_DSIG_AUTHN_METHOD = "urn:ietf:rfc:3075";
/** URI for Secure Remote Password authentication method. */
- public static final String SRP_AUTHN_METHOD = "urn:ietf:rfc:2945";
+ static final String SRP_AUTHN_METHOD = "urn:ietf:rfc:2945";
/** URI for SSL/TLS Client authentication method. */
- public static final String TLS_CLIENT_AUTHN_METHOD = "urn:ietf:rfc:2246";
+ static final String TLS_CLIENT_AUTHN_METHOD = "urn:ietf:rfc:2246";
/** URI for unspecified authentication method. */
- public static final String UNSPECIFIED_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:unspecified";
+ static final String UNSPECIFIED_AUTHN_METHOD = "urn:oasis:names:tc:SAML:1.0:am:unspecified";
/**
* Return the contents of the AuthenticationMethod attribute.
*
* @return the authentication method
*/
- public String getAuthenticationMethod();
+ String getAuthenticationMethod();
/**
* Set the contents of the AuthenticationMethod attribute.
*
* @param authenticationMethod the authentication method
*/
- public void setAuthenticationMethod(String authenticationMethod);
+ void setAuthenticationMethod(String authenticationMethod);
/**
* Return the contents of the AuthenticationInstant attribute.
*
* @return the authentication instant
*/
- public Instant getAuthenticationInstant();
+ Instant getAuthenticationInstant();
/**
* Set the contents of the AuthenticationInstant attribute.
*
* @param authenticationInstant the authentication instant
*/
- public void setAuthenticationInstant(Instant authenticationInstant);
+ void setAuthenticationInstant(Instant authenticationInstant);
/**
* Get the {@link SubjectLocality}.
*
* @return the {@link SubjectLocality}
*/
- public SubjectLocality getSubjectLocality();
+ SubjectLocality getSubjectLocality();
/**
* Set the {@link SubjectLocality}.
*
* @param subjectLocality the {@link SubjectLocality}
*/
- public void setSubjectLocality(SubjectLocality subjectLocality);
+ void setSubjectLocality(SubjectLocality subjectLocality);
/**
* Get the list of {@link AuthorityBinding}s.
*
* @return the list of {@link AuthorityBinding}s
*/
- public List<AuthorityBinding> getAuthorityBindings();
+ List<AuthorityBinding> getAuthorityBindings();
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Conditions.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Conditions.java
index a37944c..d1c1207 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Conditions.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/Conditions.java
@@ -20,6 +20,7 @@ package org.opensaml.saml.saml1.core;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -31,59 +32,66 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface Conditions extends SAMLObject {
/** Element name, no namespace. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Conditions";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "Conditions";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME =
+ static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML1_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "ConditionsType";
+ static final String TYPE_LOCAL_NAME = "ConditionsType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME =
+ static final QName TYPE_NAME =
new QName(SAMLConstants.SAML1_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
/** Name for the NotBefore attribute. */
- public static final String NOTBEFORE_ATTRIB_NAME = "NotBefore";
+ static final String NOTBEFORE_ATTRIB_NAME = "NotBefore";
- /** Name for the NotBefore attribute. */
- public static final String NOTONORAFTER_ATTRIB_NAME = "NotOnOrAfter";
+ /** QName for the NotBefore attribute. */
+ static final QName NOTBEFORE_ATTRIB_QNAME = new QName(null, "NotBefore", XMLConstants.DEFAULT_NS_PREFIX);
+
+ /** Name for the NotOnOrAfter attribute. */
+ static final String NOTONORAFTER_ATTRIB_NAME = "NotOnOrAfter";
+
+ /** QName for the NotOnOrAfter attribute. */
+ static final QName NOTONORAFTER_ATTRIB_QNAME =
+ new QName(null, "NotOnOrAfter", XMLConstants.DEFAULT_NS_PREFIX);
/**
* Get the "not before" condition.
*
* @return the "not before" condition
*/
- public Instant getNotBefore();
+ Instant getNotBefore();
/**
* Set the "not before" condition.
*
* @param notBefore the "not before" condition
*/
- public void setNotBefore(Instant notBefore);
+ void setNotBefore(Instant notBefore);
/**
* Get the "not on or after" condition.
*
* @return the "not on or after" condition
*/
- public Instant getNotOnOrAfter();
+ Instant getNotOnOrAfter();
/**
* Set the "not on or after" condition.
*
* @param notOnOrAfter the "not on or after" condition
*/
- public void setNotOnOrAfter(Instant notOnOrAfter);
+ void setNotOnOrAfter(Instant notOnOrAfter);
/**
* Get the conditions.
*
* @return the conditions
*/
- public List<Condition> getConditions();
+ List<Condition> getConditions();
/**
* Get the conditions with the given schema type or element name.
@@ -92,19 +100,19 @@ public interface Conditions extends SAMLObject {
*
* @return the matching conditions
*/
- public List<Condition> getConditions(QName typeOrName);
+ List<Condition> getConditions(QName typeOrName);
/**
* Get the audience restriction conditions.
*
* @return the audience restriction conditions
*/
- public List<AudienceRestrictionCondition> getAudienceRestrictionConditions();
+ List<AudienceRestrictionCondition> getAudienceRestrictionConditions();
/**
* Get the "do not cache" conditions.
*
* @return the "do not cache" conditions
*/
- public List<DoNotCacheCondition> getDoNotCacheConditions();
+ List<DoNotCacheCondition> getDoNotCacheConditions();
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/RequestAbstractType.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/RequestAbstractType.java
index f6cf399..30d8497 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/RequestAbstractType.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/RequestAbstractType.java
@@ -24,6 +24,9 @@ package org.opensaml.saml.saml1.core;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.common.SignableSAMLObject;
@@ -32,64 +35,68 @@ import org.opensaml.saml.common.SignableSAMLObject;
*/
public interface RequestAbstractType extends SignableSAMLObject {
- /** Name for the attribute which defines the Major Version (which must be "1". */
- public static final String MAJORVERSION_ATTRIB_NAME = "MajorVersion";
-
- /** Name for the attribute which defines the Minor Version. */
- public static final String MINORVERSION_ATTRIB_NAME = "MinorVersion";
+ /** Name for the attribute which defines the MajorVersion (which must be "1". */
+ static final String MAJORVERSION_ATTRIB_NAME = "MajorVersion";
- /** Name for the attribute which defines the Issue Instant. */
- public static final String ISSUEINSTANT_ATTRIB_NAME = "IssueInstant";
+ /** Name for the attribute which defines the MinorVersion. */
+ static final String MINORVERSION_ATTRIB_NAME = "MinorVersion";
+ /** Name for the attribute which defines the IssueInstant. */
+ static final String ISSUEINSTANT_ATTRIB_NAME = "IssueInstant";
+
+ /** QName for the attribute which defines the IssueInstant. */
+ static final QName ISSUEINSTANT_ATTRIB_QNAME =
+ new QName(null, "IssueInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** Name for the attribute which defines the Issue Instant. */
- public static final String ID_ATTRIB_NAME = "RequestID";
+ static final String ID_ATTRIB_NAME = "RequestID";
/**
* Gets the SAML version of this message.
*
* @return the SAML version of this message
*/
- public SAMLVersion getVersion();
+ SAMLVersion getVersion();
/**
* Sets the SAML version of this message.
*
* @param version SAML version of this message
*/
- public void setVersion(SAMLVersion version);
+ void setVersion(SAMLVersion version);
/**
* Get the issue instant.
*
* @return the issue instant
*/
- public Instant getIssueInstant();
+ Instant getIssueInstant();
/**
* Set the issue instant.
*
* @param date what to set
*/
- public void setIssueInstant(Instant date);
+ void setIssueInstant(Instant date);
/**
* Get the ID.
*
* @return the ID
*/
- public String getID();
+ String getID();
/**
* Set the ID.
*
* @param id what to set
*/
- public void setID(String id);
+ void setID(String id);
/**
* Return the list of RespondWith elements.
*
* @return the list of RespondWith elements
*/
- public List<RespondWith> getRespondWiths();
+ List<RespondWith> getRespondWiths();
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/ResponseAbstractType.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/ResponseAbstractType.java
index d2832c3..473c0c9 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/ResponseAbstractType.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml1/core/ResponseAbstractType.java
@@ -19,6 +19,9 @@ package org.opensaml.saml.saml1.core;
import java.time.Instant;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+
import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.common.SignableSAMLObject;
@@ -28,22 +31,26 @@ import org.opensaml.saml.common.SignableSAMLObject;
public interface ResponseAbstractType extends SignableSAMLObject {
/** Name for the attribute which defines InResponseTo. */
- public static final String INRESPONSETO_ATTRIB_NAME = "InResponseTo";
+ static final String INRESPONSETO_ATTRIB_NAME = "InResponseTo";
- /** Name for the attribute which defines the Major Version (which must be "1". */
- public static final String MAJORVERSION_ATTRIB_NAME = "MajorVersion";
+ /** Name for the attribute which defines the MajorVersion (which must be "1". */
+ static final String MAJORVERSION_ATTRIB_NAME = "MajorVersion";
- /** Name for the attribute which defines the Minor Version. */
- public static final String MINORVERSION_ATTRIB_NAME = "MinorVersion";
+ /** Name for the attribute which defines the MinorVersion. */
+ static final String MINORVERSION_ATTRIB_NAME = "MinorVersion";
- /** Name for the attribute which defines the Issue Instant. */
- public static final String ISSUEINSTANT_ATTRIB_NAME = "IssueInstant";
+ /** Name for the attribute which defines the IssueInstant. */
+ static final String ISSUEINSTANT_ATTRIB_NAME = "IssueInstant";
+ /** QName for the attribute which defines the IssueInstant. */
+ static final QName ISSUEINSTANT_ATTRIB_QNAME =
+ new QName(null, "IssueInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** Name for the attribute which defines the Recipient. */
- public static final String RECIPIENT_ATTRIB_NAME = "Recipient";
+ static final String RECIPIENT_ATTRIB_NAME = "Recipient";
- /** Name for the attribute which defines the Issue Instant. */
- public static final String ID_ATTRIB_NAME = "ResponseID";
+ /** Name for the attribute which defines the ResponseID. */
+ static final String ID_ATTRIB_NAME = "ResponseID";
/**
* Return the InResponseTo (attribute).
@@ -64,50 +71,50 @@ public interface ResponseAbstractType extends SignableSAMLObject {
*
* @return the ID
*/
- public String getID();
+ String getID();
/**
* Set the ID.
*
* @param id what to set
*/
- public void setID(String id);
+ void setID(String id);
/**
* Sets the SAML version for this message.
*
* @return SAML version for this message
*/
- public SAMLVersion getVersion();
+ SAMLVersion getVersion();
/**
* Sets the SAML version for this message.
*
* @param version the SAML version for this message
*/
- public void setVersion(SAMLVersion version);
+ void setVersion(SAMLVersion version);
/**
* Return the Issue Instant (attribute).
*
* @return the IssueInstant
*/
- public Instant getIssueInstant();
+ Instant getIssueInstant();
/** Set the Issue Instant (attribute). *
* @param date what to set
*/
- public void setIssueInstant(Instant date);
+ void setIssueInstant(Instant date);
/**
* Return the Recipient (attribute). .
*
* @return the Recipient
*/
- public String getRecipient();
+ String getRecipient();
/** Set the Recipient (attribute). *
* @param recipient what to set
*/
- public void setRecipient(String recipient);
+ void setRecipient(String recipient);
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/CacheableSAMLObject.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/CacheableSAMLObject.java
index 10b0984..63b1902 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/CacheableSAMLObject.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/CacheableSAMLObject.java
@@ -21,6 +21,8 @@ import java.time.Duration;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -35,6 +37,10 @@ public interface CacheableSAMLObject extends SAMLObject{
/** "cacheDuration" attribute name. */
@Nonnull @NotEmpty static final String CACHE_DURATION_ATTRIB_NAME = "cacheDuration";
+ /** "cacheDuration" attribute QName. */
+ @Nonnull static final QName CACHE_DURATION_ATTRIB_QNAME =
+ new QName(null, "cacheDuration", XMLConstants.DEFAULT_NS_PREFIX);
+
/**
* Gets the maximum time that this descriptor should be cached.
*
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/TimeBoundSAMLObject.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/TimeBoundSAMLObject.java
index a54b7f6..c739056 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/TimeBoundSAMLObject.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/common/TimeBoundSAMLObject.java
@@ -21,6 +21,8 @@ import java.time.Instant;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -35,6 +37,10 @@ public interface TimeBoundSAMLObject extends SAMLObject{
/** "validUntil" attribute's local name. */
@Nonnull @NotEmpty static final String VALID_UNTIL_ATTRIB_NAME = "validUntil";
+ /** "validUntil" attribute's QName. */
+ @Nonnull static final QName VALID_UNTIL_ATTRIB_QNAME =
+ new QName(null, "validUntil", XMLConstants.DEFAULT_NS_PREFIX);
+
/**
* Checks to see if the current time is past the validUntil time.
*
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Assertion.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Assertion.java
index a70e060..fc3fbb3 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Assertion.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Assertion.java
@@ -20,6 +20,8 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
import java.util.List;
+import javax.annotation.Nonnull;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLVersion;
@@ -32,132 +34,136 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface Assertion extends SignableSAMLObject, Evidentiary {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Assertion";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "Assertion";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "AssertionType";
+ static final String TYPE_LOCAL_NAME = "AssertionType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Version attribute name. */
- public static final String VERSION_ATTRIB_NAME = "Version";
+ static final String VERSION_ATTRIB_NAME = "Version";
/** IssueInstant attribute name. */
- public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+ static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+ /** IssueInstant attribute QName. */
+ @Nonnull static final QName ISSUEINSTANT_ATTRIB_QNAME =
+ new QName(null, "IssueInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** ID attribute name. */
- public static final String ID_ATTRIB_NAME = "ID";
+ static final String ID_ATTRIB_NAME = "ID";
/**
* Gets the SAML Version of this assertion.
*
* @return the SAML Version of this assertion.
*/
- public SAMLVersion getVersion();
+ SAMLVersion getVersion();
/**
* Sets the SAML Version of this assertion.
*
* @param newVersion the SAML Version of this assertion
*/
- public void setVersion(SAMLVersion newVersion);
+ void setVersion(SAMLVersion newVersion);
/**
* Gets the issue instance of this assertion.
*
* @return the issue instance of this assertion
*/
- public Instant getIssueInstant();
+ Instant getIssueInstant();
/**
* Sets the issue instance of this assertion.
*
* @param newIssueInstance the issue instance of this assertion
*/
- public void setIssueInstant(Instant newIssueInstance);
+ void setIssueInstant(Instant newIssueInstance);
/**
* Sets the ID of this assertion.
*
* @return the ID of this assertion
*/
- public String getID();
+ String getID();
/**
* Sets the ID of this assertion.
*
* @param newID the ID of this assertion
*/
- public void setID(String newID);
+ void setID(String newID);
/**
* Gets the Issuer of this assertion.
*
* @return the Issuer of this assertion
*/
- public Issuer getIssuer();
+ Issuer getIssuer();
/**
* Sets the Issuer of this assertion.
*
* @param newIssuer the Issuer of this assertion
*/
- public void setIssuer(Issuer newIssuer);
+ void setIssuer(Issuer newIssuer);
/**
* Gets the Subject of this assertion.
*
* @return the Subject of this assertion
*/
- public Subject getSubject();
+ Subject getSubject();
/**
* Sets the Subject of this assertion.
*
* @param newSubject the Subject of this assertion
*/
- public void setSubject(Subject newSubject);
+ void setSubject(Subject newSubject);
/**
* Gets the Conditions placed on this assertion.
*
* @return the Conditions placed on this assertion
*/
- public Conditions getConditions();
+ Conditions getConditions();
/**
* Sets the Conditions placed on this assertion.
*
* @param newConditions the Conditions placed on this assertion
*/
- public void setConditions(Conditions newConditions);
+ void setConditions(Conditions newConditions);
/**
* Gets the Advice for this assertion.
*
* @return the Advice for this assertion
*/
- public Advice getAdvice();
+ Advice getAdvice();
/**
* Sets the Advice for this assertion.
*
* @param newAdvice the Advice for this assertion
*/
- public void setAdvice(Advice newAdvice);
+ void setAdvice(Advice newAdvice);
/**
* Gets the list of statements attached to this assertion.
*
* @return the list of statements attached to this assertion
*/
- public List<Statement> getStatements();
+ List<Statement> getStatements();
/**
* Gets the list of statements attached to this assertion that match a particular QName.
@@ -165,26 +171,26 @@ public interface Assertion extends SignableSAMLObject, Evidentiary {
* @param typeOrName the QName of the statements to return
* @return the list of statements attached to this assertion
*/
- public List<Statement> getStatements(QName typeOrName);
+ List<Statement> getStatements(QName typeOrName);
/**
* Gets the list of AuthnStatements attached to this assertion.
*
* @return the list of AuthnStatements attached to this assertion
*/
- public List<AuthnStatement> getAuthnStatements();
+ List<AuthnStatement> getAuthnStatements();
/**
* Gets the list of AuthzDecisionStatements attached to this assertion.
*
* @return the list of AuthzDecisionStatements attached to this assertion
*/
- public List<AuthzDecisionStatement> getAuthzDecisionStatements();
+ List<AuthzDecisionStatement> getAuthzDecisionStatements();
/**
* Gets the list of AttributeStatement attached to this assertion.
*
* @return the list of AttributeStatement attached to this assertion
*/
- public List<AttributeStatement> getAttributeStatements();
+ List<AttributeStatement> getAttributeStatements();
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/AuthnStatement.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/AuthnStatement.java
index 8fac1ea..82bee0b 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/AuthnStatement.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/AuthnStatement.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.xml.SAMLConstants;
@@ -29,95 +30,103 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface AuthnStatement extends Statement {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AuthnStatement";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "AuthnStatement";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "AuthnStatementType";
+ static final String TYPE_LOCAL_NAME = "AuthnStatementType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** AuthnInstant attribute name. */
- public static final String AUTHN_INSTANT_ATTRIB_NAME = "AuthnInstant";
+ static final String AUTHN_INSTANT_ATTRIB_NAME = "AuthnInstant";
+ /** AuthnInstant attribute QName. */
+ static final QName AUTHN_INSTANT_ATTRIB_QNAME =
+ new QName(null, "AuthnInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** SessionIndex attribute name. */
- public static final String SESSION_INDEX_ATTRIB_NAME = "SessionIndex";
+ static final String SESSION_INDEX_ATTRIB_NAME = "SessionIndex";
/** SessionNoOnOrAfter attribute name. */
- public static final String SESSION_NOT_ON_OR_AFTER_ATTRIB_NAME = "SessionNotOnOrAfter";
+ static final String SESSION_NOT_ON_OR_AFTER_ATTRIB_NAME = "SessionNotOnOrAfter";
+
+ /** SessionNotOnOrAfter attribute QName. */
+ static final QName SESSION_NOT_ON_OR_AFTER_ATTRIB_QNAME =
+ new QName(null, "SessionNotOnOrAfter", XMLConstants.DEFAULT_NS_PREFIX);
/**
* Gets the time when the authentication took place.
*
* @return the time when the authentication took place
*/
- public Instant getAuthnInstant();
+ Instant getAuthnInstant();
/**
* Sets the time when the authentication took place.
*
* @param newAuthnInstant the time when the authentication took place
*/
- public void setAuthnInstant(Instant newAuthnInstant);
+ void setAuthnInstant(Instant newAuthnInstant);
/**
* Get the session index between the principal and the authenticating authority.
*
* @return the session index between the principal and the authenticating authority
*/
- public String getSessionIndex();
+ String getSessionIndex();
/**
* Sets the session index between the principal and the authenticating authority.
*
* @param newIndex the session index between the principal and the authenticating authority
*/
- public void setSessionIndex(String newIndex);
+ void setSessionIndex(String newIndex);
/**
* Get the time when the session between the principal and the SAML authority ends.
*
* @return the time when the session between the principal and the SAML authority ends
*/
- public Instant getSessionNotOnOrAfter();
+ Instant getSessionNotOnOrAfter();
/**
* Set the time when the session between the principal and the SAML authority ends.
*
* @param newSessionNotOnOrAfter the time when the session between the principal and the SAML authority ends
*/
- public void setSessionNotOnOrAfter(Instant newSessionNotOnOrAfter);
+ void setSessionNotOnOrAfter(Instant newSessionNotOnOrAfter);
/**
* Get the DNS domain and IP address of the system where the principal was authenticated.
*
* @return the DNS domain and IP address of the system where the principal was authenticated
*/
- public SubjectLocality getSubjectLocality();
+ SubjectLocality getSubjectLocality();
/**
* Set the DNS domain and IP address of the system where the principal was authenticated.
*
* @param newLocality the DNS domain and IP address of the system where the principal was authenticated
*/
- public void setSubjectLocality(SubjectLocality newLocality);
+ void setSubjectLocality(SubjectLocality newLocality);
/**
* Gets the context used to authenticate the subject.
*
* @return the context used to authenticate the subject
*/
- public AuthnContext getAuthnContext();
+ AuthnContext getAuthnContext();
/**
* Sets the context used to authenticate the subject.
*
* @param newAuthnContext the context used to authenticate the subject
*/
- public void setAuthnContext(AuthnContext newAuthnContext);
+ void setAuthnContext(AuthnContext newAuthnContext);
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Conditions.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Conditions.java
index 73cf19d..a1a32bf 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Conditions.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Conditions.java
@@ -20,6 +20,7 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -31,78 +32,85 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface Conditions extends SAMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Conditions";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "Conditions";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "ConditionsType";
+ static final String TYPE_LOCAL_NAME = "ConditionsType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** NotBefore attribute name. */
- public static final String NOT_BEFORE_ATTRIB_NAME = "NotBefore";
+ static final String NOT_BEFORE_ATTRIB_NAME = "NotBefore";
- /** NotOnOrAfter attribute name. */
- public static final String NOT_ON_OR_AFTER_ATTRIB_NAME = "NotOnOrAfter";
+ /** QName for the NotBefore attribute. */
+ static final QName NOT_BEFORE_ATTRIB_QNAME = new QName(null, "NotBefore", XMLConstants.DEFAULT_NS_PREFIX);
+
+ /** Name for the NotOnOrAfter attribute. */
+ static final String NOT_ON_OR_AFTER_ATTRIB_NAME = "NotOnOrAfter";
+
+ /** QName for the NotOnOrAfter attribute. */
+ static final QName NOT_ON_OR_AFTER_ATTRIB_QNAME =
+ new QName(null, "NotOnOrAfter", XMLConstants.DEFAULT_NS_PREFIX);
/**
* Get the date/time before which the assertion is invalid.
*
* @return the date/time before which the assertion is invalid
*/
- public Instant getNotBefore();
+ Instant getNotBefore();
/**
* Sets the date/time before which the assertion is invalid.
*
* @param newNotBefore the date/time before which the assertion is invalid
*/
- public void setNotBefore(Instant newNotBefore);
+ void setNotBefore(Instant newNotBefore);
/**
* Gets the date/time on, or after, which the assertion is invalid.
*
* @return the date/time on, or after, which the assertion is invalid
*/
- public Instant getNotOnOrAfter();
+ Instant getNotOnOrAfter();
/**
* Sets the date/time on, or after, which the assertion is invalid.
*
* @param newNotOnOrAfter the date/time on, or after, which the assertion is invalid
*/
- public void setNotOnOrAfter(Instant newNotOnOrAfter);
+ void setNotOnOrAfter(Instant newNotOnOrAfter);
/**
* Gets all the conditions on the assertion.
*
* @return all the conditions on the assertion
*/
- public List<Condition> getConditions();
+ List<Condition> getConditions();
/**
* Gets the audience restriction conditions for the assertion.
*
* @return the audience restriction conditions for the assertion
*/
- public List<AudienceRestriction> getAudienceRestrictions();
+ List<AudienceRestriction> getAudienceRestrictions();
/**
* Gets the OneTimeUse condition for the assertion.
*
* @return the OneTimeUse condition for the assertion
*/
- public OneTimeUse getOneTimeUse();
+ OneTimeUse getOneTimeUse();
/**
* Gets the ProxyRestriction condition for the assertion.
*
* @return the ProxyRestriction condition for the assertion
*/
- public ProxyRestriction getProxyRestriction();
+ ProxyRestriction getProxyRestriction();
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/LogoutRequest.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/LogoutRequest.java
index 7645fa6..ee4fdc4 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/LogoutRequest.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/LogoutRequest.java
@@ -23,6 +23,7 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.xml.SAMLConstants;
@@ -33,106 +34,110 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface LogoutRequest extends RequestAbstractType {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "LogoutRequest";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "LogoutRequest";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME =
+ static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "LogoutRequestType";
+ static final String TYPE_LOCAL_NAME = "LogoutRequestType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME =
+ static final QName TYPE_NAME =
new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX);
/** Reason attribute name. */
- public static final String REASON_ATTRIB_NAME = "Reason";
+ static final String REASON_ATTRIB_NAME = "Reason";
/** NotOnOrAfter attribute name. */
- public static final String NOT_ON_OR_AFTER_ATTRIB_NAME = "NotOnOrAfter";
+ static final String NOT_ON_OR_AFTER_ATTRIB_NAME = "NotOnOrAfter";
+ /** QName for the NotOnOrAfter attribute. */
+ static final QName NOT_ON_OR_AFTER_ATTRIB_QNAME =
+ new QName(null, "NotOnOrAfter", XMLConstants.DEFAULT_NS_PREFIX);
+
/** User-initiated logout reason. */
- public static final String USER_REASON = "urn:oasis:names:tc:SAML:2.0:logout:user";
+ static final String USER_REASON = "urn:oasis:names:tc:SAML:2.0:logout:user";
/** Admin-initiated logout reason. */
- public static final String ADMIN_REASON = "urn:oasis:names:tc:SAML:2.0:logout:admin";
+ static final String ADMIN_REASON = "urn:oasis:names:tc:SAML:2.0:logout:admin";
/** Global timeout logout reason. */
- public static final String GLOBAL_TIMEOUT_REASON = "urn:oasis:names:tc:SAML:2.0:logout:global-timeout";
+ static final String GLOBAL_TIMEOUT_REASON = "urn:oasis:names:tc:SAML:2.0:logout:global-timeout";
/** SP timeout logout reason. */
- public static final String SP_TIMEOUT_REASON = "urn:oasis:names:tc:SAML:2.0:logout:sp-timeout";
+ static final String SP_TIMEOUT_REASON = "urn:oasis:names:tc:SAML:2.0:logout:sp-timeout";
/**
* Get the Reason attrib value of the request.
*
* @return the Reason value of the request
*/
- public String getReason();
+ String getReason();
/**
* Set the Reason attrib value of the request.
*
* @param newReason the new Reason value of the request
*/
- public void setReason(String newReason);
+ void setReason(String newReason);
/**
* Get the NotOnOrAfter attrib value of the request.
*
* @return the NotOnOrAfter value of the request
*/
- public Instant getNotOnOrAfter();
+ Instant getNotOnOrAfter();
/**
* Set the NotOnOrAfter attrib value of the request.
*
* @param newNotOnOrAfter the new NotOnOrAfter value of the request
*/
- public void setNotOnOrAfter(Instant newNotOnOrAfter);
+ void setNotOnOrAfter(Instant newNotOnOrAfter);
/**
* Gets the base identifier of the principal for this request.
*
* @return the base identifier of the principal for this request
*/
- public BaseID getBaseID();
+ BaseID getBaseID();
/**
* Sets the base identifier of the principal for this request.
*
* @param newBaseID the base identifier of the principal for this request
*/
- public void setBaseID(BaseID newBaseID);
+ void setBaseID(BaseID newBaseID);
/**
* Gets the name identifier of the principal for this request.
*
* @return the name identifier of the principal for this request
*/
- public NameID getNameID();
+ NameID getNameID();
/**
* Sets the name identifier of the principal for this request.
*
* @param newNameID the name identifier of the principal for this request
*/
- public void setNameID(NameID newNameID);
+ void setNameID(NameID newNameID);
/**
* Gets the encrytped name identifier of the principal for this request.
*
* @return the encrytped name identifier of the principal for this request
*/
- public EncryptedID getEncryptedID();
+ EncryptedID getEncryptedID();
/**
* Sets the encrypted name identifier of the principal for this request.
*
* @param newEncryptedID the new encrypted name identifier of the principal for this request
*/
- public void setEncryptedID(EncryptedID newEncryptedID);
+ void setEncryptedID(EncryptedID newEncryptedID);
/**
* Get the list of SessionIndexes for the request.
@@ -140,7 +145,7 @@ public interface LogoutRequest extends RequestAbstractType {
*
* @return the list of SessionIndexes
*/
- public List<SessionIndex> getSessionIndexes();
+ List<SessionIndex> getSessionIndexes();
}
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequestAbstractType.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequestAbstractType.java
index 41ce1c7..fc05f25 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequestAbstractType.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequestAbstractType.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLVersion;
@@ -31,68 +32,72 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface RequestAbstractType extends SignableSAMLObject {
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "RequestAbstractType";
+ static final String TYPE_LOCAL_NAME = "RequestAbstractType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/** ID attribute name. */
- public static final String ID_ATTRIB_NAME = "ID";
+ static final String ID_ATTRIB_NAME = "ID";
/** Version attribute name. */
- public static final String VERSION_ATTRIB_NAME = "Version";
+ static final String VERSION_ATTRIB_NAME = "Version";
/** IssueInstant attribute name. */
- public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+ static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+ /** QName for the attribute which defines the IssueInstant. */
+ static final QName ISSUE_INSTANT_ATTRIB_QNAME =
+ new QName(null, "IssueInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** Destination attribute name. */
- public static final String DESTINATION_ATTRIB_NAME = "Destination";
+ static final String DESTINATION_ATTRIB_NAME = "Destination";
/** Consent attribute name. */
- public static final String CONSENT_ATTRIB_NAME = "Consent";
+ static final String CONSENT_ATTRIB_NAME = "Consent";
/** Unspecified consent URI. */
- public static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
+ static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
/** Obtained consent URI. */
- public static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
+ static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
/** Prior consent URI. */
- public static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
+ static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
/** Implicit consent URI. */
- public static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
+ static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
/** Explicit consent URI. */
- public static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
+ static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
/** Unavailable consent URI. */
- public static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
+ static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
/** Inapplicable consent URI. */
- public static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
+ static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
/**
* Gets the SAML Version of this request.
*
* @return the SAML Version of this request.
*/
- public SAMLVersion getVersion();
+ SAMLVersion getVersion();
/**
* Sets the SAML Version of this request.
*
* @param newVersion the SAML Version of this request
*/
- public void setVersion(SAMLVersion newVersion);
+ void setVersion(SAMLVersion newVersion);
/**
* Gets the unique identifier of the request.
*
* @return the unique identifier of the request
*/
- public String getID();
+ String getID();
/**
* Sets the unique identifier of the request.
@@ -100,7 +105,7 @@ public interface RequestAbstractType extends SignableSAMLObject {
* @param newID the unique identifier of the request
*/
- public void setID(String newID);
+ void setID(String newID);
/**
* Gets the date/time the request was issued.
@@ -108,69 +113,69 @@ public interface RequestAbstractType extends SignableSAMLObject {
* @return the date/time the request was issued
*/
- public Instant getIssueInstant();
+ Instant getIssueInstant();
/**
* Sets the date/time the request was issued.
*
* @param newIssueInstant the date/time the request was issued
*/
- public void setIssueInstant(Instant newIssueInstant);
+ void setIssueInstant(Instant newIssueInstant);
/**
* Gets the URI of the destination of the request.
*
* @return the URI of the destination of the request
*/
- public String getDestination();
+ String getDestination();
/**
* Sets the URI of the destination of the request.
*
* @param newDestination the URI of the destination of the request
*/
- public void setDestination(String newDestination);
+ void setDestination(String newDestination);
/**
* Gets the consent obtained from the principal for sending this request.
*
* @return the consent obtained from the principal for sending this request
*/
- public String getConsent();
+ String getConsent();
/**
* Sets the consent obtained from the principal for sending this request.
*
* @param newConsent the new consent obtained from the principal for sending this request
*/
- public void setConsent(String newConsent);
+ void setConsent(String newConsent);
/**
* Gets the issuer of this request.
*
* @return the issuer of this request
*/
- public Issuer getIssuer();
+ Issuer getIssuer();
/**
* Sets the issuer of this request.
*
* @param newIssuer the issuer of this request
*/
- public void setIssuer(Issuer newIssuer);
+ void setIssuer(Issuer newIssuer);
/**
* Gets the Extensions of this request.
*
* @return the Status of this request
*/
- public Extensions getExtensions();
+ Extensions getExtensions();
/**
* Sets the Extensions of this request.
*
* @param newExtensions the Extensions of this request
*/
- public void setExtensions(Extensions newExtensions);
+ void setExtensions(Extensions newExtensions);
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/StatusResponseType.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/StatusResponseType.java
index d9ce0fc..c7fae8d 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/StatusResponseType.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/StatusResponseType.java
@@ -23,6 +23,7 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLVersion;
@@ -35,71 +36,75 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface StatusResponseType extends SignableSAMLObject {
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "StatusResponseType";
+ static final String TYPE_LOCAL_NAME = "StatusResponseType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/** ID attribute name. */
- public static final String ID_ATTRIB_NAME = "ID";
+ static final String ID_ATTRIB_NAME = "ID";
/** InResponseTo attribute name. */
- public static final String IN_RESPONSE_TO_ATTRIB_NAME = "InResponseTo";
+ static final String IN_RESPONSE_TO_ATTRIB_NAME = "InResponseTo";
/** Version attribute name. */
- public static final String VERSION_ATTRIB_NAME = "Version";
+ static final String VERSION_ATTRIB_NAME = "Version";
/** IssueInstant attribute name. */
- public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+ static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+ /** QName for the attribute which defines the IssueInstant. */
+ static final QName ISSUE_INSTANT_ATTRIB_QNAME =
+ new QName(null, "IssueInstant", XMLConstants.DEFAULT_NS_PREFIX);
+
/** Destination attribute name. */
- public static final String DESTINATION_ATTRIB_NAME = "Destination";
+ static final String DESTINATION_ATTRIB_NAME = "Destination";
/** Consent attribute name. */
- public static final String CONSENT_ATTRIB_NAME = "Consent";
+ static final String CONSENT_ATTRIB_NAME = "Consent";
/** Unspecified consent URI. */
- public static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
+ static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
/** Obtained consent URI. */
- public static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
+ static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
/** Prior consent URI. */
- public static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
+ static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
/** Implicit consent URI. */
- public static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
+ static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
/** Explicit consent URI. */
- public static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
+ static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
/** Unavailable consent URI. */
- public static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
+ static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
/** Inapplicable consent URI. */
- public static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
+ static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
/**
* Gets the SAML Version of this response.
*
* @return the SAML Version of this response.
*/
- public SAMLVersion getVersion();
+ SAMLVersion getVersion();
/**
* Sets the SAML Version of this response.
*
* @param newVersion the SAML Version of this response
*/
- public void setVersion(SAMLVersion newVersion);
+ void setVersion(SAMLVersion newVersion);
/**
* Gets the unique identifier of the response.
*
* @return the unique identifier of the response
*/
- public String getID();
+ String getID();
/**
* Sets the unique identifier of the response.
@@ -107,14 +112,14 @@ public interface StatusResponseType extends SignableSAMLObject {
* @param newID the unique identifier of the response
*/
- public void setID(String newID);
+ void setID(String newID);
/**
* Gets the unique request identifier for which this is a response.
*
* @return the unique identifier of the originating request
*/
- public String getInResponseTo();
+ String getInResponseTo();
/**
* Sets the unique request identifier for which this is a response.
@@ -122,90 +127,90 @@ public interface StatusResponseType extends SignableSAMLObject {
* @param newInResponseTo the unique identifier of the originating request
*/
- public void setInResponseTo(String newInResponseTo);
+ void setInResponseTo(String newInResponseTo);
/**
* Gets the date/time the response was issued.
*
* @return the date/time the response was issued
*/
- public Instant getIssueInstant();
+ Instant getIssueInstant();
/**
* Sets the date/time the response was issued.
*
* @param newIssueInstant the date/time the response was issued
*/
- public void setIssueInstant(Instant newIssueInstant);
+ void setIssueInstant(Instant newIssueInstant);
/**
* Gets the URI of the destination of the response.
*
* @return the URI of the destination of the response
*/
- public String getDestination();
+ String getDestination();
/**
* Sets the URI of the destination of the response.
*
* @param newDestination the URI of the destination of the response
*/
- public void setDestination(String newDestination);
+ void setDestination(String newDestination);
/**
* Gets the consent obtained from the principal for sending this response.
*
* @return the consent obtained from the principal for sending this response
*/
- public String getConsent();
+ String getConsent();
/**
* Sets the consent obtained from the principal for sending this response.
*
* @param newConsent the consent obtained from the principal for sending this response
*/
- public void setConsent(String newConsent);
+ void setConsent(String newConsent);
/**
* Gets the issuer of this response.
*
* @return the issuer of this response
*/
- public Issuer getIssuer();
+ Issuer getIssuer();
/**
* Sets the issuer of this response.
*
* @param newIssuer the issuer of this response
*/
- public void setIssuer(Issuer newIssuer);
+ void setIssuer(Issuer newIssuer);
/**
* Gets the Status of this response.
*
* @return the Status of this response
*/
- public Status getStatus();
+ Status getStatus();
/**
* Sets the Status of this response.
*
* @param newStatus the Status of this response
*/
- public void setStatus(Status newStatus);
+ void setStatus(Status newStatus);
/**
* Gets the Extensions of this response.
*
* @return the Status of this response
*/
- public Extensions getExtensions();
+ Extensions getExtensions();
/**
* Sets the Extensions of this response.
*
* @param newExtensions the Extensions of this response
*/
- public void setExtensions(Extensions newExtensions);
+ void setExtensions(Extensions newExtensions);
}
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SubjectConfirmationData.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SubjectConfirmationData.java
index 828cb42..ec069c7 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SubjectConfirmationData.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SubjectConfirmationData.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.saml2.core;
import java.time.Instant;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.AttributeExtensibleXMLObject;
@@ -32,101 +33,108 @@ import org.opensaml.saml.common.xml.SAMLConstants;
public interface SubjectConfirmationData extends SAMLObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SubjectConfirmationData";
+ static final String DEFAULT_ELEMENT_LOCAL_NAME = "SubjectConfirmationData";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "SubjectConfirmationDataType";
+ static final String TYPE_LOCAL_NAME = "SubjectConfirmationDataType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** NotBefore attribute name. */
- public static final String NOT_BEFORE_ATTRIB_NAME = "NotBefore";
+ static final String NOT_BEFORE_ATTRIB_NAME = "NotBefore";
- /** NotOnOrAfter attribute name. */
- public static final String NOT_ON_OR_AFTER_ATTRIB_NAME = "NotOnOrAfter";
+ /** QName for the NotBefore attribute. */
+ static final QName NOT_BEFORE_ATTRIB_QNAME = new QName(null, "NotBefore", XMLConstants.DEFAULT_NS_PREFIX);
+
+ /** Name for the NotOnOrAfter attribute. */
+ static final String NOT_ON_OR_AFTER_ATTRIB_NAME = "NotOnOrAfter";
+
+ /** QName for the NotOnOrAfter attribute. */
+ static final QName NOT_ON_OR_AFTER_ATTRIB_QNAME =
+ new QName(null, "NotOnOrAfter", XMLConstants.DEFAULT_NS_PREFIX);
/** Recipient attribute name. */
- public static final String RECIPIENT_ATTRIB_NAME = "Recipient";
+ static final String RECIPIENT_ATTRIB_NAME = "Recipient";
/** InResponseTo attribute name. */
- public static final String IN_RESPONSE_TO_ATTRIB_NAME = "InResponseTo";
+ static final String IN_RESPONSE_TO_ATTRIB_NAME = "InResponseTo";
/** Address attribute name. */
- public static final String ADDRESS_ATTRIB_NAME = "Address";
+ static final String ADDRESS_ATTRIB_NAME = "Address";
/**
* Gets the time before which this subject is not valid.
*
* @return the time before which this subject is not valid
*/
- public Instant getNotBefore();
+ Instant getNotBefore();
/**
* Sets the time before which this subject is not valid.
*
* @param newNotBefore the time before which this subject is not valid
*/
- public void setNotBefore(Instant newNotBefore);
+ void setNotBefore(Instant newNotBefore);
/**
* Gets the time at, or after, which this subject is not valid.
*
* @return the time at, or after, which this subject is not valid
*/
- public Instant getNotOnOrAfter();
+ Instant getNotOnOrAfter();
/**
* Sets the time at, or after, which this subject is not valid.
*
* @param newNotOnOrAfter the time at, or after, which this subject is not valid
*/
- public void setNotOnOrAfter(Instant newNotOnOrAfter);
+ void setNotOnOrAfter(Instant newNotOnOrAfter);
/**
* Gets the recipient of this subject.
*
* @return the recipient of this subject
*/
- public String getRecipient();
+ String getRecipient();
/**
* Sets the recipient of this subject.
*
* @param newRecipient the recipient of this subject
*/
- public void setRecipient(String newRecipient);
+ void setRecipient(String newRecipient);
/**
* Gets the message ID this is in response to.
*
* @return the message ID this is in response to
*/
- public String getInResponseTo();
+ String getInResponseTo();
/**
* Sets the message ID this is in response to.
*
* @param newInResponseTo the message ID this is in response to
*/
- public void setInResponseTo(String newInResponseTo);
+ void setInResponseTo(String newInResponseTo);
/**
* Gets the IP address to which this information may be pressented.
*
* @return the IP address to which this information may be pressented
*/
- public String getAddress();
+ String getAddress();
/**
* Sets the IP address to which this information may be pressented.
*
* @param newAddress the IP address to which this information may be pressented
*/
- public void setAddress(String newAddress);
+ void setAddress(String newAddress);
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java
index f1cb891..8aca49d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java
@@ -20,12 +20,13 @@ package org.opensaml.saml.ext.saml2delrestrict.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.ext.saml2delrestrict.Delegate;
import org.w3c.dom.Element;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* Marshaller for instances of {@link Delegate}.
*/
@@ -36,9 +37,8 @@ public class DelegateMarshaller extends AbstractSAMLObjectMarshaller {
final Delegate delegate = (Delegate) xmlObject;
if (delegate.getDelegationInstant() != null) {
- final String delInstant =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(delegate.getDelegationInstant());
- domElement.setAttributeNS(null, Delegate.DELEGATION_INSTANT_ATTRIB_NAME, delInstant);
+ AttributeSupport.appendDateTimeAttribute(domElement,
+ Delegate.DELEGATION_INSTANT_ATTRIB_QNAME, delegate.getDelegationInstant());
}
if (!Strings.isNullOrEmpty(delegate.getConfirmationMethod())) {
domElement.setAttributeNS(null, Delegate.CONFIRMATION_METHOD_ATTRIB_NAME, delegate.getConfirmationMethod());
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateUnmarshaller.java
index 748c99f..d1af5d8 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.ext.saml2delrestrict.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -28,6 +26,8 @@ import org.opensaml.saml.saml2.core.EncryptedID;
import org.opensaml.saml.saml2.core.NameID;
import org.w3c.dom.Attr;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* Unmarshaller for instances of {@link Delegate}.
*/
@@ -42,7 +42,7 @@ public class DelegateUnmarshaller extends AbstractSAMLObjectUnmarshaller {
if (Delegate.CONFIRMATION_METHOD_ATTRIB_NAME.equals(attrName)) {
delegate.setConfirmationMethod(attribute.getValue());
} else if (Delegate.DELEGATION_INSTANT_ATTRIB_NAME.equals(attrName)) {
- delegate.setDelegationInstant(Instant.parse(attribute.getValue()));
+ delegate.setDelegationInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else {
super.processAttribute(samlObject, attribute);
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java
index a36bb2f..3b22b83 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java
@@ -20,10 +20,11 @@ package org.opensaml.saml.ext.saml2mdrpi.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.ext.saml2mdrpi.PublicationInfo;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A marshaller for {@link PublicationInfo}.
@@ -46,9 +47,8 @@ public class PublicationInfoMarshaller extends AbstractSAMLObjectMarshaller {
if (info.getCreationInstant() != null) {
- final String creationInstant =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(info.getCreationInstant());
- domElement.setAttributeNS(null, PublicationInfo.CREATION_INSTANT_ATTRIB_NAME, creationInstant);
+ AttributeSupport.appendDateTimeAttribute(domElement, PublicationInfo.CREATION_INSTANT_ATTRIB_QNAME,
+ info.getCreationInstant());
}
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoUnmarshaller.java
index 584ef6d..6a896a3 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.ext.saml2mdrpi.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -26,6 +24,8 @@ import org.opensaml.saml.ext.saml2mdrpi.PublicationInfo;
import org.opensaml.saml.ext.saml2mdrpi.UsagePolicy;
import org.w3c.dom.Attr;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* An unmarshaller for {@link PublicationInfo}.
*/
@@ -51,7 +51,7 @@ public class PublicationInfoUnmarshaller extends AbstractSAMLObjectUnmarshaller
if (PublicationInfo.PUBLISHER_ATTRIB_NAME.equals(attribute.getName())) {
info.setPublisher(attribute.getValue());
} else if (PublicationInfo.CREATION_INSTANT_ATTRIB_NAME.equals(attribute.getName())) {
- info.setCreationInstant(Instant.parse(attribute.getValue()));
+ info.setCreationInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (PublicationInfo.PUBLICATION_ID_ATTRIB_NAME.equals(attribute.getName())) {
info.setPublicationId(attribute.getValue());
} else {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java
index a95df2c..90a8b73 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java
@@ -20,10 +20,12 @@ package org.opensaml.saml.ext.saml2mdrpi.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.ext.saml2mdrpi.Publication;
+import org.opensaml.saml.ext.saml2mdrpi.PublicationInfo;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A marshaller for {@link Publication}.
@@ -46,9 +48,8 @@ public class PublicationMarshaller extends AbstractSAMLObjectMarshaller {
if (info.getCreationInstant() != null) {
- final String creationInstant =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(info.getCreationInstant());
- domElement.setAttributeNS(null, Publication.CREATION_INSTANT_ATTRIB_NAME, creationInstant);
+ AttributeSupport.appendDateTimeAttribute(domElement, PublicationInfo.CREATION_INSTANT_ATTRIB_QNAME,
+ info.getCreationInstant());
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java
index 5aaf76b..5554b55 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java
@@ -20,10 +20,11 @@ package org.opensaml.saml.ext.saml2mdrpi.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.ext.saml2mdrpi.RegistrationInfo;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A marshaller for {@link RegistrationInfo}.
@@ -40,9 +41,8 @@ public class RegistrationInfoMarshaller extends AbstractSAMLObjectMarshaller {
}
if (info.getRegistrationInstant() != null) {
- final String registrationInstant =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(info.getRegistrationInstant());
- domElement.setAttributeNS(null, RegistrationInfo.REGISTRATION_INSTANT_ATTRIB_NAME, registrationInstant);
+ AttributeSupport.appendDateTimeAttribute(domElement, RegistrationInfo.REGISTRATION_INSTANT_ATTRIB_QNAME,
+ info.getRegistrationInstant());
}
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoUnmarshaller.java
index 7d496a5..ece883f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.ext.saml2mdrpi.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -26,6 +24,8 @@ import org.opensaml.saml.ext.saml2mdrpi.RegistrationInfo;
import org.opensaml.saml.ext.saml2mdrpi.RegistrationPolicy;
import org.w3c.dom.Attr;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* An unmarshaller for {@link RegistrationInfo}.
*/
@@ -51,7 +51,7 @@ public class RegistrationInfoUnmarshaller extends AbstractSAMLObjectUnmarshaller
if (RegistrationInfo.REGISTRATION_AUTHORITY_ATTRIB_NAME.equals(attribute.getName())) {
info.setRegistrationAuthority(attribute.getValue());
} else if (RegistrationInfo.REGISTRATION_INSTANT_ATTRIB_NAME.equals(attribute.getName())) {
- info.setRegistrationInstant(Instant.parse(attribute.getValue()));
+ info.setRegistrationInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else {
super.processAttribute(samlObject, attribute);
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java
index ea1c80d..3942639 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java
@@ -20,10 +20,11 @@ package org.opensaml.saml.saml1.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml1.core.Assertion;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Assertion} objects.
*/
@@ -47,9 +48,8 @@ public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
}
if (assertion.getIssueInstant() != null) {
- final String date =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(assertion.getIssueInstant());
- domElement.setAttributeNS(null, Assertion.ISSUEINSTANT_ATTRIB_NAME, date);
+ AttributeSupport.appendDateTimeAttribute(domElement, Assertion.ISSUEINSTANT_ATTRIB_QNAME,
+ assertion.getIssueInstant());
}
domElement.setAttributeNS(null, Assertion.MAJORVERSION_ATTRIB_NAME, "1");
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionUnmarshaller.java
index adb120a..5330979 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.saml1.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -33,6 +31,8 @@ import org.w3c.dom.Element;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml1.core.Assertion} objects.
*/
@@ -80,7 +80,7 @@ public class AssertionUnmarshaller extends AbstractSAMLObjectUnmarshaller {
assertion.setIssuer(attribute.getValue());
} else if (Assertion.ISSUEINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- assertion.setIssueInstant(Instant.parse(attribute.getValue()));
+ assertion.setIssueInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (Assertion.MAJORVERSION_ATTRIB_NAME.equals(attribute.getLocalName())) {
final int major;
try {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java
index 4a74838..8c934c4 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java
@@ -19,10 +19,11 @@ package org.opensaml.saml.saml1.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml1.core.AuthenticationStatement;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AuthenticationStatement} objects.
*/
@@ -39,9 +40,9 @@ public class AuthenticationStatementMarshaller extends SubjectStatementMarshalle
}
if (authenticationStatement.getAuthenticationInstant() != null) {
- final String value = SAMLConfigurationSupport.getSAMLDateFormatter().format(
+ AttributeSupport.appendDateTimeAttribute(domElement,
+ AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_QNAME,
authenticationStatement.getAuthenticationInstant());
- domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME, value);
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementUnmarshaller.java
index 305d3be..1804d19 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.saml1.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.saml1.core.AuthenticationStatement;
@@ -28,6 +26,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml1.core.AuthenticationStatement} objects.
*/
@@ -55,7 +55,8 @@ public class AuthenticationStatementUnmarshaller extends SubjectStatementUnmarsh
if (attribute.getNamespaceURI() == null) {
if (AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- authenticationStatement.setAuthenticationInstant(Instant.parse(attribute.getValue()));
+ authenticationStatement.setAuthenticationInstant(
+ DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME.equals(attribute.getLocalName())) {
authenticationStatement.setAuthenticationMethod(attribute.getValue());
} else {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java
index 87f6c53..644dbcb 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java
@@ -20,10 +20,11 @@ package org.opensaml.saml.saml1.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml1.core.Conditions;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Conditions} objects.
*/
@@ -36,13 +37,14 @@ public class ConditionsMarshaller extends AbstractSAMLObjectMarshaller {
final Conditions conditions = (Conditions) samlElement;
if (conditions.getNotBefore() != null) {
- final String date = SAMLConfigurationSupport.getSAMLDateFormatter().format(conditions.getNotBefore());
- domElement.setAttributeNS(null, Conditions.NOTBEFORE_ATTRIB_NAME, date);
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOTBEFORE_ATTRIB_QNAME,
+ conditions.getNotBefore());
}
if (conditions.getNotOnOrAfter() != null) {
- final String date = SAMLConfigurationSupport.getSAMLDateFormatter().format(conditions.getNotOnOrAfter());
- domElement.setAttributeNS(null, Conditions.NOTONORAFTER_ATTRIB_NAME, date);
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOTONORAFTER_ATTRIB_QNAME,
+ conditions.getNotOnOrAfter());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsUnmarshaller.java
index 0655b44..56a6ec2 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.saml1.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -28,6 +26,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml1.core.Conditions} objects.
*/
@@ -53,10 +53,10 @@ public class ConditionsUnmarshaller extends AbstractSAMLObjectUnmarshaller {
if (attribute.getNamespaceURI() == null) {
if (Conditions.NOTBEFORE_ATTRIB_NAME.equals(attribute.getLocalName())
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- conditions.setNotBefore(Instant.parse(attribute.getValue()));
+ conditions.setNotBefore(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (Conditions.NOTONORAFTER_ATTRIB_NAME.equals(attribute.getLocalName())
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- conditions.setNotOnOrAfter(Instant.parse(attribute.getValue()));
+ conditions.setNotOnOrAfter(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else {
super.processAttribute(samlObject, attribute);
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java
index 5617c18..4bf6130 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java
@@ -25,10 +25,11 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.common.SAMLVersion;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml1.core.RequestAbstractType;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.RequestAbstractType} objects.
*/
@@ -47,8 +48,8 @@ public class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller
}
if (request.getIssueInstant() != null) {
- final String date = SAMLConfigurationSupport.getSAMLDateFormatter().format(request.getIssueInstant());
- domElement.setAttributeNS(null, RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME, date);
+ AttributeSupport.appendDateTimeAttribute(domElement, RequestAbstractType.ISSUEINSTANT_ATTRIB_QNAME,
+ request.getIssueInstant());
}
domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME,
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeUnmarshaller.java
index 320fc17..f25e50a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml1.core.impl;
-import java.time.Instant;
-
import javax.annotation.Nonnull;
import org.opensaml.core.xml.XMLObject;
@@ -39,6 +37,8 @@ import org.w3c.dom.Element;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread safe Unmarshaller for {@link org.opensaml.saml.saml1.core.RequestAbstractType} objects.
*/
@@ -81,7 +81,7 @@ public abstract class RequestAbstractTypeUnmarshaller extends AbstractSAMLObject
request.setID(attribute.getValue());
} else if (RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- request.setIssueInstant(Instant.parse(attribute.getValue()));
+ request.setIssueInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(RequestAbstractType.MAJORVERSION_ATTRIB_NAME)) {
final int major;
try {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java
index 7e1711f..b4f680c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java
@@ -25,11 +25,11 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.common.SAMLVersion;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
-import org.opensaml.saml.saml1.core.RequestAbstractType;
import org.opensaml.saml.saml1.core.ResponseAbstractType;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.ResponseAbstractType} objects.
*/
@@ -52,13 +52,13 @@ public abstract class ResponseAbstractTypeMarshaller extends AbstractSAMLObjectM
}
if (response.getIssueInstant() != null) {
- final String date = SAMLConfigurationSupport.getSAMLDateFormatter().format(response.getIssueInstant());
- domElement.setAttributeNS(null, ResponseAbstractType.ISSUEINSTANT_ATTRIB_NAME, date);
+ AttributeSupport.appendDateTimeAttribute(domElement, ResponseAbstractType.ISSUEINSTANT_ATTRIB_QNAME,
+ response.getIssueInstant());
}
- domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME,
+ domElement.setAttributeNS(null, ResponseAbstractType.MAJORVERSION_ATTRIB_NAME,
Integer.toString(response.getVersion().getMajorVersion()));
- domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME,
+ domElement.setAttributeNS(null, ResponseAbstractType.MINORVERSION_ATTRIB_NAME,
Integer.toString(response.getVersion().getMinorVersion()));
if (response.getRecipient() != null) {
@@ -66,4 +66,4 @@ public abstract class ResponseAbstractTypeMarshaller extends AbstractSAMLObjectM
}
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeUnmarshaller.java
index df467f8..49b3c67 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml1.core.impl;
-import java.time.Instant;
-
import javax.annotation.Nonnull;
import org.opensaml.core.xml.XMLObject;
@@ -38,6 +36,8 @@ import org.w3c.dom.Element;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe {@link org.opensaml.core.xml.io.Unmarshaller} for
* {@link org.opensaml.saml.saml1.core.ResponseAbstractType} objects.
@@ -81,7 +81,7 @@ public abstract class ResponseAbstractTypeUnmarshaller extends AbstractSAMLObjec
response.setInResponseTo(attribute.getValue());
} else if (attribute.getLocalName().equals(ResponseAbstractType.ISSUEINSTANT_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- response.setIssueInstant(Instant.parse(attribute.getValue()));
+ response.setIssueInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(ResponseAbstractType.MAJORVERSION_ATTRIB_NAME)) {
final int major;
try {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java
index 47286d4..39843fd 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java
@@ -24,10 +24,11 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.Assertion;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Assertion}.
*/
@@ -43,9 +44,8 @@ public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
}
if (assertion.getIssueInstant() != null) {
- final String issueInstantStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(assertion.getIssueInstant());
- domElement.setAttributeNS(null, Assertion.ISSUE_INSTANT_ATTRIB_NAME, issueInstantStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, Assertion.ISSUEINSTANT_ATTRIB_QNAME,
+ assertion.getIssueInstant());
}
if (assertion.getID() != null) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionUnmarshaller.java
index 03ad2be..ec74bd3 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml2.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -37,6 +35,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.Assertion}.
*/
@@ -73,7 +73,7 @@ public class AssertionUnmarshaller extends AbstractSAMLObjectUnmarshaller {
assertion.setVersion(parseSAMLVersion(attribute));
} else if (attribute.getLocalName().equals(Assertion.ISSUE_INSTANT_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- assertion.setIssueInstant(Instant.parse(attribute.getValue()));
+ assertion.setIssueInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(Assertion.ID_ATTRIB_NAME)) {
assertion.setID(attribute.getValue());
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java
index 5935e6c..007d005 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java
@@ -24,10 +24,11 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.AuthnStatement;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthnStatement}.
*/
@@ -39,9 +40,8 @@ public class AuthnStatementMarshaller extends AbstractSAMLObjectMarshaller {
final AuthnStatement authnStatement = (AuthnStatement) samlObject;
if (authnStatement.getAuthnInstant() != null) {
- final String authnInstantStr = SAMLConfigurationSupport.getSAMLDateFormatter().format(
+ AttributeSupport.appendDateTimeAttribute(domElement, AuthnStatement.AUTHN_INSTANT_ATTRIB_QNAME,
authnStatement.getAuthnInstant());
- domElement.setAttributeNS(null, AuthnStatement.AUTHN_INSTANT_ATTRIB_NAME, authnInstantStr);
}
if (authnStatement.getSessionIndex() != null) {
@@ -49,9 +49,9 @@ public class AuthnStatementMarshaller extends AbstractSAMLObjectMarshaller {
}
if (authnStatement.getSessionNotOnOrAfter() != null) {
- final String sessionNotOnOrAfterStr = SAMLConfigurationSupport.getSAMLDateFormatter().format(
+ AttributeSupport.appendDateTimeAttribute(domElement, AuthnStatement.SESSION_NOT_ON_OR_AFTER_ATTRIB_QNAME,
authnStatement.getSessionNotOnOrAfter());
- domElement.setAttributeNS(null, AuthnStatement.SESSION_NOT_ON_OR_AFTER_ATTRIB_NAME, sessionNotOnOrAfterStr);
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java
index fc926ad..b15a082 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java
@@ -33,6 +33,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.AuthnStatement}.
*/
@@ -58,7 +60,7 @@ public class AuthnStatementUnmarshaller extends AbstractSAMLObjectUnmarshaller {
if (attribute.getNamespaceURI() == null) {
if (attribute.getLocalName().equals(AuthnStatement.AUTHN_INSTANT_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- authnStatement.setAuthnInstant(Instant.parse(attribute.getValue()));
+ authnStatement.setAuthnInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(AuthnStatement.SESSION_INDEX_ATTRIB_NAME)) {
authnStatement.setSessionIndex(attribute.getValue());
} else if (attribute.getLocalName().equals(AuthnStatement.SESSION_NOT_ON_OR_AFTER_ATTRIB_NAME)
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java
index d01c5c7..ad92dd0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java
@@ -24,10 +24,11 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.Conditions;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Conditions} objects.
*/
@@ -39,15 +40,13 @@ public class ConditionsMarshaller extends AbstractSAMLObjectMarshaller {
final Conditions conditions = (Conditions) samlObject;
if (conditions.getNotBefore() != null) {
- final String notBeforeStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(conditions.getNotBefore());
- domElement.setAttributeNS(null, Conditions.NOT_BEFORE_ATTRIB_NAME, notBeforeStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOT_BEFORE_ATTRIB_QNAME,
+ conditions.getNotBefore());
}
if (conditions.getNotOnOrAfter() != null) {
- final String notOnOrAfterStr = SAMLConfigurationSupport.getSAMLDateFormatter().format(
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOT_ON_OR_AFTER_ATTRIB_QNAME,
conditions.getNotOnOrAfter());
- domElement.setAttributeNS(null, Conditions.NOT_ON_OR_AFTER_ATTRIB_NAME, notOnOrAfterStr);
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsUnmarshaller.java
index c0bb991..5e10185 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml2.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -32,6 +30,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.Conditions} objects.
*/
@@ -56,10 +56,10 @@ public class ConditionsUnmarshaller extends AbstractSAMLObjectUnmarshaller {
if (attribute.getNamespaceURI() == null) {
if (attribute.getLocalName().equals(Conditions.NOT_BEFORE_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- conditions.setNotBefore(Instant.parse(attribute.getValue()));
+ conditions.setNotBefore(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(Conditions.NOT_ON_OR_AFTER_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- conditions.setNotOnOrAfter(Instant.parse(attribute.getValue()));
+ conditions.setNotOnOrAfter(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else {
super.processAttribute(samlObject, attribute);
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java
index 19ec256..e4e22f9 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java
@@ -23,10 +23,11 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.LogoutRequest;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.LogoutRequest}.
*/
@@ -42,8 +43,8 @@ public class LogoutRequestMarshaller extends RequestAbstractTypeMarshaller {
}
if (req.getNotOnOrAfter() != null) {
- final String noaStr = SAMLConfigurationSupport.getSAMLDateFormatter().format(req.getNotOnOrAfter());
- domElement.setAttributeNS(null, LogoutRequest.NOT_ON_OR_AFTER_ATTRIB_NAME, noaStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, LogoutRequest.NOT_ON_OR_AFTER_ATTRIB_QNAME,
+ req.getNotOnOrAfter());
}
super.marshallAttributes(samlObject, domElement);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestUnmarshaller.java
index 8b0645e..e87e73a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestUnmarshaller.java
@@ -17,8 +17,6 @@
package org.opensaml.saml.saml2.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.saml2.core.BaseID;
@@ -30,6 +28,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.LogoutRequest} objects.
*/
@@ -62,7 +62,7 @@ public class LogoutRequestUnmarshaller extends RequestAbstractTypeUnmarshaller {
req.setReason(attribute.getValue());
} else if (attribute.getLocalName().equals(LogoutRequest.NOT_ON_OR_AFTER_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- req.setNotOnOrAfter(Instant.parse(attribute.getValue()));
+ req.setNotOnOrAfter(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else {
super.processAttribute(samlObject, attribute);
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java
index 9571c6c..78e6b10 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java
@@ -24,12 +24,13 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.RequestAbstractType;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.RequestAbstractType} objects.
+ * A thread safe Marshaller for {@link RequestAbstractType} objects.
*/
public abstract class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller {
@@ -52,8 +53,8 @@ public abstract class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMa
}
if (req.getIssueInstant() != null) {
- final String iiStr = SAMLConfigurationSupport.getSAMLDateFormatter().format(req.getIssueInstant());
- domElement.setAttributeNS(null, RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, RequestAbstractType.ISSUE_INSTANT_ATTRIB_QNAME,
+ req.getIssueInstant());
}
if (req.getDestination() != null) {
@@ -64,4 +65,5 @@ public abstract class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMa
domElement.setAttributeNS(null, RequestAbstractType.CONSENT_ATTRIB_NAME, req.getConsent());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeUnmarshaller.java
index 9204505..161378a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml2.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -34,6 +32,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.RequestAbstractType} objects.
*/
@@ -67,7 +67,7 @@ public abstract class RequestAbstractTypeUnmarshaller extends AbstractSAMLObject
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
} else if (attribute.getLocalName().equals(RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- req.setIssueInstant(Instant.parse(attribute.getValue()));
+ req.setIssueInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(RequestAbstractType.DESTINATION_ATTRIB_NAME)) {
req.setDestination(attribute.getValue());
} else if (attribute.getLocalName().equals(RequestAbstractType.CONSENT_ATTRIB_NAME)) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java
index 0f9bf96..155de52 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java
@@ -24,12 +24,13 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.StatusResponseType;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.StatusResponseType} objects.
+ * A thread safe Marshaller for {@link StatusResponseType} objects.
*/
public abstract class StatusResponseTypeMarshaller extends AbstractSAMLObjectMarshaller {
@@ -56,8 +57,8 @@ public abstract class StatusResponseTypeMarshaller extends AbstractSAMLObjectMar
}
if (sr.getIssueInstant() != null) {
- final String iiStr = SAMLConfigurationSupport.getSAMLDateFormatter().format(sr.getIssueInstant());
- domElement.setAttributeNS(null, StatusResponseType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, StatusResponseType.ISSUE_INSTANT_ATTRIB_QNAME,
+ sr.getIssueInstant());
}
if (sr.getDestination() != null) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeUnmarshaller.java
index 024077d..2e79311 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml2.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -35,8 +33,10 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.StatusResponseType} objects.
+ * A thread-safe Unmarshaller for {@link StatusResponseType} objects.
*/
public abstract class StatusResponseTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -72,7 +72,7 @@ public abstract class StatusResponseTypeUnmarshaller extends AbstractSAMLObjectU
sr.setInResponseTo(attribute.getValue());
} else if (attribute.getLocalName().equals(StatusResponseType.ISSUE_INSTANT_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- sr.setIssueInstant(Instant.parse(attribute.getValue()));
+ sr.setIssueInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(StatusResponseType.DESTINATION_ATTRIB_NAME)) {
sr.setDestination(attribute.getValue());
} else if (attribute.getLocalName().equals(StatusResponseType.CONSENT_ATTRIB_NAME)) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
index 79979f0..e92e88a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
@@ -24,10 +24,11 @@ package org.opensaml.saml.saml2.core.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.core.SubjectConfirmationData;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.SubjectConfirmationData} objects.
*/
@@ -39,15 +40,13 @@ public class SubjectConfirmationDataMarshaller extends AbstractSAMLObjectMarshal
final SubjectConfirmationData subjectCD = (SubjectConfirmationData) samlObject;
if (subjectCD.getNotBefore() != null) {
- final String notBeforeStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(subjectCD.getNotBefore());
- domElement.setAttributeNS(null, SubjectConfirmationData.NOT_BEFORE_ATTRIB_NAME, notBeforeStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, SubjectConfirmationData.NOT_BEFORE_ATTRIB_QNAME,
+ subjectCD.getNotBefore());
}
if (subjectCD.getNotOnOrAfter() != null) {
- final String notOnOrAfterStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(subjectCD.getNotOnOrAfter());
- domElement.setAttributeNS(null, SubjectConfirmationData.NOT_ON_OR_AFTER_ATTRIB_NAME, notOnOrAfterStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, SubjectConfirmationData.NOT_ON_OR_AFTER_ATTRIB_QNAME,
+ subjectCD.getNotOnOrAfter());
}
if (subjectCD.getRecipient() != null) {
@@ -65,4 +64,5 @@ public class SubjectConfirmationDataMarshaller extends AbstractSAMLObjectMarshal
marshallUnknownAttributes(subjectCD, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataUnmarshaller.java
index a19c730..31a3ad2 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataUnmarshaller.java
@@ -21,8 +21,6 @@
package org.opensaml.saml.saml2.core.impl;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -31,6 +29,8 @@ import org.w3c.dom.Attr;
import com.google.common.base.Strings;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.SubjectConfirmationData} objects.
*/
@@ -53,10 +53,10 @@ public class SubjectConfirmationDataUnmarshaller extends AbstractSAMLObjectUnmar
if (attribute.getNamespaceURI() == null) {
if (attribute.getLocalName().equals(SubjectConfirmationData.NOT_BEFORE_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- subjectCD.setNotBefore(Instant.parse(attribute.getValue()));
+ subjectCD.setNotBefore(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(SubjectConfirmationData.NOT_ON_OR_AFTER_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- subjectCD.setNotOnOrAfter(Instant.parse(attribute.getValue()));
+ subjectCD.setNotOnOrAfter(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(SubjectConfirmationData.RECIPIENT_ATTRIB_NAME)) {
subjectCD.setRecipient(attribute.getValue());
} else if (attribute.getLocalName().equals(SubjectConfirmationData.IN_RESPONSE_TO_ATTRIB_NAME)) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
index 931600a..abd8a4f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
@@ -24,22 +24,18 @@ package org.opensaml.saml.saml2.metadata.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.common.CacheableSAMLObject;
import org.opensaml.saml.saml2.common.TimeBoundSAMLObject;
import org.opensaml.saml.saml2.metadata.AffiliationDescriptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.AffiliationDescriptor} objects.
+ * A thread safe Marshaller for {@link AffiliationDescriptor} objects.
*/
public class AffiliationDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
- /** Class logger. */
- private final Logger log = LoggerFactory.getLogger(AffiliationDescriptorMarshaller.class);
-
/** {@inheritDoc} */
protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
throws MarshallingException {
@@ -58,17 +54,14 @@ public class AffiliationDescriptorMarshaller extends AbstractSAMLObjectMarshalle
// Set the validUntil attribute
if (descriptor.getValidUntil() != null) {
- log.trace("Writing validUntil attribute to AffiliationDescriptor DOM element");
- final String validUntilStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(descriptor.getValidUntil());
- domElement.setAttributeNS(null, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME, validUntilStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
+ descriptor.getValidUntil());
}
// Set the cacheDuration attribute
if (descriptor.getCacheDuration() != null) {
- log.trace("Writing cacheDuration attribute to AffiliationDescriptor DOM element");
- domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME,
- descriptor.getCacheDuration().toString());
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
+ descriptor.getCacheDuration());
}
marshallUnknownAttributes(descriptor, domElement);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorUnmarshaller.java
index 470dbe5..dc69449 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorUnmarshaller.java
@@ -19,8 +19,6 @@ package org.opensaml.saml.saml2.metadata.impl;
import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -70,7 +68,7 @@ public class AffiliationDescriptorUnmarshaller extends AbstractSAMLObjectUnmarsh
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
} else if (attribute.getLocalName().equals(TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- descriptor.setValidUntil(Instant.parse(attribute.getValue()));
+ descriptor.setValidUntil(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME)) {
descriptor.setCacheDuration(DOMTypeSupport.durationToDuration(attribute.getValue()));
} else {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java
index acfdf5c..386eb26 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java
@@ -19,22 +19,18 @@ package org.opensaml.saml.saml2.metadata.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.common.CacheableSAMLObject;
import org.opensaml.saml.saml2.common.TimeBoundSAMLObject;
import org.opensaml.saml.saml2.metadata.EntitiesDescriptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.EntitiesDescriptor} objects.
*/
public class EntitiesDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
- /** Class logger. */
- private final Logger log = LoggerFactory.getLogger(EntitiesDescriptorMarshaller.class);
-
/** {@inheritDoc} */
protected void marshallAttributes(final XMLObject samlElement, final Element domElement) {
@@ -42,29 +38,24 @@ public class EntitiesDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
// Set the ID attribute
if (entitiesDescriptor.getID() != null) {
- log.trace("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.trace("Writing validUntil attribute to EntitiesDescriptor DOM element");
- final String validUntilStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(entitiesDescriptor.getValidUntil());
- domElement.setAttributeNS(null, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME, validUntilStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
+ entitiesDescriptor.getValidUntil());
}
// Set the cacheDuration attribute
if (entitiesDescriptor.getCacheDuration() != null) {
- log.trace("Writing cacheDuration attribute to EntitiesDescriptor DOM element");
- domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME,
- entitiesDescriptor.getCacheDuration().toString());
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
+ entitiesDescriptor.getCacheDuration());
}
// Set the Name attribute
if (entitiesDescriptor.getName() != null) {
- log.trace("Writing Name attribute to EntitiesDescriptor DOM element");
domElement.setAttributeNS(null, EntitiesDescriptor.NAME_ATTRIB_NAME, entitiesDescriptor.getName());
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorUnmarshaller.java
index dde3290..02dc407 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorUnmarshaller.java
@@ -19,8 +19,6 @@ package org.opensaml.saml.saml2.metadata.impl;
import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -67,7 +65,7 @@ public class EntitiesDescriptorUnmarshaller extends AbstractSAMLObjectUnmarshall
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
} else if (attribute.getLocalName().equals(TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- entitiesDescriptor.setValidUntil(Instant.parse(attribute.getValue()));
+ entitiesDescriptor.setValidUntil(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME)) {
entitiesDescriptor.setCacheDuration(DOMTypeSupport.durationToDuration(attribute.getValue()));
} else if (attribute.getLocalName().equals(EntitiesDescriptor.NAME_ATTRIB_NAME)) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
index 7dda570..2c26149 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
@@ -19,22 +19,18 @@ package org.opensaml.saml.saml2.metadata.impl;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.common.CacheableSAMLObject;
import org.opensaml.saml.saml2.common.TimeBoundSAMLObject;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.EntityDescriptor} objects.
+ * A thread safe Marshaller for {@link EntityDescriptor} objects.
*/
public class EntityDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
- /** Class logger. */
- private final Logger log = LoggerFactory.getLogger(EntityDescriptorMarshaller.class);
-
/** {@inheritDoc} */
protected void marshallAttributes(final XMLObject samlElement, final Element domElement) {
final EntityDescriptor entityDescriptor = (EntityDescriptor) samlElement;
@@ -52,17 +48,14 @@ public class EntityDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
// Set the validUntil attribute
if (entityDescriptor.getValidUntil() != null) {
- log.debug("Writing validUntil attribute to EntityDescriptor DOM element");
- final String validUntilStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(entityDescriptor.getValidUntil());
- domElement.setAttributeNS(null, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME, validUntilStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
+ entityDescriptor.getValidUntil());
}
// Set the cacheDuration attribute
if (entityDescriptor.getCacheDuration() != null) {
- log.debug("Writing cacheDuration attribute to EntityDescriptor DOM element");
- domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME,
- entityDescriptor.getCacheDuration().toString());
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
+ entityDescriptor.getCacheDuration());
}
marshallUnknownAttributes(entityDescriptor, domElement);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorUnmarshaller.java
index 56ea909..f4ec21b 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorUnmarshaller.java
@@ -19,8 +19,6 @@ package org.opensaml.saml.saml2.metadata.impl;
import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
-import java.time.Instant;
-
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -79,7 +77,7 @@ public class EntityDescriptorUnmarshaller extends AbstractSAMLObjectUnmarshaller
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
} else if (attribute.getLocalName().equals(TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- entityDescriptor.setValidUntil(Instant.parse(attribute.getValue()));
+ entityDescriptor.setValidUntil(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME)) {
entityDescriptor.setCacheDuration(DOMTypeSupport.durationToDuration(attribute.getValue()));
} else {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
index 1539ce3..34a4b9b 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
@@ -22,22 +22,18 @@ import java.util.List;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml.config.SAMLConfigurationSupport;
import org.opensaml.saml.saml2.common.CacheableSAMLObject;
import org.opensaml.saml.saml2.common.TimeBoundSAMLObject;
import org.opensaml.saml.saml2.metadata.RoleDescriptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
+import net.shibboleth.utilities.java.support.xml.AttributeSupport;
+
/**
* A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.RoleDescriptor} objects.
*/
public abstract class RoleDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
- /** Class logger. */
- private final Logger log = LoggerFactory.getLogger(RoleDescriptorMarshaller.class);
-
/** {@inheritDoc} */
protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
throws MarshallingException {
@@ -45,30 +41,25 @@ public abstract class RoleDescriptorMarshaller extends AbstractSAMLObjectMarshal
// Set the ID attribute
if (roleDescriptor.getID() != null) {
- log.trace("Writing ID attribute to RoleDescriptor DOM element");
domElement.setAttributeNS(null, RoleDescriptor.ID_ATTRIB_NAME, roleDescriptor.getID());
domElement.setIdAttributeNS(null, RoleDescriptor.ID_ATTRIB_NAME, true);
}
// Set the validUntil attribute
if (roleDescriptor.getValidUntil() != null) {
- log.trace("Writing validUntil attribute to RoleDescriptor DOM element");
- final String validUntilStr =
- SAMLConfigurationSupport.getSAMLDateFormatter().format(roleDescriptor.getValidUntil());
- domElement.setAttributeNS(null, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME, validUntilStr);
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
+ roleDescriptor.getValidUntil());
}
// Set the cacheDuration attribute
if (roleDescriptor.getCacheDuration() != null) {
- log.trace("Writing cacheDuration attribute to EntitiesDescriptor DOM element");
- domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME,
- roleDescriptor.getCacheDuration().toString());
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
+ roleDescriptor.getCacheDuration());
}
// Set the protocolSupportEnumeration attribute
final List<String> supportedProtocols = roleDescriptor.getSupportedProtocols();
if (supportedProtocols != null && supportedProtocols.size() > 0) {
- log.trace("Writing protocolSupportEnumberation attribute to RoleDescriptor DOM element");
final StringBuilder builder = new StringBuilder();
for (final String protocol : supportedProtocols) {
@@ -81,7 +72,6 @@ public abstract class RoleDescriptorMarshaller extends AbstractSAMLObjectMarshal
// Set errorURL attribute
if (roleDescriptor.getErrorURL() != null) {
- log.trace("Writing errorURL attribute to RoleDescriptor DOM element");
domElement.setAttributeNS(null, RoleDescriptor.ERROR_URL_ATTRIB_NAME, roleDescriptor.getErrorURL());
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorUnmarshaller.java
index de1ca7a..38dd23f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorUnmarshaller.java
@@ -17,7 +17,6 @@
package org.opensaml.saml.saml2.metadata.impl;
-import java.time.Instant;
import java.util.StringTokenizer;
import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
@@ -72,7 +71,7 @@ public abstract class RoleDescriptorUnmarshaller extends AbstractSAMLObjectUnmar
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
} else if (attribute.getLocalName().equals(TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME)
&& !Strings.isNullOrEmpty(attribute.getValue())) {
- roleDescriptor.setValidUntil(Instant.parse(attribute.getValue()));
+ roleDescriptor.setValidUntil(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
} else if (attribute.getLocalName().equals(CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME)) {
roleDescriptor.setCacheDuration(DOMTypeSupport.durationToDuration(attribute.getValue()));
} else if (attribute.getLocalName().equals(RoleDescriptor.PROTOCOL_ENUMERATION_ATTRIB_NAME)) {
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorOptionalAttributes.xml
index 0ec1987..5f0b8fd 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:AffiliationDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" affiliationOwnerID="urn:example.org" ID="id" cacheDuration="PT1M30S" validUntil="2005-12-07T10:21:00.000Z"/>
+<md:AffiliationDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" affiliationOwnerID="urn:example.org" ID="id" cacheDuration="P0Y0M0DT0H1M30.000S" validUntil="2005-12-07T10:21:00.000Z"/>
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorOptionalAttributes.xml
index 6ae64bf..3b31185 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:AuthnAuthorityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" cacheDuration="PT1M30S" errorURL="http://example.org" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" validUntil="2005-12-07T10:21:00.000Z"/>
+<md:AuthnAuthorityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" cacheDuration="P0Y0M0DT0H1M30.000S" errorURL="http://example.org" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" validUntil="2005-12-07T10:21:00.000Z"/>
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorOptionalAttributes.xml
index 040bcf3..eb84a14 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:EntitiesDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" Name="eDescName" ID="id" cacheDuration="PT1M30S" validUntil="2005-12-07T10:21:00.000Z"/>
+<md:EntitiesDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" Name="eDescName" ID="id" cacheDuration="P0Y0M0DT0H1M30.000S" validUntil="2005-12-07T10:21:00.000Z"/>
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorOptionalAttributes.xml
index d4fcf36..91eccf4 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" cacheDuration="PT1M30S" entityID="99ff33" ID="id" validUntil="2005-12-07T10:21:00.000Z"/>
+<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" cacheDuration="P0Y0M0DT0H1M30.000S" entityID="99ff33" ID="id" validUntil="2005-12-07T10:21:00.000Z"/>
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorOptionalAttributes.xml
index 097abfd..427a7a1 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:IDPSSODescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" protocolSupportEnumeration="urn:foo:bar urn:fooz:baz" WantAuthnRequestsSigned="true" cacheDuration="PT1M30S" validUntil="2005-12-07T10:21:00.000Z" errorURL="http://example.org"/>
+<md:IDPSSODescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" protocolSupportEnumeration="urn:foo:bar urn:fooz:baz" WantAuthnRequestsSigned="true" cacheDuration="P0Y0M0DT0H1M30.000S" validUntil="2005-12-07T10:21:00.000Z" errorURL="http://example.org"/>
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorOptionalAttributes.xml
index 5f68bc0..77f9008 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:PDPDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" protocolSupportEnumeration="urn:foo:bar urn:fooz:baz" cacheDuration="PT1M30S" validUntil="2005-12-07T10:21:00.000Z" errorURL="http://example.org"/>
+<md:PDPDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" protocolSupportEnumeration="urn:foo:bar urn:fooz:baz" cacheDuration="P0Y0M0DT0H1M30.000S" validUntil="2005-12-07T10:21:00.000Z" errorURL="http://example.org"/>
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorOptionalAttributes.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorOptionalAttributes.xml
index 6946b00..03555a0 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorOptionalAttributes.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorOptionalAttributes.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<md:SPSSODescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" protocolSupportEnumeration="urn:foo:bar urn:fooz:baz" cacheDuration="PT1M30S" validUntil="2005-12-07T10:21:00.000Z" AuthnRequestsSigned="true" WantAssertionsSigned="true"/>
+<md:SPSSODescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" protocolSupportEnumeration="urn:foo:bar urn:fooz:baz" cacheDuration="P0Y0M0DT0H1M30.000S" validUntil="2005-12-07T10:21:00.000Z" AuthnRequestsSigned="true" WantAssertionsSigned="true"/>
diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java
index 1fd6de1..c347f51 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java
@@ -18,7 +18,6 @@
package org.opensaml.soap.wssecurity;
import java.time.Instant;
-import java.time.format.DateTimeFormatter;
import javax.xml.namespace.QName;
@@ -53,27 +52,4 @@ public interface AttributedDateTime extends XSString, IdBearing, AttributeExtens
*/
public void setDateTime(Instant dateTime);
- /**
- * Get the {@link DateTimeFormatter} to be used when stringifying
- * the {@link DateTime} value.
- *
- * <p>Defaults to the formatter constructed by calling:
- * <code>ISODateTimeFormat.dateTime().withChronology(ISOChronology.getInstanceUTC()</code>
- * </p>
- *
- * @return the currently configured formatter
- */
- public DateTimeFormatter getDateTimeFormatter();
-
- /**
- * Set the {@link DateTimeFormatter} to be used when stringifying
- * the {@link DateTime} value.
- *
- * <p>Defaults to the formatter constructed by calling:
- * <code>ISODateTimeFormat.dateTime().withChronology(ISOChronology.getInstanceUTC()</code>
- * </p>
- *
- * @param newFormatter the new formatter
- */
- public void setDateTimeFormatter(DateTimeFormatter newFormatter);
}
\ No newline at end of file
diff --git a/opensaml-soap-impl/src/main/java/org/opensaml/soap/wssecurity/impl/AttributedDateTimeImpl.java b/opensaml-soap-impl/src/main/java/org/opensaml/soap/wssecurity/impl/AttributedDateTimeImpl.java
index 486b3f5..62a23c8 100644
--- a/opensaml-soap-impl/src/main/java/org/opensaml/soap/wssecurity/impl/AttributedDateTimeImpl.java
+++ b/opensaml-soap-impl/src/main/java/org/opensaml/soap/wssecurity/impl/AttributedDateTimeImpl.java
@@ -18,21 +18,19 @@
package org.opensaml.soap.wssecurity.impl;
import java.time.Instant;
-import java.time.format.DateTimeFormatter;
import org.opensaml.core.xml.util.AttributeMap;
import org.opensaml.soap.wssecurity.AttributedDateTime;
import org.opensaml.soap.wssecurity.IdBearing;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
/**
* Implementation of {@link AttributedDateTime}.
*
*/
public class AttributedDateTimeImpl extends AbstractWSSecurityObject implements AttributedDateTime {
- /** DateTime formatter. */
- private DateTimeFormatter formatter;
-
/** DateTime object. */
private Instant dateTimeValue;
@@ -55,7 +53,6 @@ public class AttributedDateTimeImpl extends AbstractWSSecurityObject implements
public AttributedDateTimeImpl(final String namespaceURI, final String elementLocalName,
final String namespacePrefix) {
super(namespaceURI, elementLocalName, namespacePrefix);
- formatter = DateTimeFormatter.ISO_INSTANT;
unknownAttributes = new AttributeMap(this);
}
@@ -67,8 +64,7 @@ public class AttributedDateTimeImpl extends AbstractWSSecurityObject implements
/** {@inheritDoc} */
public void setDateTime(final Instant newDateTime) {
dateTimeValue = newDateTime;
- final String formattedDateTime = formatter.format(dateTimeValue);
- stringValue = prepareForAssignment(stringValue, formattedDateTime);
+ stringValue = prepareForAssignment(stringValue, DOMTypeSupport.instantToDateTime(dateTimeValue));
}
/** {@inheritDoc} */
@@ -78,7 +74,7 @@ public class AttributedDateTimeImpl extends AbstractWSSecurityObject implements
/** {@inheritDoc} */
public void setValue(final String newValue) {
- dateTimeValue = Instant.from(formatter.parse(newValue));
+ dateTimeValue = DOMTypeSupport.dateTimeToInstant(newValue);
stringValue = prepareForAssignment(stringValue, newValue);
}
@@ -100,19 +96,4 @@ public class AttributedDateTimeImpl extends AbstractWSSecurityObject implements
return unknownAttributes;
}
- /** {@inheritDoc} */
- public DateTimeFormatter getDateTimeFormatter() {
- return formatter;
- }
-
- /** {@inheritDoc} */
- public void setDateTimeFormatter(final DateTimeFormatter newFormatter) {
- if (newFormatter == null) {
- throw new IllegalArgumentException("The specified DateTimeFormatter may not be null");
- }
- formatter = newFormatter;
- // Explicitly cause the cached string representation to be reformatted when the formatter is changed
- setDateTime(getDateTime());
- }
-
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list