代码优化
This commit is contained in:
@@ -53,12 +53,12 @@ public class CasAutoConfiguration implements InitializingBean {
|
||||
RedisConnectionFactory redisConnFactory) {
|
||||
_logger.debug("init casTicketServices.");
|
||||
TicketServices casTicketServices = null;
|
||||
if (persistence == ConstsPersistence.INMEMORY) {
|
||||
casTicketServices = new InMemoryTicketServices();
|
||||
_logger.debug("InMemoryTicketServices");
|
||||
} else if (persistence == ConstsPersistence.REDIS) {
|
||||
if (persistence == ConstsPersistence.REDIS) {
|
||||
casTicketServices = new RedisTicketServices(redisConnFactory);
|
||||
_logger.debug("RedisTicketServices");
|
||||
}else {
|
||||
casTicketServices = new InMemoryTicketServices();
|
||||
_logger.debug("InMemoryTicketServices");
|
||||
}
|
||||
return casTicketServices;
|
||||
}
|
||||
@@ -75,12 +75,12 @@ public class CasAutoConfiguration implements InitializingBean {
|
||||
RedisConnectionFactory redisConnFactory) {
|
||||
_logger.debug("init casTicketGrantingTicketServices.");
|
||||
TicketServices casTicketServices = null;
|
||||
if (persistence == ConstsPersistence.INMEMORY) {
|
||||
casTicketServices = new InMemoryTicketGrantingTicketServices();
|
||||
_logger.debug("InMemoryTicketGrantingTicketServices");
|
||||
} else if (persistence == ConstsPersistence.REDIS) {
|
||||
if (persistence == ConstsPersistence.REDIS) {
|
||||
casTicketServices = new RedisTicketGrantingTicketServices(redisConnFactory);
|
||||
_logger.debug("RedisTicketGrantingTicketServices");
|
||||
}else {
|
||||
casTicketServices = new InMemoryTicketGrantingTicketServices();
|
||||
_logger.debug("InMemoryTicketGrantingTicketServices");
|
||||
}
|
||||
return casTicketServices;
|
||||
}
|
||||
@@ -91,12 +91,12 @@ public class CasAutoConfiguration implements InitializingBean {
|
||||
RedisConnectionFactory redisConnFactory) {
|
||||
_logger.debug("init casTicketGrantingTicketServices.");
|
||||
TicketServices casTicketServices = null;
|
||||
if (persistence == ConstsPersistence.INMEMORY) {
|
||||
casTicketServices = new InMemoryProxyGrantingTicketServices();
|
||||
_logger.debug("InMemoryProxyGrantingTicketServices");
|
||||
} else if (persistence == ConstsPersistence.REDIS) {
|
||||
if (persistence == ConstsPersistence.REDIS) {
|
||||
casTicketServices = new RedisProxyGrantingTicketServices(redisConnFactory);
|
||||
_logger.debug("RedisProxyGrantingTicketServices");
|
||||
}else {
|
||||
casTicketServices = new InMemoryProxyGrantingTicketServices();
|
||||
_logger.debug("InMemoryProxyGrantingTicketServices");
|
||||
}
|
||||
return casTicketServices;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class RemoteTokenServices implements ResourceServerTokenServices {
|
||||
@Override
|
||||
// Ignore 400
|
||||
public void handleError(ClientHttpResponse response) throws IOException {
|
||||
if (response.getRawStatusCode() != 400) {
|
||||
if (response.getStatusCode().value() != 400) {
|
||||
super.handleError(response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,12 +197,12 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
RedisConnectionFactory redisConnFactory) {
|
||||
_logger.debug("OAuth 2 Authorization Code Services init.");
|
||||
AuthorizationCodeServices authorizationCodeServices = null;
|
||||
if (persistence == ConstsPersistence.INMEMORY) {
|
||||
authorizationCodeServices = new InMemoryAuthorizationCodeServices();
|
||||
_logger.debug("InMemoryAuthorizationCodeServices");
|
||||
} else if (persistence == ConstsPersistence.REDIS) {
|
||||
if (persistence == ConstsPersistence.REDIS) {
|
||||
authorizationCodeServices = new RedisAuthorizationCodeServices(redisConnFactory);
|
||||
_logger.debug("RedisAuthorizationCodeServices");
|
||||
}else {
|
||||
authorizationCodeServices = new InMemoryAuthorizationCodeServices();
|
||||
_logger.debug("InMemoryAuthorizationCodeServices");
|
||||
}
|
||||
return authorizationCodeServices;
|
||||
}
|
||||
@@ -218,12 +218,12 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
RedisConnectionFactory redisConnFactory) {
|
||||
_logger.debug("OAuth 2 TokenStore init.");
|
||||
TokenStore tokenStore = null;
|
||||
if (persistence == ConstsPersistence.INMEMORY) {
|
||||
tokenStore = new InMemoryTokenStore();
|
||||
_logger.debug("InMemoryTokenStore");
|
||||
} else if (persistence == ConstsPersistence.REDIS) {
|
||||
if (persistence == ConstsPersistence.REDIS) {
|
||||
tokenStore = new RedisTokenStore(redisConnFactory);
|
||||
_logger.debug("RedisTokenStore");
|
||||
}else {
|
||||
tokenStore = new InMemoryTokenStore();
|
||||
_logger.debug("InMemoryTokenStore");
|
||||
}
|
||||
return tokenStore;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user