Removed more references to InitializingBean

pull/419/merge
Amanda Anganes 2013-07-18 11:18:48 -04:00
parent 88db457fc4
commit 96e3f66a81
5 changed files with 15 additions and 33 deletions

View File

@ -20,7 +20,6 @@ import java.util.Collection;
import org.mitre.openid.connect.model.OIDCAuthenticationToken; import org.mitre.openid.connect.model.OIDCAuthenticationToken;
import org.mitre.openid.connect.model.UserInfo; import org.mitre.openid.connect.model.UserInfo;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
@ -35,22 +34,12 @@ import com.google.common.collect.Lists;
* *
*/ */
public class OIDCAuthenticationProvider implements public class OIDCAuthenticationProvider implements
AuthenticationProvider, InitializingBean { AuthenticationProvider {
private UserInfoFetcher userInfoFetcher = new UserInfoFetcher(); private UserInfoFetcher userInfoFetcher = new UserInfoFetcher();
private GrantedAuthoritiesMapper authoritiesMapper = new NamedAdminAuthoritiesMapper(); private GrantedAuthoritiesMapper authoritiesMapper = new NamedAdminAuthoritiesMapper();
/*
* (non-Javadoc)
*
* @see
* org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws Exception {
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View File

@ -21,10 +21,11 @@ package org.mitre.openid.connect.client.service.impl;
import java.util.Map; import java.util.Map;
import javax.annotation.PostConstruct;
import org.mitre.oauth2.model.RegisteredClient; import org.mitre.oauth2.model.RegisteredClient;
import org.mitre.openid.connect.client.service.ClientConfigurationService; import org.mitre.openid.connect.client.service.ClientConfigurationService;
import org.mitre.openid.connect.config.ServerConfiguration; import org.mitre.openid.connect.config.ServerConfiguration;
import org.springframework.beans.factory.InitializingBean;
/** /**
* Client configuration service that holds a static map from issuer URL to a ClientDetails object to use at that issuer. * Client configuration service that holds a static map from issuer URL to a ClientDetails object to use at that issuer.
@ -34,7 +35,7 @@ import org.springframework.beans.factory.InitializingBean;
* @author jricher * @author jricher
* *
*/ */
public class StaticClientConfigurationService implements ClientConfigurationService, InitializingBean { public class StaticClientConfigurationService implements ClientConfigurationService {
// Map of issuer URL -> client configuration information // Map of issuer URL -> client configuration information
private Map<String, RegisteredClient> clients; private Map<String, RegisteredClient> clients;
@ -64,10 +65,7 @@ public class StaticClientConfigurationService implements ClientConfigurationServ
return clients.get(issuer.getIssuer()); return clients.get(issuer.getIssuer());
} }
/* (non-Javadoc) @PostConstruct
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (clients == null || clients.isEmpty()) { if (clients == null || clients.isEmpty()) {
throw new IllegalArgumentException("Clients map cannot be null or empty"); throw new IllegalArgumentException("Clients map cannot be null or empty");

View File

@ -21,9 +21,10 @@ package org.mitre.openid.connect.client.service.impl;
import java.util.Map; import java.util.Map;
import javax.annotation.PostConstruct;
import org.mitre.openid.connect.client.service.ServerConfigurationService; import org.mitre.openid.connect.client.service.ServerConfigurationService;
import org.mitre.openid.connect.config.ServerConfiguration; import org.mitre.openid.connect.config.ServerConfiguration;
import org.springframework.beans.factory.InitializingBean;
/** /**
* Statically configured server configuration service that maps issuer URLs to server configurations to use at that issuer. * Statically configured server configuration service that maps issuer URLs to server configurations to use at that issuer.
@ -31,7 +32,7 @@ import org.springframework.beans.factory.InitializingBean;
* @author jricher * @author jricher
* *
*/ */
public class StaticServerConfigurationService implements ServerConfigurationService, InitializingBean { public class StaticServerConfigurationService implements ServerConfigurationService {
// map of issuer url -> server configuration information // map of issuer url -> server configuration information
private Map<String, ServerConfiguration> servers; private Map<String, ServerConfiguration> servers;
@ -58,10 +59,7 @@ public class StaticServerConfigurationService implements ServerConfigurationServ
return servers.get(issuer); return servers.get(issuer);
} }
/* (non-Javadoc) @PostConstruct
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (servers == null || servers.isEmpty()) { if (servers == null || servers.isEmpty()) {
throw new IllegalArgumentException("Servers map cannot be null or empty."); throw new IllegalArgumentException("Servers map cannot be null or empty.");

View File

@ -19,11 +19,11 @@
*/ */
package org.mitre.openid.connect.client.service.impl; package org.mitre.openid.connect.client.service.impl;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.mitre.openid.connect.client.model.IssuerServiceResponse; import org.mitre.openid.connect.client.model.IssuerServiceResponse;
import org.mitre.openid.connect.client.service.IssuerService; import org.mitre.openid.connect.client.service.IssuerService;
import org.springframework.beans.factory.InitializingBean;
import com.google.common.base.Strings; import com.google.common.base.Strings;
@ -31,7 +31,7 @@ import com.google.common.base.Strings;
* @author jricher * @author jricher
* *
*/ */
public class StaticSingleIssuerService implements IssuerService, InitializingBean { public class StaticSingleIssuerService implements IssuerService {
private String issuer; private String issuer;
@ -59,10 +59,7 @@ public class StaticSingleIssuerService implements IssuerService, InitializingBea
return new IssuerServiceResponse(getIssuer(), null, null); return new IssuerServiceResponse(getIssuer(), null, null);
} }
/* (non-Javadoc) @PostConstruct
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (Strings.isNullOrEmpty(issuer)) { if (Strings.isNullOrEmpty(issuer)) {

View File

@ -23,12 +23,12 @@ import java.net.URISyntaxException;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.http.client.utils.URIBuilder; import org.apache.http.client.utils.URIBuilder;
import org.mitre.openid.connect.client.model.IssuerServiceResponse; import org.mitre.openid.connect.client.model.IssuerServiceResponse;
import org.mitre.openid.connect.client.service.IssuerService; import org.mitre.openid.connect.client.service.IssuerService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.authentication.AuthenticationServiceException; import org.springframework.security.authentication.AuthenticationServiceException;
import com.google.common.base.Strings; import com.google.common.base.Strings;
@ -40,7 +40,7 @@ import com.google.common.base.Strings;
* @author jricher * @author jricher
* *
*/ */
public class ThirdPartyIssuerService implements IssuerService, InitializingBean { public class ThirdPartyIssuerService implements IssuerService {
private String accountChooserUrl; private String accountChooserUrl;
@ -130,7 +130,7 @@ public class ThirdPartyIssuerService implements IssuerService, InitializingBean
/* (non-Javadoc) /* (non-Javadoc)
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/ */
@Override @PostConstruct
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (Strings.isNullOrEmpty(this.accountChooserUrl)) { if (Strings.isNullOrEmpty(this.accountChooserUrl)) {
throw new IllegalArgumentException("Account Chooser URL cannot be null or empty"); throw new IllegalArgumentException("Account Chooser URL cannot be null or empty");