All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.clustering.session.cache.CompositeImmutableSession Maven / Gradle / Ivy

There is a newer version: 4.0.0.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */
package org.wildfly.clustering.session.cache;

import java.util.Map;

import org.wildfly.clustering.session.ImmutableSessionMetaData;

/**
 * Generic immutable session implementation - independent of cache mapping strategy.
 * @author Paul Ferraro
 */
public class CompositeImmutableSession extends AbstractImmutableSession {

	private final ImmutableSessionMetaData metaData;
	private final Map attributes;

	public CompositeImmutableSession(String id, ImmutableSessionMetaData metaData, Map attributes) {
		super(id);
		this.metaData = metaData;
		this.attributes = attributes;
	}

	@Override
	public boolean isValid() {
		return !this.metaData.isExpired();
	}

	@Override
	public Map getAttributes() {
		return this.attributes;
	}

	@Override
	public ImmutableSessionMetaData getMetaData() {
		return this.metaData;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy