Search in sources :

Example 1 with ProtoFactory

use of org.infinispan.protostream.annotations.ProtoFactory in project infinispan by infinispan.

the class MapSessionProtoAdapter method createSession.

@ProtoFactory
static MapSession createSession(String id, String originalId, Collection<SessionAttribute> attributes, Instant creationTime, Instant lastAccessedTime, long maxInactiveSeconds) {
    MapSession session = new MapSession(originalId);
    session.setId(id);
    session.setCreationTime(creationTime);
    session.setLastAccessedTime(lastAccessedTime);
    session.setMaxInactiveInterval(Duration.ofSeconds(maxInactiveSeconds));
    for (SessionAttribute attribute : attributes) {
        session.setAttribute(attribute.getName(), attribute.getValue());
    }
    return session;
}
Also used : MapSession(org.springframework.session.MapSession) ProtoFactory(org.infinispan.protostream.annotations.ProtoFactory)

Aggregations

ProtoFactory (org.infinispan.protostream.annotations.ProtoFactory)1 MapSession (org.springframework.session.MapSession)1