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;
}
Aggregations