Skip to content

Commit

Permalink
SHIBUI-2271
Browse files Browse the repository at this point in the history
(spot checkin))
  • Loading branch information
chasegawa committed May 2, 2022
1 parent fb4a28d commit 46a3542
Showing 1 changed file with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.common.CacheableSAMLObject;
import org.opensaml.saml.saml2.common.TimeBoundSAMLObject;
import org.opensaml.xmlsec.signature.Signature;
import org.opensaml.xmlsec.signature.SignableXMLObject;
import org.opensaml.xmlsec.signature.Signature;

import javax.annotation.Nullable;
import javax.persistence.CascadeType;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToOne;
import java.time.Duration;
import java.time.Instant;
import java.util.List;


@MappedSuperclass
@EqualsAndHashCode(callSuper = true)
@Audited
Expand All @@ -42,23 +43,27 @@ public boolean isValid() {
}

@Override
public Long getCacheDuration() {
return cacheDuration;
public Duration getCacheDuration() {
return Duration.ofMillis(cacheDuration);
}

@Override
public void setCacheDuration(Long cacheDuration) {
this.cacheDuration = cacheDuration;
public void setCacheDuration(@Nullable final Duration duration) {
if (duration == null) {
cacheDuration = 0l;
} else {
cacheDuration = duration.toMillis();
}
}

@Override
public DateTime getValidUntil() {
return validUntil;
public Instant getValidUntil() {
return Instant.ofEpochMilli(validUntil.getMillis());
}

@Override
public void setValidUntil(DateTime validUntil) {
this.validUntil = validUntil;
public void setValidUntil(Instant validUntilInstant) {
this.validUntil = new DateTime(validUntilInstant.toEpochMilli());
}

@Override
Expand Down Expand Up @@ -102,4 +107,4 @@ public List<XMLObject> getOrderedChildren() {

return null; //TODO ?
}
}
}

0 comments on commit 46a3542

Please sign in to comment.