You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2017/03/22 09:54:16 UTC
svn commit: r1788076 - in
/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml:
SamlAssertionWrapper.java bean/ConditionsBean.java bean/DelegateBean.java
bean/SubjectConfirmationDataBean.java
Author: coheigea
Date: Wed Mar 22 09:54:16 2017
New Revision: 1788076
URL: http://svn.apache.org/viewvc?rev=1788076&view=rev
Log:
Use Instant in SAML beans
Modified:
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/ConditionsBean.java
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/DelegateBean.java
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/SubjectConfirmationDataBean.java
Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java?rev=1788076&r1=1788075&r2=1788076&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java Wed Mar 22 09:54:16 2017
@@ -263,7 +263,7 @@ public class SamlAssertionWrapper {
validFrom = getSaml1().getConditions().getNotBefore();
}
- // Now convert to a Java ZonedDateTime Object
+ // Now convert to a Java Instant Object
if (validFrom != null) {
return validFrom.toDate().toInstant();
}
@@ -278,7 +278,7 @@ public class SamlAssertionWrapper {
validTill = getSaml1().getConditions().getNotOnOrAfter();
}
- // Now convert to a Java ZonedDateTime Object
+ // Now convert to a Java Instant Object
if (validTill != null) {
return validTill.toDate().toInstant();
}
Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/ConditionsBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/ConditionsBean.java?rev=1788076&r1=1788075&r2=1788076&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/ConditionsBean.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/ConditionsBean.java Wed Mar 22 09:54:16 2017
@@ -19,7 +19,7 @@
package org.apache.wss4j.common.saml.bean;
-import java.time.ZonedDateTime;
+import java.time.Instant;
import java.util.Date;
import java.util.List;
@@ -66,14 +66,14 @@ public class ConditionsBean {
* @param notAfter The notAfter instance
*/
public ConditionsBean(
- ZonedDateTime notBefore,
- ZonedDateTime notAfter
+ Instant notBefore,
+ Instant notAfter
) {
if (notBefore != null) {
- this.notBefore = new DateTime(Date.from(notBefore.toInstant()));
+ this.notBefore = new DateTime(Date.from(notBefore));
}
if (notAfter != null) {
- this.notAfter = new DateTime(Date.from(notAfter.toInstant()));
+ this.notAfter = new DateTime(Date.from(notAfter));
}
}
@@ -111,9 +111,9 @@ public class ConditionsBean {
*
* @param notBefore the notBefore instance to set
*/
- public void setNotBefore(ZonedDateTime notBefore) {
+ public void setNotBefore(Instant notBefore) {
if (notBefore != null) {
- this.notBefore = new DateTime(Date.from(notBefore.toInstant()));
+ this.notBefore = new DateTime(Date.from(notBefore));
} else {
this.notBefore = null;
}
@@ -142,9 +142,9 @@ public class ConditionsBean {
*
* @param notAfter the notAfter instance to set
*/
- public void setNotAfter(ZonedDateTime notAfter) {
+ public void setNotAfter(Instant notAfter) {
if (notAfter != null) {
- this.notAfter = new DateTime(Date.from(notAfter.toInstant()));
+ this.notAfter = new DateTime(Date.from(notAfter));
} else {
this.notAfter = null;
}
Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/DelegateBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/DelegateBean.java?rev=1788076&r1=1788075&r2=1788076&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/DelegateBean.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/DelegateBean.java Wed Mar 22 09:54:16 2017
@@ -19,7 +19,7 @@
package org.apache.wss4j.common.saml.bean;
-import java.time.ZonedDateTime;
+import java.time.Instant;
import java.util.Date;
import org.joda.time.DateTime;
@@ -44,9 +44,9 @@ public class DelegateBean {
this.delegationInstant = delegationInstant;
}
- public void setDelegationInstant(ZonedDateTime delegationInstant) {
+ public void setDelegationInstant(Instant delegationInstant) {
if (delegationInstant != null) {
- this.delegationInstant = new DateTime(Date.from(delegationInstant.toInstant()));
+ this.delegationInstant = new DateTime(Date.from(delegationInstant));
} else {
this.delegationInstant = null;
}
Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/SubjectConfirmationDataBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/SubjectConfirmationDataBean.java?rev=1788076&r1=1788075&r2=1788076&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/SubjectConfirmationDataBean.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/SubjectConfirmationDataBean.java Wed Mar 22 09:54:16 2017
@@ -19,7 +19,7 @@
package org.apache.wss4j.common.saml.bean;
-import java.time.ZonedDateTime;
+import java.time.Instant;
import java.util.Date;
import org.joda.time.DateTime;
@@ -110,9 +110,9 @@ public class SubjectConfirmationDataBean
*
* @param notBefore the notBefore instance to set
*/
- public void setNotBefore(ZonedDateTime notBefore) {
+ public void setNotBefore(Instant notBefore) {
if (notBefore != null) {
- this.notBefore = new DateTime(Date.from(notBefore.toInstant()));
+ this.notBefore = new DateTime(Date.from(notBefore));
} else {
this.notBefore = null;
}
@@ -139,9 +139,9 @@ public class SubjectConfirmationDataBean
*
* @param notAfter the notAfter instance to set
*/
- public void setNotAfter(ZonedDateTime notAfter) {
+ public void setNotAfter(Instant notAfter) {
if (notAfter != null) {
- this.notAfter = new DateTime(Date.from(notAfter.toInstant()));
+ this.notAfter = new DateTime(Date.from(notAfter));
} else {
this.notAfter = null;
}