Add missing @Override

This commit is contained in:
Vedran Pavic
2017-10-27 08:33:45 +02:00
parent 5df555cd53
commit f8583bb02f
49 changed files with 273 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ public class SessionEventRegistry implements ApplicationListener<AbstractSession
private Map<String, AbstractSessionEvent> events = new HashMap<>();
private ConcurrentMap<String, Object> locks = new ConcurrentHashMap<>();
@Override
public void onApplicationEvent(AbstractSessionEvent event) {
String sessionId = event.getSessionId();
this.events.put(sessionId, event);

View File

@@ -94,6 +94,7 @@ public class EnableRedisHttpSessionExpireSessionDestroyedTests<S extends Session
private boolean receivedEvent;
private Object lock;
@Override
public void onApplicationEvent(SessionExpiredEvent event) {
synchronized (this.lock) {
this.receivedEvent = true;

View File

@@ -75,6 +75,7 @@ public class RedisListenerContainerTaskExecutorITests extends AbstractRedisITest
this.executor = executor;
}
@Override
public void execute(Runnable task) {
synchronized (this.lock) {
try {

View File

@@ -212,55 +212,67 @@ public class ReactiveRedisOperationsSessionRepository implements
this.originalSessionId = mapSession.getId();
}
@Override
public String getId() {
return this.cached.getId();
}
@Override
public String changeSessionId() {
return this.cached.changeSessionId();
}
@Override
public <T> T getAttribute(String attributeName) {
return this.cached.getAttribute(attributeName);
}
@Override
public Set<String> getAttributeNames() {
return this.cached.getAttributeNames();
}
@Override
public void setAttribute(String attributeName, Object attributeValue) {
this.cached.setAttribute(attributeName, attributeValue);
putAndFlush(getAttributeKey(attributeName), attributeValue);
}
@Override
public void removeAttribute(String attributeName) {
this.cached.removeAttribute(attributeName);
putAndFlush(getAttributeKey(attributeName), null);
}
@Override
public Instant getCreationTime() {
return this.cached.getCreationTime();
}
@Override
public void setLastAccessedTime(Instant lastAccessedTime) {
this.cached.setLastAccessedTime(lastAccessedTime);
putAndFlush(LAST_ACCESSED_TIME_KEY, getLastAccessedTime().toEpochMilli());
}
@Override
public Instant getLastAccessedTime() {
return this.cached.getLastAccessedTime();
}
@Override
public void setMaxInactiveInterval(Duration interval) {
this.cached.setMaxInactiveInterval(interval);
putAndFlush(MAX_INACTIVE_INTERVAL_KEY,
(int) getMaxInactiveInterval().getSeconds());
}
@Override
public Duration getMaxInactiveInterval() {
return this.cached.getMaxInactiveInterval();
}
@Override
public boolean isExpired() {
return this.cached.isExpired();
}

View File

@@ -295,9 +295,11 @@ public class RedisOperationsSessionRepository implements
private final RedisSessionExpirationPolicy expirationPolicy;
private ApplicationEventPublisher eventPublisher = new ApplicationEventPublisher() {
@Override
public void publishEvent(ApplicationEvent event) {
}
@Override
public void publishEvent(Object event) {
}
};
@@ -389,6 +391,7 @@ public class RedisOperationsSessionRepository implements
return this.sessionRedisOperations;
}
@Override
public void save(RedisSession session) {
session.saveDelta();
if (session.isNew()) {
@@ -403,10 +406,12 @@ public class RedisOperationsSessionRepository implements
this.expirationPolicy.cleanExpiredSessions();
}
@Override
public RedisSession findById(String id) {
return getSession(id, false);
}
@Override
public Map<String, RedisSession> findByIndexNameAndIndexValue(String indexName,
String indexValue) {
if (!PRINCIPAL_NAME_INDEX_NAME.equals(indexName)) {
@@ -468,6 +473,7 @@ public class RedisOperationsSessionRepository implements
return loaded;
}
@Override
public void deleteById(String sessionId) {
RedisSession session = getSession(sessionId, true);
if (session == null) {
@@ -484,6 +490,7 @@ public class RedisOperationsSessionRepository implements
save(session);
}
@Override
public RedisSession createSession() {
RedisSession redisSession = new RedisSession();
if (this.defaultMaxInactiveInterval != null) {
@@ -493,6 +500,7 @@ public class RedisOperationsSessionRepository implements
return redisSession;
}
@Override
@SuppressWarnings("unchecked")
public void onMessage(Message message, byte[] pattern) {
byte[] messageChannel = message.getChannel();
@@ -706,11 +714,13 @@ public class RedisOperationsSessionRepository implements
this.isNew = isNew;
}
@Override
public void setLastAccessedTime(Instant lastAccessedTime) {
this.cached.setLastAccessedTime(lastAccessedTime);
this.putAndFlush(LAST_ACCESSED_ATTR, getLastAccessedTime().toEpochMilli());
}
@Override
public boolean isExpired() {
return this.cached.isExpired();
}
@@ -719,44 +729,54 @@ public class RedisOperationsSessionRepository implements
return this.isNew;
}
@Override
public Instant getCreationTime() {
return this.cached.getCreationTime();
}
@Override
public String getId() {
return this.cached.getId();
}
@Override
public String changeSessionId() {
return this.cached.changeSessionId();
}
@Override
public Instant getLastAccessedTime() {
return this.cached.getLastAccessedTime();
}
@Override
public void setMaxInactiveInterval(Duration interval) {
this.cached.setMaxInactiveInterval(interval);
this.putAndFlush(MAX_INACTIVE_ATTR, (int) getMaxInactiveInterval().getSeconds());
}
@Override
public Duration getMaxInactiveInterval() {
return this.cached.getMaxInactiveInterval();
}
@Override
public <T> T getAttribute(String attributeName) {
return this.cached.getAttribute(attributeName);
}
@Override
public Set<String> getAttributeNames() {
return this.cached.getAttributeNames();
}
@Override
public void setAttribute(String attributeName, Object attributeValue) {
this.cached.setAttribute(attributeName, attributeValue);
this.putAndFlush(getSessionAttrNameKey(attributeName), attributeValue);
}
@Override
public void removeAttribute(String attributeName) {
this.cached.removeAttribute(attributeName);
this.putAndFlush(getSessionAttrNameKey(attributeName), null);

View File

@@ -52,6 +52,7 @@ public class ConfigureNotifyKeyspaceEventsAction implements ConfigureRedisAction
* org.springframework.session.data.redis.config.ConfigureRedisAction#configure(org.
* springframework.data.redis.connection.RedisConnection)
*/
@Override
public void configure(RedisConnection connection) {
String notifyOptions = getNotifyOptions(connection);
String customizedNotifyOptions = notifyOptions;

View File

@@ -198,10 +198,12 @@ public class RedisHttpSessionConfiguration extends SpringHttpSessionConfiguratio
this.redisSubscriptionExecutor = redisSubscriptionExecutor;
}
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
this.embeddedValueResolver = resolver;
}
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
Map<String, Object> enableAttrMap = importMetadata
.getAnnotationAttributes(EnableRedisHttpSession.class.getName());
@@ -257,6 +259,7 @@ public class RedisHttpSessionConfiguration extends SpringHttpSessionConfiguratio
this.configure = configure;
}
@Override
public void afterPropertiesSet() throws Exception {
if (this.configure == ConfigureRedisAction.NO_OP) {
return;

View File

@@ -95,10 +95,12 @@ public class RedisWebSessionConfiguration extends SpringWebSessionConfiguration
this.redisFlushMode = redisFlushMode;
}
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
this.embeddedValueResolver = resolver;
}
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
Map<String, Object> enableAttrMap = importMetadata
.getAnnotationAttributes(EnableRedisWebSession.class.getName());