org.wildfly.clustering.web.session.ImmutableSessionMetaData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-web-spi Show documentation
Show all versions of wildfly-clustering-web-spi Show documentation
A set of SPIs for implementing a container-independent distributable HTTP session manager and single sign-on manager for use by a servlet container.
The newest version!
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.web.session;
import java.time.Instant;
import org.wildfly.clustering.ee.expiration.ExpirationMetaData;
/**
* Abstraction for immutable meta information about a web session.
* @author Paul Ferraro
*/
public interface ImmutableSessionMetaData extends ExpirationMetaData {
/**
* Indicates whether or not this session was created by the current thread.
* @return true, if this session is new, false otherwise
*/
default boolean isNew() {
return this.getLastAccessStartTime().equals(this.getLastAccessEndTime());
}
/**
* Returns the time this session was created.
* @return the time this session was created
*/
Instant getCreationTime();
/**
* Returns the start time of the last request to access this session.
* @return the start time of the last request to access this session.
*/
Instant getLastAccessStartTime();
/**
* Returns the start time of the last request to access this session.
* @return the start time of the last request to access this session.
*/
Instant getLastAccessEndTime();
@Override
default Instant getLastAccessTime() {
return this.getLastAccessEndTime();
}
}