Revert "SessionRepository.save returns S"

See gh-809
This commit is contained in:
Vedran Pavic
2017-06-23 18:48:30 +02:00
parent c6c6beb40c
commit b321ff02f0
5 changed files with 5 additions and 9 deletions

View File

@@ -76,9 +76,8 @@ public class MapSessionRepository implements SessionRepository<Session> {
this.defaultMaxInactiveInterval = Integer.valueOf(defaultMaxInactiveInterval); this.defaultMaxInactiveInterval = Integer.valueOf(defaultMaxInactiveInterval);
} }
public Session save(Session session) { public void save(Session session) {
this.sessions.put(session.getId(), new MapSession(session)); this.sessions.put(session.getId(), new MapSession(session));
return session;
} }
public Session findById(String id) { public Session findById(String id) {

View File

@@ -52,7 +52,7 @@ public interface SessionRepository<S extends Session> {
* *
* @param session the {@link Session} to save * @param session the {@link Session} to save
*/ */
S save(S session); void save(S session);
/** /**
* Gets the {@link Session} by the {@link Session#getId()} or null if no * Gets the {@link Session} by the {@link Session#getId()} or null if no

View File

@@ -386,14 +386,13 @@ public class RedisOperationsSessionRepository implements
this.redisFlushMode = redisFlushMode; this.redisFlushMode = redisFlushMode;
} }
public RedisSession save(RedisSession session) { public void save(RedisSession session) {
session.saveDelta(); session.saveDelta();
if (session.isNew()) { if (session.isNew()) {
String sessionCreatedKey = getSessionCreatedChannel(session.getId()); String sessionCreatedKey = getSessionCreatedChannel(session.getId());
this.sessionRedisOperations.convertAndSend(sessionCreatedKey, session.delta); this.sessionRedisOperations.convertAndSend(sessionCreatedKey, session.delta);
session.setNew(false); session.setNew(false);
} }
return session;
} }
@Scheduled(cron = "${spring.session.cleanup.cron.expression:0 * * * * *}") @Scheduled(cron = "${spring.session.cleanup.cron.expression:0 * * * * *}")

View File

@@ -202,13 +202,12 @@ public class HazelcastSessionRepository implements
return result; return result;
} }
public HazelcastSession save(HazelcastSession session) { public void save(HazelcastSession session) {
if (session.isChanged()) { if (session.isChanged()) {
this.sessions.put(session.getId(), session.getDelegate(), this.sessions.put(session.getId(), session.getDelegate(),
session.getMaxInactiveInterval().getSeconds(), TimeUnit.SECONDS); session.getMaxInactiveInterval().getSeconds(), TimeUnit.SECONDS);
session.markUnchanged(); session.markUnchanged();
} }
return session;
} }
public HazelcastSession findById(String id) { public HazelcastSession findById(String id) {

View File

@@ -371,7 +371,7 @@ public class JdbcOperationsSessionRepository implements
return session; return session;
} }
public JdbcSession save(final JdbcSession session) { public void save(final JdbcSession session) {
if (session.isNew()) { if (session.isNew()) {
this.transactionOperations.execute(new TransactionCallbackWithoutResult() { this.transactionOperations.execute(new TransactionCallbackWithoutResult() {
@@ -458,7 +458,6 @@ public class JdbcOperationsSessionRepository implements
}); });
} }
session.clearChangeFlags(); session.clearChangeFlags();
return session;
} }
public JdbcSession findById(final String id) { public JdbcSession findById(final String id) {