diff --git a/assembly.xml b/assembly.xml index 26f7cab..f640d7a 100644 --- a/assembly.xml +++ b/assembly.xml @@ -5,20 +5,19 @@ for additional information regarding copyright ownership. Jasig licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a - copy of the License at: + except in compliance with the License. You may obtain a + copy of the License at the following location: - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on - an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - release diff --git a/cas-client-core/pom.xml b/cas-client-core/pom.xml index 752b4bf..8a13a67 100644 --- a/cas-client-core/pom.xml +++ b/cas-client-core/pom.xml @@ -27,6 +27,12 @@ ${opensaml.version} jar compile + + + org.slf4j + jcl-over-slf4j + + @@ -56,6 +62,12 @@ spring-core ${spring.version} test + + + commons-logging + commons-logging + + @@ -88,7 +100,7 @@ - 2.5.6.SEC01 + 3.1.3.RELEASE 2.5.1-1 diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipal.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipal.java index d17c97f..b86ebcb 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipal.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipal.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import java.io.Serializable; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipalImpl.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipalImpl.java index e93978b..c7ca08f 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipalImpl.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AttributePrincipalImpl.java @@ -1,28 +1,27 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.proxy.ProxyRetriever; import org.jasig.cas.client.util.CommonUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Collections; import java.util.Map; @@ -35,8 +34,8 @@ import java.util.Map; * @since 3.1 */ public class AttributePrincipalImpl extends SimplePrincipal implements AttributePrincipal { - - private static final Log LOG = LogFactory.getLog(AttributePrincipalImpl.class); + + private static final Logger LOGGER = LoggerFactory.getLogger(AttributePrincipalImpl.class); /** Unique Id for Serialization */ private static final long serialVersionUID = -1443182634624927187L; @@ -106,7 +105,7 @@ public class AttributePrincipalImpl extends SimplePrincipal implements Attribute return this.proxyRetriever.getProxyTicketIdFor(this.proxyGrantingTicket, service); } - LOG.debug("No ProxyGrantingTicket was supplied, so no Proxy Ticket can be retrieved."); + LOGGER.debug("No ProxyGrantingTicket was supplied, so no Proxy Ticket can be retrieved."); return null; } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AuthenticationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AuthenticationFilter.java index 67f3633..3ff1896 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AuthenticationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AuthenticationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import org.jasig.cas.client.util.AbstractCasFilter; @@ -73,11 +72,11 @@ public class AuthenticationFilter extends AbstractCasFilter { if (!isIgnoreInitConfiguration()) { super.initInternal(filterConfig); setCasServerLoginUrl(getPropertyFromInitParams(filterConfig, "casServerLoginUrl", null)); - log.trace("Loaded CasServerLoginUrl parameter: " + this.casServerLoginUrl); + logger.trace("Loaded CasServerLoginUrl parameter: {}", this.casServerLoginUrl); setRenew(parseBoolean(getPropertyFromInitParams(filterConfig, "renew", "false"))); - log.trace("Loaded renew parameter: " + this.renew); + logger.trace("Loaded renew parameter: {}", this.renew); setGateway(parseBoolean(getPropertyFromInitParams(filterConfig, "gateway", "false"))); - log.trace("Loaded gateway parameter: " + this.gateway); + logger.trace("Loaded gateway parameter: {}", this.gateway); final String gatewayStorageClass = getPropertyFromInitParams(filterConfig, "gatewayStorageClass", null); @@ -85,7 +84,7 @@ public class AuthenticationFilter extends AbstractCasFilter { try { this.gatewayStorage = (GatewayResolver) Class.forName(gatewayStorageClass).newInstance(); } catch (final Exception e) { - log.error(e,e); + logger.error(e.getMessage(),e); throw new ServletException(e); } } @@ -119,23 +118,19 @@ public class AuthenticationFilter extends AbstractCasFilter { final String modifiedServiceUrl; - log.debug("no ticket and no assertion found"); + logger.debug("no ticket and no assertion found"); if (this.gateway) { - log.debug("setting gateway attribute in session"); + logger.debug("setting gateway attribute in session"); modifiedServiceUrl = this.gatewayStorage.storeGatewayInformation(request, serviceUrl); } else { modifiedServiceUrl = serviceUrl; } - if (log.isDebugEnabled()) { - log.debug("Constructed service url: " + modifiedServiceUrl); - } + logger.debug("Constructed service url: {}", modifiedServiceUrl); final String urlToRedirectTo = CommonUtils.constructRedirectUrl(this.casServerLoginUrl, getServiceParameterName(), modifiedServiceUrl, this.renew, this.gateway); - if (log.isDebugEnabled()) { - log.debug("redirecting to \"" + urlToRedirectTo + "\""); - } + logger.debug("redirecting to \"{}\"", urlToRedirectTo); response.sendRedirect(urlToRedirectTo); } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/DefaultGatewayResolverImpl.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/DefaultGatewayResolverImpl.java index 7b36369..0844afc 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/DefaultGatewayResolverImpl.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/DefaultGatewayResolverImpl.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import javax.servlet.http.HttpServletRequest; @@ -26,8 +25,7 @@ public final class DefaultGatewayResolverImpl implements GatewayResolver { public static final String CONST_CAS_GATEWAY = "_const_cas_gateway_"; - public boolean hasGatewayedAlready(final HttpServletRequest request, - final String serviceUrl) { + public boolean hasGatewayedAlready(final HttpServletRequest request, final String serviceUrl) { final HttpSession session = request.getSession(false); if (session == null) { @@ -39,8 +37,7 @@ public final class DefaultGatewayResolverImpl implements GatewayResolver { return result; } - public String storeGatewayInformation(final HttpServletRequest request, - final String serviceUrl) { + public String storeGatewayInformation(final HttpServletRequest request, final String serviceUrl) { request.getSession(true).setAttribute(CONST_CAS_GATEWAY, "yes"); return serviceUrl; } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/GatewayResolver.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/GatewayResolver.java index 9c587fb..4b7688b 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/GatewayResolver.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/GatewayResolver.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import javax.servlet.http.HttpServletRequest; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/Saml11AuthenticationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/Saml11AuthenticationFilter.java index b0db0c2..6c853ec 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/Saml11AuthenticationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/Saml11AuthenticationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import javax.servlet.FilterConfig; @@ -36,8 +35,8 @@ public class Saml11AuthenticationFilter extends AuthenticationFilter { protected final void initInternal(final FilterConfig filterConfig) throws ServletException { super.initInternal(filterConfig); - log.warn("SAML1.1 compliance requires the [artifactParameterName] and [serviceParameterName] to be set to specified values."); - log.warn("This filter will overwrite any user-provided values (if any are provided)"); + logger.warn("SAML1.1 compliance requires the [artifactParameterName] and [serviceParameterName] to be set to specified values."); + logger.warn("This filter will overwrite any user-provided values (if any are provided)"); setArtifactParameterName("SAMLart"); setServiceParameterName("TARGET"); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimpleGroup.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimpleGroup.java index 0abe602..c2110b1 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimpleGroup.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimpleGroup.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import java.security.Principal; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimplePrincipal.java b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimplePrincipal.java index fba5e09..eebb552 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimplePrincipal.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/authentication/SimplePrincipal.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import java.io.Serializable; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/AssertionPrincipal.java b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/AssertionPrincipal.java index 6abeff6..2f8b1e4 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/AssertionPrincipal.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/AssertionPrincipal.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.jaas; import java.io.Serializable; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/CasLoginModule.java b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/CasLoginModule.java index 02454e8..500693f 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/CasLoginModule.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/CasLoginModule.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.jaas; import java.beans.BeanInfo; @@ -45,14 +44,14 @@ import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.auth.login.LoginException; import javax.security.auth.spi.LoginModule; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.authentication.SimpleGroup; import org.jasig.cas.client.authentication.SimplePrincipal; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.util.ReflectUtils; import org.jasig.cas.client.validation.Assertion; import org.jasig.cas.client.validation.TicketValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JAAS login module that delegates to a CAS {@link TicketValidator} component @@ -149,7 +148,7 @@ public class CasLoginModule implements LoginModule { protected static final Map ASSERTION_CACHE = new HashMap(); /** Logger instance */ - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /** JAAS authentication subject */ protected Subject subject; @@ -232,39 +231,39 @@ public class CasLoginModule implements LoginModule { String ticketValidatorClass = null; for (final String key : options.keySet()) { - log.trace("Processing option " + key); + logger.trace("Processing option {}", key); if ("service".equals(key)) { this.service = (String) options.get(key); - log.debug("Set service=" + this.service); + logger.debug("Set service={}", this.service); } else if ("ticketValidatorClass".equals(key)) { ticketValidatorClass = (String) options.get(key); - log.debug("Set ticketValidatorClass=" + ticketValidatorClass); + logger.debug("Set ticketValidatorClass={}", ticketValidatorClass); } else if ("defaultRoles".equals(key)) { final String roles = (String) options.get(key); - log.trace("Got defaultRoles value " + roles); + logger.trace("Got defaultRoles value {}", roles); this.defaultRoles = roles.split(",\\s*"); - log.debug("Set defaultRoles=" + Arrays.asList(this.defaultRoles)); + logger.debug("Set defaultRoles={}", Arrays.asList(this.defaultRoles)); } else if ("roleAttributeNames".equals(key)) { final String attrNames = (String) options.get(key); - log.trace("Got roleAttributeNames value " + attrNames); + logger.trace("Got roleAttributeNames value {}", attrNames); final String[] attributes = attrNames.split(",\\s*"); this.roleAttributeNames.addAll(Arrays.asList(attributes)); - log.debug("Set roleAttributeNames=" + this.roleAttributeNames); + logger.debug("Set roleAttributeNames={}", this.roleAttributeNames); } else if ("principalGroupName".equals(key)) { this.principalGroupName = (String) options.get(key); - log.debug("Set principalGroupName=" + this.principalGroupName); + logger.debug("Set principalGroupName={}",this.principalGroupName); } else if ("roleGroupName".equals(key)) { this.roleGroupName = (String) options.get(key); - log.debug("Set roleGroupName=" + this.roleGroupName); + logger.debug("Set roleGroupName={}", this.roleGroupName); } else if ("cacheAssertions".equals(key)) { this.cacheAssertions = Boolean.parseBoolean((String) options.get(key)); - log.debug("Set cacheAssertions=" + this.cacheAssertions); + logger.debug("Set cacheAssertions={}", this.cacheAssertions); } else if ("cacheTimeout".equals(key)) { this.cacheTimeout = Integer.parseInt((String) options.get(key)); - log.debug("Set cacheTimeout=" + this.cacheTimeout); + logger.debug("Set cacheTimeout={}", this.cacheTimeout); } else if ("cacheTimeoutUnit".equals(key)) { this.cacheTimeoutUnit = Enum.valueOf(TimeUnit.class, (String) options.get(key)); - log.debug("Set cacheTimeoutUnit=" + this.cacheTimeoutUnit); + logger.debug("Set cacheTimeoutUnit={}", this.cacheTimeoutUnit); } } @@ -295,10 +294,10 @@ public class CasLoginModule implements LoginModule { } public final boolean login() throws LoginException { - log.debug("Performing login."); + logger.debug("Performing login."); if (!preLogin()) { - log.debug("preLogin failed."); + logger.debug("preLogin failed."); return false; } @@ -309,10 +308,10 @@ public class CasLoginModule implements LoginModule { try { this.callbackHandler.handle(new Callback[] { ticketCallback, serviceCallback }); } catch (final IOException e) { - log.info("Login failed due to IO exception in callback handler: " + e); + logger.info("Login failed due to IO exception in callback handler: {}", e); throw (LoginException) new LoginException("IO exception in callback handler: " + e).initCause(e); } catch (final UnsupportedCallbackException e) { - log.info("Login failed due to unsupported callback: " + e); + logger.info("Login failed due to unsupported callback: {}", e); throw (LoginException) new LoginException( "Callback handler does not support PasswordCallback and TextInputCallback.").initCause(e); } @@ -325,31 +324,29 @@ public class CasLoginModule implements LoginModule { if (this.cacheAssertions) { this.assertion = ASSERTION_CACHE.get(ticket); if (this.assertion != null) { - log.debug("Assertion found in cache."); + logger.debug("Assertion found in cache."); } } if (this.assertion == null) { - log.debug("CAS assertion is null; ticket validation required."); + logger.debug("CAS assertion is null; ticket validation required."); if (CommonUtils.isBlank(service)) { - log.info("Login failed because required CAS service parameter not provided."); + logger.info("Login failed because required CAS service parameter not provided."); throw new LoginException( "Neither login module nor callback handler provided required service parameter."); } try { - if (log.isDebugEnabled()) { - log.debug("Attempting ticket validation with service=" + service + " and ticket=" + ticket); - } + logger.debug("Attempting ticket validation with service={} and ticket={}", service, this.ticket); this.assertion = this.ticketValidator.validate(this.ticket.getName(), service); } catch (final Exception e) { - log.info("Login failed due to CAS ticket validation failure: " + e); + logger.info("Login failed due to CAS ticket validation failure: {}", e); throw (LoginException) new LoginException("CAS ticket validation failed: " + e).initCause(e); } } - log.info("Login succeeded."); + logger.info("Login succeeded."); } else { - log.info("Login failed because callback handler did not provide CAS ticket."); + logger.info("Login failed because callback handler did not provide CAS ticket."); throw new LoginException("Callback handler did not provide CAS ticket."); } result = true; @@ -437,16 +434,10 @@ public class CasLoginModule implements LoginModule { // Place principal name in shared state for downstream JAAS modules (module chaining use case) this.sharedState.put(LOGIN_NAME, assertion.getPrincipal().getName()); - if (log.isDebugEnabled()) { - if (log.isDebugEnabled()) { - log.debug("Created JAAS subject with principals: " + subject.getPrincipals()); - } - } + logger.debug("Created JAAS subject with principals: {}", subject.getPrincipals()); if (this.cacheAssertions) { - if (log.isDebugEnabled()) { - log.debug("Caching assertion for principal " + this.assertion.getPrincipal()); - } + logger.debug("Caching assertion for principal {}", this.assertion.getPrincipal()); ASSERTION_CACHE.put(this.ticket, this.assertion); } } else { @@ -464,7 +455,7 @@ public class CasLoginModule implements LoginModule { } public final boolean logout() throws LoginException { - log.debug("Performing logout."); + logger.debug("Performing logout."); if (!preLogout()) { return false; @@ -478,7 +469,7 @@ public class CasLoginModule implements LoginModule { // Remove all CAS credentials removeCredentialsOfType(TicketCredential.class); - log.info("Logout succeeded."); + logger.info("Logout succeeded."); postLogout(); return true; @@ -499,8 +490,6 @@ public class CasLoginModule implements LoginModule { protected void postLogout() { // template method } - - /** * Creates a {@link TicketValidator} instance from a class name and map of property name/value pairs. * @param className Fully-qualified name of {@link TicketValidator} concrete class. @@ -520,14 +509,14 @@ public class CasLoginModule implements LoginModule { for (final String property : propertyMap.keySet()) { if (!"casServerUrlPrefix".equals(property)) { - log.debug("Attempting to set TicketValidator property " + property); + logger.debug("Attempting to set TicketValidator property {}", property); final String value = (String) propertyMap.get(property); final PropertyDescriptor pd = ReflectUtils.getPropertyDescriptor(info, property); if (pd != null) { ReflectUtils.setProperty(property, convertIfNecessary(pd, value), validator, info); - log.debug("Set " + property + "=" + value); + logger.debug("Set {} = {}", property, value); } else { - log.warn("Cannot find property " + property + " on " + className); + logger.warn("Cannot find property {} on {}", property, className); } } } @@ -578,15 +567,11 @@ public class CasLoginModule implements LoginModule { private void removeCredentialsOfType(final Class clazz) { this.subject.getPrivateCredentials().removeAll(this.subject.getPrivateCredentials(clazz)); } - - /** * Removes expired entries from the assertion cache. */ private void cleanCache() { - if (log.isDebugEnabled()) { - log.debug("Cleaning assertion cache of size " + ASSERTION_CACHE.size()); - } + logger.debug("Cleaning assertion cache of size {}", ASSERTION_CACHE.size()); final Iterator> iter = ASSERTION_CACHE.entrySet().iterator(); final Calendar cutoff = Calendar.getInstance(); cutoff.setTimeInMillis(System.currentTimeMillis() - this.cacheTimeoutUnit.toMillis(this.cacheTimeout)); @@ -595,9 +580,7 @@ public class CasLoginModule implements LoginModule { final Calendar created = Calendar.getInstance(); created.setTime(assertion.getValidFromDate()); if (created.before(cutoff)) { - if (log.isDebugEnabled()) { - log.debug("Removing expired assertion for principal " + assertion.getPrincipal()); - } + logger.debug("Removing expired assertion for principal {}", assertion.getPrincipal()); iter.remove(); } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/ServiceAndTicketCallbackHandler.java b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/ServiceAndTicketCallbackHandler.java index 62bced7..9aacd58 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/ServiceAndTicketCallbackHandler.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/ServiceAndTicketCallbackHandler.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.jaas; import java.io.IOException; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/TicketCredential.java b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/TicketCredential.java index 2f7e92e..99b86e2 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/jaas/TicketCredential.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/jaas/TicketCredential.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.jaas; import java.security.Principal; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractEncryptedProxyGrantingTicketStorageImpl.java b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractEncryptedProxyGrantingTicketStorageImpl.java index 7842ac3..55124bd 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractEncryptedProxyGrantingTicketStorageImpl.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractEncryptedProxyGrantingTicketStorageImpl.java @@ -1,3 +1,21 @@ +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at the following location: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.jasig.cas.client.proxy; import javax.crypto.Cipher; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/Cas20ProxyRetriever.java b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/Cas20ProxyRetriever.java index 45adbae..2910f5f 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/Cas20ProxyRetriever.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/Cas20ProxyRetriever.java @@ -1,28 +1,27 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.util.XmlUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -48,7 +47,7 @@ public final class Cas20ProxyRetriever implements ProxyRetriever { /** * Instance of Commons Logging. */ - private final Log log = LogFactory.getLog(this.getClass()); + private final Logger logger = LoggerFactory.getLogger(this.getClass()); /** * Url to CAS server. @@ -77,7 +76,7 @@ public final class Cas20ProxyRetriever implements ProxyRetriever { final String error = XmlUtils.getTextForElement(response, "proxyFailure"); if (CommonUtils.isNotEmpty(error)) { - log.debug(error); + logger.debug(error); return null; } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/CleanUpTimerTask.java b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/CleanUpTimerTask.java index e48986c..aa460fd 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/CleanUpTimerTask.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/CleanUpTimerTask.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import java.util.TimerTask; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorage.java b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorage.java index d4bf58a..4df3508 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorage.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorage.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; /** diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java index b62592b..059a87a 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java @@ -1,31 +1,30 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.CommonUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Implementation of {@link ProxyGrantingTicketStorage} that is backed by a @@ -41,7 +40,7 @@ import org.jasig.cas.client.util.CommonUtils; */ public final class ProxyGrantingTicketStorageImpl implements ProxyGrantingTicketStorage { - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); /** * Default timeout in milliseconds. @@ -90,24 +89,20 @@ public final class ProxyGrantingTicketStorageImpl implements ProxyGrantingTicket final ProxyGrantingTicketHolder holder = this.cache.get(proxyGrantingTicketIou); if (holder == null) { - log.info("No Proxy Ticket found for [" + proxyGrantingTicketIou + "]."); + logger.info("No Proxy Ticket found for [{}].", proxyGrantingTicketIou); return null; } this.cache.remove(proxyGrantingTicketIou); - if (log.isDebugEnabled()) { - log.debug("Returned ProxyGrantingTicket of [" + holder.getProxyGrantingTicket() + "]"); - } + logger.debug("Returned ProxyGrantingTicket of [{}]", holder.getProxyGrantingTicket()); return holder.getProxyGrantingTicket(); } public void save(final String proxyGrantingTicketIou, final String proxyGrantingTicket) { final ProxyGrantingTicketHolder holder = new ProxyGrantingTicketHolder(proxyGrantingTicket); - if (log.isDebugEnabled()) { - log.debug("Saving ProxyGrantingTicketIOU and ProxyGrantingTicket combo: [" + proxyGrantingTicketIou + ", " + proxyGrantingTicket + "]"); - } + logger.debug("Saving ProxyGrantingTicketIOU and ProxyGrantingTicket combo: [{}, {}]", proxyGrantingTicketIou, proxyGrantingTicket); this.cache.put(proxyGrantingTicketIou, holder); } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyRetriever.java b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyRetriever.java index 14c006f..07e01a4 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyRetriever.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyRetriever.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import java.io.Serializable; @@ -38,6 +37,5 @@ public interface ProxyRetriever extends Serializable { * @param targetService the service we want to proxy. * @return the ProxyTicket Id if Granted, null otherwise. */ - String getProxyTicketIdFor(String proxyGrantingTicketId, - String targetService); + String getProxyTicketIdFor(String proxyGrantingTicketId, String targetService); } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/package.html b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/package.html index fa0cb06..17c3c9c 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/proxy/package.html +++ b/cas-client-core/src/main/java/org/jasig/cas/client/proxy/package.html @@ -5,20 +5,19 @@ for additional information regarding copyright ownership. Jasig licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a - copy of the License at: + except in compliance with the License. You may obtain a + copy of the License at the following location: - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on - an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> -

The proxy package includes a servlet to act as a proxy receptor, diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/session/HashMapBackedSessionMappingStorage.java b/cas-client-core/src/main/java/org/jasig/cas/client/session/HashMapBackedSessionMappingStorage.java index c58e3a4..a4ed3db 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/session/HashMapBackedSessionMappingStorage.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/session/HashMapBackedSessionMappingStorage.java @@ -1,26 +1,25 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.session; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.Map; @@ -47,7 +46,7 @@ public final class HashMapBackedSessionMappingStorage implements SessionMappingS */ private final Map ID_TO_SESSION_KEY_MAPPING = new HashMap(); - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); public synchronized void addSessionById(String mappingId, HttpSession session) { ID_TO_SESSION_KEY_MAPPING.put(session.getId(), mappingId); @@ -55,18 +54,16 @@ public final class HashMapBackedSessionMappingStorage implements SessionMappingS } - public synchronized void removeBySessionById(String sessionId) { - if (log.isDebugEnabled()) { - log.debug("Attempting to remove Session=[" + sessionId + "]"); - } + public synchronized void removeBySessionById(final String sessionId) { + logger.debug("Attempting to remove Session=[{}]", sessionId); final String key = ID_TO_SESSION_KEY_MAPPING.get(sessionId); - if (log.isDebugEnabled()) { + if (logger.isDebugEnabled()) { if (key != null) { - log.debug("Found mapping for session. Session Removed."); + logger.debug("Found mapping for session. Session Removed."); } else { - log.debug("No mapping for session found. Ignoring."); + logger.debug("No mapping for session found. Ignoring."); } } MANAGED_SESSIONS.remove(key); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/session/SessionMappingStorage.java b/cas-client-core/src/main/java/org/jasig/cas/client/session/SessionMappingStorage.java index 32e53a1..f0d6b2c 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/session/SessionMappingStorage.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/session/SessionMappingStorage.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.session; import javax.servlet.http.HttpSession; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java index a9c8504..6219d80 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.session; import org.jasig.cas.client.util.AbstractConfigurationFilter; @@ -72,7 +71,7 @@ public final class SingleSignOutFilter extends AbstractConfigurationFilter { // Do not continue up filter chain return; } else { - log.trace("Ignoring URI " + request.getRequestURI()); + logger.trace("Ignoring URI {}", request.getRequestURI()); } filterChain.doFilter(servletRequest, servletResponse); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHandler.java b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHandler.java index a1c1fa5..28f3d10 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHandler.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHandler.java @@ -1,31 +1,30 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.session; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.util.XmlUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Arrays; import java.util.List; @@ -41,7 +40,7 @@ import java.util.List; public final class SingleSignOutHandler { /** Logger instance */ - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); /** Mapping of token IDs and session IDs to HTTP sessions */ private SessionMappingStorage sessionMappingStorage = new HashMapBackedSessionMappingStorage(); @@ -57,8 +56,6 @@ public final class SingleSignOutHandler { private boolean eagerlyCreateSessions = true; private List safeParameters; - - public void setSessionMappingStorage(final SessionMappingStorage storage) { this.sessionMappingStorage = storage; } @@ -137,14 +134,12 @@ public final class SingleSignOutHandler { final HttpSession session = request.getSession(this.eagerlyCreateSessions); if (session == null) { - log.debug("No session currently exists (and none created). Cannot record session information for single sign out."); + logger.debug("No session currently exists (and none created). Cannot record session information for single sign out."); return; } final String token = CommonUtils.safeGetParameter(request, this.artifactParameterName, this.safeParameters); - if (log.isDebugEnabled()) { - log.debug("Recording session for token " + token); - } + logger.debug("Recording session for token {}", token); try { this.sessionMappingStorage.removeBySessionById(session.getId()); @@ -161,10 +156,8 @@ public final class SingleSignOutHandler { */ public void destroySession(final HttpServletRequest request) { final String logoutMessage = CommonUtils.safeGetParameter(request, this.logoutParameterName, this.safeParameters); - if (log.isTraceEnabled()) { - log.trace ("Logout request:\n" + logoutMessage); - } - + logger.trace ("Logout request:\n{}", logoutMessage); + final String token = XmlUtils.getTextForElement(logoutMessage, "SessionIndex"); if (CommonUtils.isNotBlank(token)) { final HttpSession session = this.sessionMappingStorage.removeSessionByMappingId(token); @@ -172,13 +165,12 @@ public final class SingleSignOutHandler { if (session != null) { String sessionID = session.getId(); - if (log.isDebugEnabled()) { - log.debug ("Invalidating session [" + sessionID + "] for token [" + token + "]"); - } + logger.debug ("Invalidating session [{}] for token [{}]", sessionID, token); + try { session.invalidate(); } catch (final IllegalStateException e) { - log.debug("Error invalidating session.", e); + logger.debug("Error invalidating session.", e); } } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHttpSessionListener.java b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHttpSessionListener.java index 7d28bd1..8df6a85 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHttpSessionListener.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/session/SingleSignOutHttpSessionListener.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.session; import javax.servlet.http.HttpSession; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/ssl/AnyHostnameVerifier.java b/cas-client-core/src/main/java/org/jasig/cas/client/ssl/AnyHostnameVerifier.java index 14fe4ec..c9672ce 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/ssl/AnyHostnameVerifier.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/ssl/AnyHostnameVerifier.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.ssl; import javax.net.ssl.HostnameVerifier; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/ssl/RegexHostnameVerifier.java b/cas-client-core/src/main/java/org/jasig/cas/client/ssl/RegexHostnameVerifier.java index 6bb7074..475706d 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/ssl/RegexHostnameVerifier.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/ssl/RegexHostnameVerifier.java @@ -1,21 +1,22 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ + package org.jasig.cas.client.ssl; import java.util.regex.Pattern; @@ -46,8 +47,6 @@ public final class RegexHostnameVerifier implements HostnameVerifier { public RegexHostnameVerifier(final String regex) { this.pattern = Pattern.compile(regex); } - - /** {@inheritDoc} */ public boolean verify(final String hostname, final SSLSession session) { return pattern.matcher(hostname).matches(); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifier.java b/cas-client-core/src/main/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifier.java index c09002a..918a9f4 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifier.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifier.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.ssl; import javax.net.ssl.HostnameVerifier; @@ -34,8 +33,6 @@ public final class WhitelistHostnameVerifier implements HostnameVerifier { /** Allowed hosts */ private String[] allowedHosts; - - /** * Creates a new instance using the given array of allowed hosts. * @@ -44,8 +41,6 @@ public final class WhitelistHostnameVerifier implements HostnameVerifier { public WhitelistHostnameVerifier(final String[] allowed) { this.allowedHosts = allowed; } - - /** * Creates a new instance using the given list of allowed hosts. * diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java index 79c94b3..6586389 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java @@ -1,26 +1,25 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.FilterConfig; import javax.servlet.ServletException; @@ -46,9 +45,6 @@ public abstract class AbstractCasFilter extends AbstractConfigurationFilter { /** Represents the constant for where the assertion will be located in memory. */ public static final String CONST_CAS_ASSERTION = "_const_cas_assertion_"; - /** Instance of commons logging for logging purposes. */ - protected final Log log = LogFactory.getLog(getClass()); - /** Defines the parameter to look for for the artifact. */ private String artifactParameterName = "ticket"; @@ -69,15 +65,15 @@ public abstract class AbstractCasFilter extends AbstractConfigurationFilter { public final void init(final FilterConfig filterConfig) throws ServletException { if (!isIgnoreInitConfiguration()) { setServerName(getPropertyFromInitParams(filterConfig, "serverName", null)); - log.trace("Loading serverName property: " + this.serverName); + logger.trace("Loading serverName property: {}", this.serverName); setService(getPropertyFromInitParams(filterConfig, "service", null)); - log.trace("Loading service property: " + this.service); + logger.trace("Loading service property: {}", this.service); setArtifactParameterName(getPropertyFromInitParams(filterConfig, "artifactParameterName", "ticket")); - log.trace("Loading artifact parameter name property: " + this.artifactParameterName); + logger.trace("Loading artifact parameter name property: {}", this.artifactParameterName); setServiceParameterName(getPropertyFromInitParams(filterConfig, "serviceParameterName", "service")); - log.trace("Loading serviceParameterName property: " + this.serviceParameterName); + logger.trace("Loading serviceParameterName property: {} ", this.serviceParameterName); setEncodeServiceUrl(parseBoolean(getPropertyFromInitParams(filterConfig, "encodeServiceUrl", "true"))); - log.trace("Loading encodeServiceUrl property: " + this.encodeServiceUrl); + logger.trace("Loading encodeServiceUrl property: {}", this.encodeServiceUrl); initInternal(filterConfig); } @@ -122,7 +118,7 @@ public abstract class AbstractCasFilter extends AbstractConfigurationFilter { public final void setServerName(final String serverName) { if (serverName != null && serverName.endsWith("/")) { this.serverName = serverName.substring(0, serverName.length()-1); - log.info(String.format("Eliminated extra slash from serverName [%s]. It is now [%s]", serverName, this.serverName)); + logger.info("Eliminated extra slash from serverName [{}]. It is now [{}]", serverName, this.serverName); } else { this.serverName = serverName; } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractConfigurationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractConfigurationFilter.java index de6dca7..e9e2183 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractConfigurationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractConfigurationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import javax.naming.InitialContext; @@ -24,8 +23,8 @@ import javax.naming.NamingException; import javax.servlet.Filter; import javax.servlet.FilterConfig; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Abstracts out the ability to configure the filters from the initial properties provided. @@ -36,7 +35,7 @@ import org.apache.commons.logging.LogFactory; */ public abstract class AbstractConfigurationFilter implements Filter { - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private boolean ignoreInitConfiguration = false; @@ -68,21 +67,21 @@ public abstract class AbstractConfigurationFilter implements Filter { final String value = filterConfig.getInitParameter(propertyName); if (CommonUtils.isNotBlank(value)) { - log.info("Property [" + propertyName + "] loaded from FilterConfig.getInitParameter with value [" + value + "]"); + logger.info("Property [{}] loaded from FilterConfig.getInitParameter with value [{}]", propertyName, value); return value; } final String value2 = filterConfig.getServletContext().getInitParameter(propertyName); if (CommonUtils.isNotBlank(value2)) { - log.info("Property [" + propertyName + "] loaded from ServletContext.getInitParameter with value [" + value2 + "]"); + logger.info("Property [{}] loaded from ServletContext.getInitParameter with value [{}]", propertyName, value2); return value2; } InitialContext context; try { context = new InitialContext(); } catch (final NamingException e) { - log.warn(e,e); + logger.warn(e.getMessage(), e); return defaultValue; } @@ -91,18 +90,18 @@ public abstract class AbstractConfigurationFilter implements Filter { final String value3 = loadFromContext(context, "java:comp/env/cas/" + shortName + "/" + propertyName); if (CommonUtils.isNotBlank(value3)) { - log.info("Property [" + propertyName + "] loaded from JNDI Filter Specific Property with value [" + value3 + "]"); + logger.info("Property [{}] loaded from JNDI Filter Specific Property with value [{}]", propertyName, value3); return value3; } final String value4 = loadFromContext(context, "java:comp/env/cas/" + propertyName); if (CommonUtils.isNotBlank(value4)) { - log.info("Property [" + propertyName + "] loaded from JNDI with value [" + value4 + "]"); + logger.info("Property [{}] loaded from JNDI with value [{}]", propertyName, value4); return value4; } - log.info("Property [" + propertyName + "] not found. Using default value [" + defaultValue + "]"); + logger.info("Property [{}] not found. Using default value [{}]", propertyName, defaultValue); return defaultValue; } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionHolder.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionHolder.java index 7959ca0..f1e011b 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionHolder.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionHolder.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import org.jasig.cas.client.validation.Assertion; @@ -34,8 +33,6 @@ public class AssertionHolder { * ThreadLocal to hold the Assertion for Threads to access. */ private static final ThreadLocal threadLocal = new ThreadLocal(); - - /** * Retrieve the assertion from the ThreadLocal. * diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionThreadLocalFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionThreadLocalFilter.java index d0af95e..b65a756 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionThreadLocalFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/AssertionThreadLocalFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import org.jasig.cas.client.validation.Assertion; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java index 733393f..91a3aaa 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java @@ -1,29 +1,28 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage; import org.jasig.cas.client.validation.ProxyList; import org.jasig.cas.client.validation.ProxyListEditor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; @@ -52,8 +51,7 @@ import java.util.*; */ public final class CommonUtils { - /** Instance of Commons Logging. */ - private static final Log LOG = LogFactory.getLog(CommonUtils.class); + private static final Logger LOGGER = LoggerFactory.getLogger(CommonUtils.class); /** * Constant representing the ProxyGrantingTicket IOU Request Parameter. @@ -189,20 +187,12 @@ public final class CommonUtils { return; } - if (LOG.isDebugEnabled()) { - LOG.debug("Received proxyGrantingTicketId [" - + proxyGrantingTicket + "] for proxyGrantingTicketIou [" - + proxyGrantingTicketIou + "]"); - } + LOGGER.debug("Received proxyGrantingTicketId [{}] for proxyGrantingTicketIou [{}]", proxyGrantingTicket, proxyGrantingTicketIou); proxyGrantingTicketStorage.save(proxyGrantingTicketIou, proxyGrantingTicket); - if (LOG.isDebugEnabled()) { - LOG.debug("Successfully saved proxyGrantingTicketId [" - + proxyGrantingTicket + "] for proxyGrantingTicketIou [" - + proxyGrantingTicketIou + "]"); - } - + LOGGER.debug("Successfully saved proxyGrantingTicketId [{}] for proxyGrantingTicketIou [{}]", proxyGrantingTicket, proxyGrantingTicketIou); + response.getWriter().write(""); response.getWriter().write(""); } @@ -275,9 +265,7 @@ public final class CommonUtils { if (location == 0) { final String returnValue = encode ? response.encodeURL(buffer.toString()): buffer.toString(); - if (LOG.isDebugEnabled()) { - LOG.debug("serviceUrl generated: " + returnValue); - } + LOGGER.debug("serviceUrl generated: {}", returnValue); return returnValue; } @@ -299,9 +287,7 @@ public final class CommonUtils { } final String returnValue = encode ? response.encodeURL(buffer.toString()) : buffer.toString(); - if (LOG.isDebugEnabled()) { - LOG.debug("serviceUrl generated: " + returnValue); - } + LOGGER.debug("serviceUrl generated: {}", returnValue); return returnValue; } @@ -323,7 +309,7 @@ public final class CommonUtils { */ public static String safeGetParameter(final HttpServletRequest request, final String parameter, final List parameters) { if ("POST".equals(request.getMethod()) && parameters.contains(parameter)) { - LOG.debug("safeGetParameter called on a POST HttpServletRequest for Restricted Parameters. Cannot complete check safely. Reverting to standard behavior for this Parameter"); + LOGGER.debug("safeGetParameter called on a POST HttpServletRequest for Restricted Parameters. Cannot complete check safely. Reverting to standard behavior for this Parameter"); return request.getParameter(parameter); } return request.getQueryString() == null || !request.getQueryString().contains(parameter) ? null : request.getParameter(parameter); @@ -376,7 +362,7 @@ public final class CommonUtils { } return stringBuffer.toString(); } catch (final Exception e) { - LOG.error(e.getMessage(), e); + LOGGER.error(e.getMessage(), e); throw new RuntimeException(e); } finally { if (conn != null && conn instanceof HttpURLConnection) { @@ -420,7 +406,7 @@ public final class CommonUtils { try { response.sendRedirect(url); } catch (final Exception e) { - LOG.warn(e.getMessage(), e); + LOGGER.warn(e.getMessage(), e); } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/DelegatingFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/DelegatingFilter.java index 6c71ef8..3b12267 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/DelegatingFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/DelegatingFilter.java @@ -1,26 +1,25 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -46,7 +45,7 @@ public final class DelegatingFilter implements Filter { /** * Instance of Commons Logging. */ - private final Log log = LogFactory.getLog(this.getClass()); + private final Logger logger = LoggerFactory.getLogger(this.getClass()); /** * The request parameter to look for in the Request object. @@ -95,19 +94,14 @@ public final class DelegatingFilter implements Filter { for (final String key : this.delegators.keySet()) { if ((parameter.equals(key) && this.exactMatch) || (parameter.matches(key) && !this.exactMatch)) { final Filter filter = this.delegators.get(key); - if (log.isDebugEnabled()) { - log.debug("Match found for parameter [" - + this.requestParameterName + "] with value [" - + parameter + "]. Delegating to filter [" - + filter.getClass().getName() + "]"); - } + logger.debug("Match found for parameter [{}] with value [{}]. Delegating to filter [{}]", this.requestParameterName, parameter, filter.getClass().getName()); filter.doFilter(request, response, filterChain); return; } } } - log.debug("No match found for parameter [" + this.requestParameterName + "] with value [" + parameter + "]"); + logger.debug("No match found for parameter [{}] with value [{}]", this.requestParameterName , parameter); if (this.defaultFilter != null) { this.defaultFilter.doFilter(request, response, filterChain); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/ErrorRedirectFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/ErrorRedirectFilter.java index 9ad2862..1cdd384 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/ErrorRedirectFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/ErrorRedirectFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import java.io.IOException; @@ -32,8 +31,8 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Filters that redirects to the supplied url based on an exception. Exceptions and the urls are configured via @@ -51,7 +50,7 @@ import org.apache.commons.logging.LogFactory; */ public final class ErrorRedirectFilter implements Filter { - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private final List errors = new ArrayList(); @@ -97,7 +96,7 @@ public final class ErrorRedirectFilter implements Filter { this.errors.add(new ErrorHolder(className, filterConfig.getInitParameter(className))); } } catch (final ClassNotFoundException e) { - log.warn("Class [" + className + "] cannot be found in ClassLoader. Ignoring."); + logger.warn("Class [{}] cannot be found in ClassLoader. Ignoring.", className); } } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilter.java index 56920b0..d37fb02 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import org.jasig.cas.client.authentication.AttributePrincipal; @@ -107,17 +106,17 @@ public final class HttpServletRequestWrapperFilter extends AbstractConfiguration public boolean isUserInRole(final String role) { if (CommonUtils.isBlank(role)) { - log.debug("No valid role provided. Returning false."); + logger.debug("No valid role provided. Returning false."); return false; } if (this.principal == null) { - log.debug("No Principal in Request. Returning false."); + logger.debug("No Principal in Request. Returning false."); return false; } if (CommonUtils.isBlank(roleAttribute)) { - log.debug("No Role Attribute Configured. Returning false."); + logger.debug("No Role Attribute Configured. Returning false."); return false; } @@ -126,14 +125,14 @@ public final class HttpServletRequestWrapperFilter extends AbstractConfiguration if (value instanceof Collection) { for (final Object o : (Collection) value) { if (rolesEqual(role, o)) { - log.debug("User [" + getRemoteUser() + "] is in role [" + role + "]: " + true); + logger.debug("User [{}] is in role [{}]: true", getRemoteUser(), role); return true; } } } final boolean isMember = rolesEqual(role, value); - log.debug("User [" + getRemoteUser() + "] is in role [" + role + "]: " + isMember); + logger.debug("User [{}] is in role [{}]: {}", getRemoteUser(), role, isMember); return isMember; } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/ReflectUtils.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/ReflectUtils.java index 0b1f963..7148f6c 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/ReflectUtils.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/ReflectUtils.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import java.beans.BeanInfo; @@ -53,8 +52,6 @@ public final class ReflectUtils { throw new IllegalArgumentException(className + " class not found."); } } - - /** * Creates a new instance of the given class by passing the given arguments * to the constructor. diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java index 62abfdf..dd23737 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java @@ -1,26 +1,25 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.xml.sax.Attributes; @@ -50,7 +49,7 @@ public final class XmlUtils { /** * Static instance of Commons Logging. */ - private final static Log LOG = LogFactory.getLog(XmlUtils.class); + private final static Logger LOGGER = LoggerFactory.getLogger(XmlUtils.class); /** * Get an instance of an XML reader from the XMLReaderFactory. @@ -118,7 +117,7 @@ public final class XmlUtils { try { reader.parse(new InputSource(new StringReader(xmlAsString))); } catch (final Exception e) { - LOG.error(e, e); + LOGGER.error(e.getMessage(), e); return null; } @@ -171,33 +170,10 @@ public final class XmlUtils { try { reader.parse(new InputSource(new StringReader(xmlAsString))); } catch (final Exception e) { - LOG.error(e, e); + LOGGER.error(e.getMessage(), e); return null; } return builder.toString(); } - - /** - * Retrieve the child nodes from xml string, for a specific element. - * - * @param xmlAsString the xml response - * @param tagName the element to look for - * @return the {@link org.w3c.dom.NodeList NodeList} containing the child nodes. - * @throws ParserConfigurationException - * @throws IOException - * @throws SAXException - */ - public static NodeList getNodeListForElements(final String xmlAsString, final String tagName) - throws ParserConfigurationException, - IOException, - SAXException { - - final DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - final InputSource inStream = new InputSource(); - inStream.setCharacterStream(new StringReader(xmlAsString)); - final Document document = documentBuilder.parse(inStream); - - return document.getElementsByTagName(tagName).item(0).getChildNodes(); - } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/package.html b/cas-client-core/src/main/java/org/jasig/cas/client/util/package.html index 300a79b..fcf85e2 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/package.html +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/package.html @@ -5,20 +5,19 @@ for additional information regarding copyright ownership. Jasig licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a - copy of the License at: + except in compliance with the License. You may obtain a + copy of the License at the following location: - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on - an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> -

The validation package includes interfaces for validating Tickets, as well as the common implementations.

diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractCasProtocolUrlBasedTicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractCasProtocolUrlBasedTicketValidator.java index 84d9e67..7e736d7 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractCasProtocolUrlBasedTicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractCasProtocolUrlBasedTicketValidator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.util.CommonUtils; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractTicketValidationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractTicketValidationFilter.java index 7f65046..00339b4 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractTicketValidationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractTicketValidationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.util.AbstractCasFilter; @@ -90,9 +89,9 @@ public abstract class AbstractTicketValidationFilter extends AbstractCasFilter { */ protected HostnameVerifier getHostnameVerifier(final FilterConfig filterConfig) { final String className = getPropertyFromInitParams(filterConfig, "hostnameVerifier", null); - log.trace("Using hostnameVerifier parameter: " + className); + logger.trace("Using hostnameVerifier parameter: {}", className); final String config = getPropertyFromInitParams(filterConfig, "hostnameVerifierConfig", null); - log.trace("Using hostnameVerifierConfig parameter: " + config); + logger.trace("Using hostnameVerifierConfig parameter: {}", config); if (className != null) { if (config != null) { return ReflectUtils.newInstance(className, config); @@ -105,14 +104,14 @@ public abstract class AbstractTicketValidationFilter extends AbstractCasFilter { protected void initInternal(final FilterConfig filterConfig) throws ServletException { setExceptionOnValidationFailure(parseBoolean(getPropertyFromInitParams(filterConfig, "exceptionOnValidationFailure", "true"))); - log.trace("Setting exceptionOnValidationFailure parameter: " + this.exceptionOnValidationFailure); + logger.trace("Setting exceptionOnValidationFailure parameter: {}", this.exceptionOnValidationFailure); setRedirectAfterValidation(parseBoolean(getPropertyFromInitParams(filterConfig, "redirectAfterValidation", "true"))); - log.trace("Setting redirectAfterValidation parameter: " + this.redirectAfterValidation); + logger.trace("Setting redirectAfterValidation parameter: {}", this.redirectAfterValidation); setUseSession(parseBoolean(getPropertyFromInitParams(filterConfig, "useSession", "true"))); - log.trace("Setting useSession parameter: " + this.useSession); + logger.trace("Setting useSession parameter: {}", this.useSession); if (!this.useSession && this.redirectAfterValidation) { - log.warn("redirectAfterValidation parameter may not be true when useSession parameter is false. Resetting it to false in order to prevent infinite redirects."); + logger.warn("redirectAfterValidation parameter may not be true when useSession parameter is false. Resetting it to false in order to prevent infinite redirects."); setRedirectAfterValidation(false); } @@ -174,16 +173,12 @@ public abstract class AbstractTicketValidationFilter extends AbstractCasFilter { final String ticket = retrieveTicketFromRequest(request); if (CommonUtils.isNotBlank(ticket)) { - if (log.isDebugEnabled()) { - log.debug("Attempting to validate ticket: " + ticket); - } + logger.debug("Attempting to validate ticket: {}", ticket); try { final Assertion assertion = this.ticketValidator.validate(ticket, constructServiceUrl(request, response)); - if (log.isDebugEnabled()) { - log.debug("Successfully authenticated user: " + assertion.getPrincipal().getName()); - } + logger.debug("Successfully authenticated user: {}", assertion.getPrincipal().getName()); request.setAttribute(CONST_CAS_ASSERTION, assertion); @@ -193,13 +188,13 @@ public abstract class AbstractTicketValidationFilter extends AbstractCasFilter { onSuccessfulValidation(request, response, assertion); if (this.redirectAfterValidation) { - log. debug("Redirecting after successful ticket validation."); + logger. debug("Redirecting after successful ticket validation."); response.sendRedirect(constructServiceUrl(request, response)); return; } } catch (final TicketValidationException e) { response.setStatus(HttpServletResponse.SC_FORBIDDEN); - log.warn(e, e); + logger.warn(e.getMessage(), e); onFailedValidation(request, response); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java index 0012b5e..5606ac5 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java @@ -1,27 +1,26 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.CommonUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; @@ -41,10 +40,7 @@ import javax.net.ssl.HostnameVerifier; */ public abstract class AbstractUrlBasedTicketValidator implements TicketValidator { - /** - * Commons Logging instance. - */ - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /** * Hostname verifier used when making an SSL request to the CAS server. @@ -113,7 +109,7 @@ public abstract class AbstractUrlBasedTicketValidator implements TicketValidator protected final String constructValidationUrl(final String ticket, final String serviceUrl) { final Map urlParameters = new HashMap(); - log.debug("Placing URL parameters in map."); + logger.debug("Placing URL parameters in map."); urlParameters.put("ticket", ticket); urlParameters.put("service", encodeUrl(serviceUrl)); @@ -121,10 +117,10 @@ public abstract class AbstractUrlBasedTicketValidator implements TicketValidator urlParameters.put("renew", "true"); } - log.debug("Calling template URL attribute map."); + logger.debug("Calling template URL attribute map."); populateUrlAttributeMap(urlParameters); - log.debug("Loading custom parameters from configuration."); + logger.debug("Loading custom parameters from configuration."); if (this.customParameters != null) { urlParameters.putAll(this.customParameters); } @@ -195,24 +191,18 @@ public abstract class AbstractUrlBasedTicketValidator implements TicketValidator protected abstract String retrieveResponseFromServer(URL validationUrl, String ticket); public final Assertion validate(final String ticket, final String service) throws TicketValidationException { - - final String validationUrl = constructValidationUrl(ticket, service); - if (log.isDebugEnabled()) { - log.debug("Constructing validation url: " + validationUrl); - } + logger.debug("Constructing validation url: {}", validationUrl); try { - log.debug("Retrieving response from server."); + logger.debug("Retrieving response from server."); final String serverResponse = retrieveResponseFromServer(new URL(validationUrl), ticket); if (serverResponse == null) { throw new TicketValidationException("The CAS server returned no response."); } - if (log.isDebugEnabled()) { - log.debug("Server response: " + serverResponse); - } + logger.debug("Server response: {}", serverResponse); return parseResponseFromServer(serverResponse); } catch (final MalformedURLException e) { diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Assertion.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Assertion.java index 1f51869..fbee1cb 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Assertion.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Assertion.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.authentication.AttributePrincipal; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java index d2612e7..bfba26f 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.authentication.AttributePrincipal; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidationFilter.java index 51f59e7..657f1e8 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import javax.servlet.FilterConfig; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidator.java index 7bdfd04..dce9a50 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import java.io.BufferedReader; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java index 894bfef..5d31060 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import java.io.IOException; @@ -94,7 +93,7 @@ public class Cas20ProxyReceivingTicketValidationFilter extends AbstractTicketVal } } - log.trace("Setting proxyReceptorUrl parameter: " + this.proxyReceptorUrl); + logger.trace("Setting proxyReceptorUrl parameter: {}", this.proxyReceptorUrl); this.millisBetweenCleanUps = Integer.parseInt(getPropertyFromInitParams(filterConfig, "millisBetweenCleanUps", Integer.toString(DEFAULT_MILLIS_BETWEEN_CLEANUPS))); super.initInternal(filterConfig); } @@ -185,7 +184,7 @@ public class Cas20ProxyReceivingTicketValidationFilter extends AbstractTicketVal try { CommonUtils.readAndRespondToProxyReceptorRequest(request, response, this.proxyGrantingTicketStorage); } catch (final RuntimeException e) { - log.error(e.getMessage(), e); + logger.error(e.getMessage(), e); throw e; } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java index c2768ac..7c437ad 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.util.XmlUtils; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java index 99637ac..c626d6d 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.authentication.AttributePrincipal; @@ -145,7 +144,7 @@ public class Cas20ServiceTicketValidator extends AbstractCasProtocolUrlBasedTick xmlReader.parse(new InputSource(new StringReader(xml))); return handler.getAttributes(); } catch (final Exception e) { - log.error(e.getMessage(), e); + logger.error(e.getMessage(), e); return Collections.emptyMap(); } } diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/InvalidProxyChainTicketValidationException.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/InvalidProxyChainTicketValidationException.java index d0f9c00..ff5e0a6 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/InvalidProxyChainTicketValidationException.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/InvalidProxyChainTicketValidationException.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; /** diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyList.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyList.java index 812e970..83254e4 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyList.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyList.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.util.CommonUtils; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyListEditor.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyListEditor.java index ed5e784..745fc19 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyListEditor.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/ProxyListEditor.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.util.CommonUtils; diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidationFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidationFilter.java index 26a2f74..8ac6e52 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidationFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import javax.servlet.FilterConfig; @@ -42,8 +41,8 @@ public class Saml11TicketValidationFilter extends AbstractTicketValidationFilter protected final void initInternal(final FilterConfig filterConfig) throws ServletException { super.initInternal(filterConfig); - log.warn("SAML1.1 compliance requires the [artifactParameterName] and [serviceParameterName] to be set to specified values."); - log.warn("This filter will overwrite any user-provided values (if any are provided)"); + logger.warn("SAML1.1 compliance requires the [artifactParameterName] and [serviceParameterName] to be set to specified values."); + logger.warn("This filter will overwrite any user-provided values (if any are provided)"); setArtifactParameterName("SAMLart"); setServiceParameterName("TARGET"); diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidator.java index 624aea5..8a1d775 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/Saml11TicketValidator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.authentication.AttributePrincipal; @@ -72,8 +71,6 @@ public final class Saml11TicketValidator extends AbstractUrlBasedTicketValidator private final BasicParserPool basicParserPool; private final IdentifierGenerator identifierGenerator; - - public Saml11TicketValidator(final String casServerUrlPrefix) { super(casServerUrlPrefix); this.basicParserPool = new BasicParserPool(); @@ -176,7 +173,7 @@ public final class Saml11TicketValidator extends AbstractUrlBasedTicketValidator final DateTime notOnOrAfter = assertion.getConditions().getNotOnOrAfter(); if (notBefore == null || notOnOrAfter == null) { - log.debug("Assertion has no bounding dates. Will not process."); + logger.debug("Assertion has no bounding dates. Will not process."); return false; } @@ -184,16 +181,16 @@ public final class Saml11TicketValidator extends AbstractUrlBasedTicketValidator final Interval validityRange = new Interval(notBefore.minus(this.tolerance), notOnOrAfter.plus(this.tolerance)); if (validityRange.contains(currentTime)) { - log.debug("Current time is within the interval validity."); + logger.debug("Current time is within the interval validity."); return true; } if (currentTime.isBefore(validityRange.getStart())) { - log.debug("skipping assertion that's not yet valid..."); + logger.debug("skipping assertion that's not yet valid..."); return false; } - log.debug("skipping expired assertion..."); + logger.debug("skipping expired assertion..."); return false; } @@ -234,8 +231,6 @@ public final class Saml11TicketValidator extends AbstractUrlBasedTicketValidator final String MESSAGE_TO_SEND = "" + "" + ticket + ""; - - HttpURLConnection conn = null; try { diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidationException.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidationException.java index e383fed..6639ec2 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidationException.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidationException.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; /** diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidator.java b/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidator.java index 2efa2b9..69888e3 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidator.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; /** diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/PublicTestHttpServer.java b/cas-client-core/src/test/java/org/jasig/cas/client/PublicTestHttpServer.java index 57de8d2..d47e361 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/PublicTestHttpServer.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/PublicTestHttpServer.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client; import java.io.*; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/SerializationTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/SerializationTests.java index 76de0bc..20d8ff8 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/SerializationTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/SerializationTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client; import java.io.ByteArrayInputStream; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/authentication/AuthenticationFilterTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/authentication/AuthenticationFilterTests.java index b3a273f..9b41a74 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/authentication/AuthenticationFilterTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/authentication/AuthenticationFilterTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.authentication; import junit.framework.TestCase; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/jaas/CasLoginModuleTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/jaas/CasLoginModuleTests.java index ede32b0..ce0cbf9 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/jaas/CasLoginModuleTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/jaas/CasLoginModuleTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.jaas; import java.security.Principal; @@ -188,8 +187,6 @@ public class CasLoginModuleTests { assertEquals(this.subject.getPrincipals().size(), 3); assertEquals(TICKET, this.subject.getPrivateCredentials().iterator().next().toString()); } - - /** * Verify that cached assertions that are expired are never be accessible * by {@link org.jasig.cas.client.jaas.CasLoginModule#login()} method. diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/proxy/CleanUpTimerTaskTest.java b/cas-client-core/src/test/java/org/jasig/cas/client/proxy/CleanUpTimerTaskTest.java index 55d0d5d..a831de5 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/proxy/CleanUpTimerTaskTest.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/proxy/CleanUpTimerTaskTest.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import java.util.TimerTask; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImplTest.java b/cas-client-core/src/test/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImplTest.java index 746ada9..d68eb5c 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImplTest.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImplTest.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import junit.framework.TestCase; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/session/SingleSignoutHandlerTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/session/SingleSignoutHandlerTests.java index 16a18c0..f263e44 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/session/SingleSignoutHandlerTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/session/SingleSignoutHandlerTests.java @@ -1,3 +1,21 @@ +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at the following location: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.jasig.cas.client.session; import org.junit.Before; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/ssl/RegexHostnameVerifierTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/ssl/RegexHostnameVerifierTests.java index 91996ff..31448fe 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/ssl/RegexHostnameVerifierTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/ssl/RegexHostnameVerifierTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - /* $Id$ diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifierTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifierTests.java index 9fe857e..ae3f4fe 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifierTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/ssl/WhitelistHostnameVerifierTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - /* $Id$ diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/util/CasFilterTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/util/CasFilterTests.java index 01da8bf..f44d256 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/util/CasFilterTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/util/CasFilterTests.java @@ -1,3 +1,21 @@ +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at the following location: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.jasig.cas.client.util; import org.junit.Test; @@ -36,8 +54,6 @@ public final class CasFilterTests { testCasFilter.setServerName(serverNameWithSlash); assertTrue(testCasFilter.constructServiceUrl(request, response).startsWith("http://www.cnn.com/cas/test")); - - } private static class TestCasFilter extends AbstractCasFilter { diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/util/CommonUtilsTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/util/CommonUtilsTests.java index e2435c2..7b6ff06 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/util/CommonUtilsTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/util/CommonUtilsTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import junit.framework.TestCase; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilterTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilterTests.java index 74b1c61..aa620a1 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilterTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/util/HttpServletRequestWrapperFilterTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import junit.framework.TestCase; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/util/MethodFlag.java b/cas-client-core/src/test/java/org/jasig/cas/client/util/MethodFlag.java index cf39d46..0ec5fec 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/util/MethodFlag.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/util/MethodFlag.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; /** diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/util/ReflectUtilsTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/util/ReflectUtilsTests.java index 47d50f1..34ca547 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/util/ReflectUtilsTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/util/ReflectUtilsTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.util; import junit.framework.TestCase; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/AbstractTicketValidatorTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/AbstractTicketValidatorTests.java index fa6036f..77af2b8 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/AbstractTicketValidatorTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/AbstractTicketValidatorTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; /** diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/AssertionImplTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/AssertionImplTests.java index d94d2a8..c790f69 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/AssertionImplTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/AssertionImplTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import junit.framework.TestCase; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas10TicketValidatorTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas10TicketValidatorTests.java index 7a8a991..bda0211 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas10TicketValidatorTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas10TicketValidatorTests.java @@ -1,25 +1,22 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; - - import org.jasig.cas.client.PublicTestHttpServer; import org.junit.AfterClass; import org.junit.Before; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilterTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilterTests.java index 8539f95..073ad3f 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilterTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilterTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import junit.framework.TestCase; @@ -179,8 +178,6 @@ public void testCallsCleanAllOnSchedule() throws Exception { config3.addInitParameter("casServerUrlPrefix", "https://cas.jasig.org/"); assertNotNull(filter.getTicketValidator(config3)); } - - /** * construct a working {@link org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter} diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidatorTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidatorTests.java index 691d89b..b374cae 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidatorTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidatorTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.PublicTestHttpServer; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidatorTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidatorTests.java index 0b1f137..71e4f39 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidatorTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidatorTests.java @@ -1,25 +1,22 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; - - import org.jasig.cas.client.PublicTestHttpServer; import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage; import org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl; diff --git a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Saml11TicketValidatorTests.java b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Saml11TicketValidatorTests.java index 8ec7977..6b2e562 100644 --- a/cas-client-core/src/test/java/org/jasig/cas/client/validation/Saml11TicketValidatorTests.java +++ b/cas-client-core/src/test/java/org/jasig/cas/client/validation/Saml11TicketValidatorTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.validation; import org.jasig.cas.client.PublicTestHttpServer; diff --git a/cas-client-core/src/test/resources/cas20ProxyTicketValidator.xml b/cas-client-core/src/test/resources/cas20ProxyTicketValidator.xml index 3f38389..3a069da 100644 --- a/cas-client-core/src/test/resources/cas20ProxyTicketValidator.xml +++ b/cas-client-core/src/test/resources/cas20ProxyTicketValidator.xml @@ -5,20 +5,19 @@ for additional information regarding copyright ownership. Jasig licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a - copy of the License at: + except in compliance with the License. You may obtain a + copy of the License at the following location: - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on - an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - provided jar true + + + commons-logging + commons-logging + +
@@ -514,6 +520,10 @@ bouncycastle bcprov-jdk14 + + commons-logging + commons-logging + @@ -531,7 +541,11 @@ jndi jndi - + + + commons-logging + commons-logging + @@ -542,8 +556,6 @@ - - atlassian @@ -551,6 +563,4 @@ http://repository.atlassian.com/maven2/ - - diff --git a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Confluence35CasAuthenticator.java b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Confluence35CasAuthenticator.java index d1f4dcb..7ffe254 100644 --- a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Confluence35CasAuthenticator.java +++ b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Confluence35CasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.integration.atlassian; import com.atlassian.confluence.event.events.security.LoginEvent; @@ -24,10 +23,10 @@ import com.atlassian.confluence.event.events.security.LoginFailedEvent; import com.atlassian.confluence.user.ConfluenceAuthenticator; import com.atlassian.seraph.auth.AuthenticatorException; import com.atlassian.seraph.auth.LoginReason; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.AbstractCasFilter; import org.jasig.cas.client.validation.Assertion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -49,14 +48,12 @@ import java.security.Principal; public final class Confluence35CasAuthenticator extends ConfluenceAuthenticator { private static final long serialVersionUID = -6097438206488390678L; - private static final Log LOG = LogFactory.getLog(Confluence35CasAuthenticator.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Confluence35CasAuthenticator.class); public Principal getUser(final HttpServletRequest request, final HttpServletResponse response) { Principal existingUser = getUserFromSession(request); if (existingUser != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Session found; user already logged in."); - } + LOGGER.debug("Session found; user already logged in."); LoginReason.OK.stampRequestResponse(request, response); return existingUser; } @@ -76,13 +73,9 @@ public final class Confluence35CasAuthenticator extends ConfluenceAuthenticator // Firing this event is necessary to ensure the user's personal information is initialised correctly. getEventPublisher().publish(new LoginEvent(this, username, request.getSession().getId(), remoteHost, remoteIP)); LoginReason.OK.stampRequestResponse(request, response); - if (LOG.isDebugEnabled()) { - LOG.debug("Logging in [" + username + "] from CAS."); - } + LOGGER.debug("Logging in [{}] from CAS.", username); } else { - if (LOG.isDebugEnabled()) { - LOG.debug("Failed logging [" + username + "] from CAS."); - } + LOGGER.debug("Failed logging [{}] from CAS.", username); getElevatedSecurityGuard().onFailedLoginAttempt(request, username); getEventPublisher().publish(new LoginFailedEvent(this, username, request.getSession().getId(), remoteHost, remoteIP)); } @@ -97,8 +90,8 @@ public final class Confluence35CasAuthenticator extends ConfluenceAuthenticator final Principal principal = (Principal) session.getAttribute(LOGGED_IN_KEY); - if (LOG.isDebugEnabled() && principal != null) { - LOG.debug("Logging out [" + principal.getName() + "] from CAS."); + if (principal != null) { + LOGGER.debug("Logging out [{}] from CAS.", principal.getName()); } removePrincipalFromSessionContext(request); diff --git a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/ConfluenceCasAuthenticator.java b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/ConfluenceCasAuthenticator.java index 3f88bea..398d9ee 100644 --- a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/ConfluenceCasAuthenticator.java +++ b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/ConfluenceCasAuthenticator.java @@ -1,30 +1,29 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.integration.atlassian; import com.atlassian.confluence.user.ConfluenceAuthenticator; import com.atlassian.seraph.auth.AuthenticatorException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.AbstractCasFilter; import org.jasig.cas.client.validation.Assertion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -45,16 +44,14 @@ public final class ConfluenceCasAuthenticator extends ConfluenceAuthenticator { /** ConfluenceCasAuthenticator.java */ private static final long serialVersionUID = -6097438206488390677L; - private static final Log LOG = LogFactory.getLog(ConfluenceCasAuthenticator.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ConfluenceCasAuthenticator.class); public Principal getUser(final HttpServletRequest request, final HttpServletResponse response) { final HttpSession session = request.getSession(); // user already exists if (session.getAttribute(LOGGED_IN_KEY) != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Session found; user already logged in."); - } + LOGGER.debug("Session found; user already logged in."); return (Principal) session.getAttribute(LOGGED_IN_KEY); } @@ -63,9 +60,7 @@ public final class ConfluenceCasAuthenticator extends ConfluenceAuthenticator { if (assertion != null) { final Principal p = getUser(assertion.getPrincipal().getName()); - if (LOG.isDebugEnabled()) { - LOG.debug("Logging in [" + p.getName() + "] from CAS."); - } + LOGGER.debug("Logging in [{}] from CAS.", p.getName()); session.setAttribute(LOGGED_IN_KEY, p); session.setAttribute(LOGGED_OUT_KEY, null); @@ -80,9 +75,7 @@ public final class ConfluenceCasAuthenticator extends ConfluenceAuthenticator { final Principal principal = (Principal) session.getAttribute(LOGGED_IN_KEY); - if (LOG.isDebugEnabled()) { - LOG.debug("Logging out [" + principal.getName() + "] from CAS."); - } + LOGGER.debug("Logging out [{}] from CAS.", principal.getName()); session.setAttribute(LOGGED_OUT_KEY, principal); session.setAttribute(LOGGED_IN_KEY, null); diff --git a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Jira44CasAuthenticator.java b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Jira44CasAuthenticator.java index 689561d..7f603d5 100644 --- a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Jira44CasAuthenticator.java +++ b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/Jira44CasAuthenticator.java @@ -1,31 +1,30 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.integration.atlassian; import com.atlassian.jira.security.login.JiraSeraphAuthenticator; import com.atlassian.seraph.auth.AuthenticatorException; import com.atlassian.seraph.auth.LoginReason; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.AbstractCasFilter; import org.jasig.cas.client.validation.Assertion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -47,15 +46,13 @@ public final class Jira44CasAuthenticator extends JiraSeraphAuthenticator { /** Jira43CasAuthenticator.java */ private static final long serialVersionUID = 3852011252741183166L; - private static final Log LOG = LogFactory.getLog(Jira44CasAuthenticator.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Jira44CasAuthenticator.class); public Principal getUser(final HttpServletRequest request, final HttpServletResponse response) { // First, check to see if this session has already been authenticated during a previous request. Principal existingUser = getUserFromSession(request); if (existingUser != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Session found; user already logged in."); - } + LOGGER.debug("Session found; user already logged in."); } final HttpSession session = request.getSession(); @@ -69,13 +66,9 @@ public final class Jira44CasAuthenticator extends JiraSeraphAuthenticator { putPrincipalInSessionContext(request, user); getElevatedSecurityGuard().onSuccessfulLoginAttempt(request, username); LoginReason.OK.stampRequestResponse(request, response); - if (LOG.isDebugEnabled()) { - LOG.debug("Logging in [" + username + "] from CAS."); - } + LOGGER.debug("Logging in [{}] from CAS.", username); } else { - if (LOG.isDebugEnabled()) { - LOG.debug("Failed logging [" + username + "] from CAS."); - } + LOGGER.debug("Failed logging [{}] from CAS.", username); getElevatedSecurityGuard().onFailedLoginAttempt(request, username); } return user; @@ -88,8 +81,8 @@ public final class Jira44CasAuthenticator extends JiraSeraphAuthenticator { final HttpSession session = request.getSession(); final Principal p = (Principal) session.getAttribute(LOGGED_IN_KEY); - if (LOG.isDebugEnabled() && p != null) { - LOG.debug("Logging out [" + p.getName() + "] from CAS."); + if (p != null) { + LOGGER.debug("Logging out [{}] from CAS.", p.getName()); } removePrincipalFromSessionContext(request); diff --git a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/JiraCasAuthenticator.java b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/JiraCasAuthenticator.java index aeb48f1..4c8078f 100644 --- a/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/JiraCasAuthenticator.java +++ b/cas-client-integration-atlassian/src/main/java/org/jasig/cas/client/integration/atlassian/JiraCasAuthenticator.java @@ -1,33 +1,31 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.integration.atlassian; import com.atlassian.seraph.auth.DefaultAuthenticator; import com.atlassian.seraph.auth.AuthenticatorException; import com.opensymphony.user.EntityNotFoundException; -import com.opensymphony.user.User; import com.opensymphony.user.UserManager; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.AbstractCasFilter; import org.jasig.cas.client.validation.Assertion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -48,7 +46,7 @@ public final class JiraCasAuthenticator extends DefaultAuthenticator { /** JiraCasAuthenticator.java */ private static final long serialVersionUID = 3452011252741183166L; - private static final Log LOG = LogFactory.getLog(JiraCasAuthenticator.class); + private static final Logger LOGGER = LoggerFactory.getLogger(JiraCasAuthenticator.class); @Override protected boolean authenticate(final Principal principal, final String password) throws AuthenticatorException { @@ -60,7 +58,7 @@ public final class JiraCasAuthenticator extends DefaultAuthenticator { try { return UserManager.getInstance().getUser(username); } catch (final EntityNotFoundException e) { - LOG.warn("Could not find user '" + username + "' in UserManager : " + e); + LOGGER.warn("Could not find user '{}' in UserManager : {}", username, e); } return null; } @@ -70,9 +68,7 @@ public final class JiraCasAuthenticator extends DefaultAuthenticator { // user already exists if (session.getAttribute(LOGGED_IN_KEY) != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Session found; user already logged in."); - } + LOGGER.debug("Session found; user already logged in."); return (Principal) session.getAttribute(LOGGED_IN_KEY); } @@ -81,9 +77,7 @@ public final class JiraCasAuthenticator extends DefaultAuthenticator { if (assertion != null) { final Principal p = getUser(assertion.getPrincipal().getName()); - if (LOG.isDebugEnabled()) { - LOG.debug("Logging in [" + p.getName() + "] from CAS."); - } + LOGGER.debug("Logging in [{}] from CAS.", p.getName()); session.setAttribute(LOGGED_IN_KEY, p); session.setAttribute(LOGGED_OUT_KEY, null); @@ -97,9 +91,7 @@ public final class JiraCasAuthenticator extends DefaultAuthenticator { final HttpSession session = request.getSession(); final Principal p = (Principal) session.getAttribute(LOGGED_IN_KEY); - if (LOG.isDebugEnabled()) { - LOG.debug("Logging out [" + p.getName() + "] from CAS."); - } + LOGGER.debug("Logging out [{}] from CAS.", p.getName()); session.setAttribute(LOGGED_OUT_KEY, p); session.setAttribute(LOGGED_IN_KEY, null); diff --git a/cas-client-integration-jboss/pom.xml b/cas-client-integration-jboss/pom.xml index b631df1..1e2e17c 100644 --- a/cas-client-integration-jboss/pom.xml +++ b/cas-client-integration-jboss/pom.xml @@ -47,6 +47,10 @@ javax.security jacc + + commons-logging + commons-logging + @@ -59,8 +63,6 @@ https://repository.jboss.org/nexus/content/groups/public// - - 6.1.0.Final diff --git a/cas-client-integration-jboss/src/main/java/org/jasig/cas/client/jboss/authentication/WebAuthenticationFilter.java b/cas-client-integration-jboss/src/main/java/org/jasig/cas/client/jboss/authentication/WebAuthenticationFilter.java index 9eefd67..6c67073 100644 --- a/cas-client-integration-jboss/src/main/java/org/jasig/cas/client/jboss/authentication/WebAuthenticationFilter.java +++ b/cas-client-integration-jboss/src/main/java/org/jasig/cas/client/jboss/authentication/WebAuthenticationFilter.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.jboss.authentication; import java.io.IOException; @@ -63,17 +62,17 @@ public final class WebAuthenticationFilter extends AbstractCasFilter { if (session != null && session.getAttribute(CONST_CAS_ASSERTION) == null && ticket != null) { try { final String service = constructServiceUrl(request, response); - log.debug("Attempting CAS ticket validation with service=" + service + " and ticket=" + ticket); + logger.debug("Attempting CAS ticket validation with service={} and ticket={}", service, ticket); if (!new WebAuthentication().login(service, ticket)) { - log.debug("JBoss Web authentication failed."); + logger.debug("JBoss Web authentication failed."); throw new GeneralSecurityException("JBoss Web authentication failed."); } if (request.getUserPrincipal() instanceof AssertionPrincipal) { final AssertionPrincipal principal = (AssertionPrincipal) request.getUserPrincipal(); - log.debug("Installing CAS assertion into session."); + logger.debug("Installing CAS assertion into session."); request.getSession().setAttribute(CONST_CAS_ASSERTION, principal.getAssertion()); } else { - log.debug("Aborting -- principal is not of type AssertionPrincipal"); + logger.debug("Aborting -- principal is not of type AssertionPrincipal"); throw new GeneralSecurityException("JBoss Web authentication did not produce CAS AssertionPrincipal."); } } catch (final GeneralSecurityException e) { @@ -83,7 +82,7 @@ public final class WebAuthenticationFilter extends AbstractCasFilter { // There is evidence that in some cases the principal can disappear // in JBoss despite a valid session. // This block forces consistency between principal and assertion. - log.info("User principal not found. Removing CAS assertion from session to force re-authentication."); + logger.info("User principal not found. Removing CAS assertion from session to force re-authentication."); session.removeAttribute(CONST_CAS_ASSERTION); } chain.doFilter(request, response); diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AbstractLogoutHandler.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AbstractLogoutHandler.java index bc86606..d298920 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AbstractLogoutHandler.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AbstractLogoutHandler.java @@ -1,33 +1,32 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.AbstractCasFilter; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.validation.Assertion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Base class for all logout handlers. @@ -38,7 +37,7 @@ import org.jasig.cas.client.validation.Assertion; */ public abstract class AbstractLogoutHandler implements LogoutHandler { - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); protected String redirectUrl; @@ -48,20 +47,20 @@ public abstract class AbstractLogoutHandler implements LogoutHandler { /** {@inheritDoc} */ public void logout(final HttpServletRequest request, final HttpServletResponse response) { - log.debug("Processing logout request from CAS server."); + logger.debug("Processing logout request from CAS server."); final Assertion assertion; final HttpSession httpSession = request.getSession(false); if (httpSession != null && (assertion = (Assertion) httpSession.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION)) != null) { httpSession.removeAttribute(AbstractCasFilter.CONST_CAS_ASSERTION); - log.info("Successfully logged out " + assertion.getPrincipal()); + logger.info("Successfully logged out {}", assertion.getPrincipal()); } else { - log.info("Session already ended."); + logger.info("Session already ended."); } final String redirectUrl = constructRedirectUrl(request); if (redirectUrl != null) { - log.debug("Redirecting to " + redirectUrl); + logger.debug("Redirecting to {}", redirectUrl); CommonUtils.sendRedirect(response, redirectUrl); } } diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AssertionCasRealmDelegate.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AssertionCasRealmDelegate.java index 88b4b82..7d26c2a 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AssertionCasRealmDelegate.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AssertionCasRealmDelegate.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import java.security.Principal; @@ -47,8 +46,6 @@ public class AssertionCasRealmDelegate implements CasRealm { /** Name of the role attribute in the principal's attributes */ private String roleAttributeName = DEFAULT_ROLE_NAME; - - /** * @param name Name of the attribute in the principal that contains role data. */ diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AuthenticatorDelegate.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AuthenticatorDelegate.java index 3b26601..61209d0 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AuthenticatorDelegate.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/AuthenticatorDelegate.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import java.io.IOException; @@ -26,13 +25,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.AbstractCasFilter; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.validation.Assertion; import org.jasig.cas.client.validation.TicketValidationException; import org.jasig.cas.client.validation.TicketValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Version-agnostic authenticator which encapsulates the core CAS workflow of @@ -49,7 +48,7 @@ import org.jasig.cas.client.validation.TicketValidator; public final class AuthenticatorDelegate { /** Log instance */ - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private String serviceUrl; @@ -86,19 +85,19 @@ public final class AuthenticatorDelegate { assertion = (Assertion) session.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION); } if (assertion == null) { - log.debug("CAS assertion not found in session -- authentication required."); + logger.debug("CAS assertion not found in session -- authentication required."); final String token = request.getParameter(this.artifactParameterName); final String service = CommonUtils.constructServiceUrl(request, response, this.serviceUrl, this.serverName, this.artifactParameterName, true); if (CommonUtils.isBlank(token)) { final String redirectUrl = CommonUtils.constructRedirectUrl(this.casServerLoginUrl, this.serviceParameterName, service, false, false); - log.debug("Redirecting to " + redirectUrl); + logger.debug("Redirecting to {}", redirectUrl); CommonUtils.sendRedirect(response, redirectUrl); return null; } try { - log.debug("Attempting to validate " + token + " for " + service); + logger.debug("Attempting to validate {} for {}", token, service); assertion = this.ticketValidator.validate(token, service); - log.debug("CAS authentication succeeded."); + logger.debug("CAS authentication succeeded."); if (session == null) { session = request.getSession(true); } @@ -110,7 +109,7 @@ public final class AuthenticatorDelegate { } Principal p = realm.authenticate(assertion.getPrincipal()); if (p == null) { - log.debug(assertion.getPrincipal().getName() + " failed to authenticate to " + realm); + logger.debug("{} failed to authenticate to {}", assertion.getPrincipal().getName(), realm); setUnauthorized(response, null); } return p; diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/CasRealm.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/CasRealm.java index 3e1a58b..6e221a2 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/CasRealm.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/CasRealm.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import java.security.Principal; diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/LogoutHandler.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/LogoutHandler.java index 0bd45b8..a53502b 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/LogoutHandler.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/LogoutHandler.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import javax.servlet.http.HttpServletRequest; diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegate.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegate.java index 9512cad..b2836b2 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegate.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegate.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import java.io.BufferedInputStream; @@ -26,9 +25,9 @@ import java.io.IOException; import java.security.Principal; import java.util.*; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.util.CommonUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * {@link CasRealm} implementation with users and roles defined by a properties @@ -49,7 +48,7 @@ import org.jasig.cas.client.util.CommonUtils; public class PropertiesCasRealmDelegate implements CasRealm { /** Log instance */ - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); /** Path to backing properties file */ private String propertiesFilePath; @@ -73,7 +72,7 @@ public class PropertiesCasRealmDelegate implements CasRealm { } CommonUtils.assertTrue(file.exists(), "File not found " + file); CommonUtils.assertTrue(file.canRead(), "Cannot read " + file); - log.debug("Loading users/roles from " + file); + logger.debug("Loading users/roles from {}", file); final Properties properties = new Properties(); try { properties.load(new BufferedInputStream(new FileInputStream(file))); diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/RegexUriLogoutHandler.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/RegexUriLogoutHandler.java index e50f75d..8a99556 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/RegexUriLogoutHandler.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/RegexUriLogoutHandler.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import java.util.regex.Pattern; diff --git a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/StaticUriLogoutHandler.java b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/StaticUriLogoutHandler.java index d4a4fdc..f6e85bd 100644 --- a/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/StaticUriLogoutHandler.java +++ b/cas-client-integration-tomcat-common/src/main/java/org/jasig/cas/client/tomcat/StaticUriLogoutHandler.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import javax.servlet.http.HttpServletRequest; diff --git a/cas-client-integration-tomcat-common/src/test/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegateTests.java b/cas-client-integration-tomcat-common/src/test/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegateTests.java index 3171906..b6e8436 100644 --- a/cas-client-integration-tomcat-common/src/test/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegateTests.java +++ b/cas-client-integration-tomcat-common/src/test/java/org/jasig/cas/client/tomcat/PropertiesCasRealmDelegateTests.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat; import java.security.Principal; diff --git a/cas-client-integration-tomcat-common/src/test/resources/org/jasig/cas/client/tomcat/user-roles.properties b/cas-client-integration-tomcat-common/src/test/resources/org/jasig/cas/client/tomcat/user-roles.properties index 81302fb..a72413d 100644 --- a/cas-client-integration-tomcat-common/src/test/resources/org/jasig/cas/client/tomcat/user-roles.properties +++ b/cas-client-integration-tomcat-common/src/test/resources/org/jasig/cas/client/tomcat/user-roles.properties @@ -4,15 +4,15 @@ # for additional information regarding copyright ownership. # Jasig licenses this file to you under the Apache License, # Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a -# copy of the License at: +# except in compliance with the License. You may obtain a +# copy of the License at the following location: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractAuthenticator.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractAuthenticator.java index 4e1c7cc..1960e52 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractAuthenticator.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleEvent; @@ -27,12 +26,12 @@ import org.apache.catalina.authenticator.AuthenticatorBase; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.deploy.LoginConfig; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.tomcat.AuthenticatorDelegate; import org.jasig.cas.client.tomcat.CasRealm; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.validation.TicketValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.security.Principal; @@ -46,7 +45,7 @@ import java.security.Principal; */ public abstract class AbstractAuthenticator extends AuthenticatorBase implements LifecycleListener { - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private final AuthenticatorDelegate delegate = new AuthenticatorDelegate(); @@ -84,7 +83,7 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements public void start() throws LifecycleException { super.start(); - this.log.debug(getName() + " starting."); + logger.debug("{} starting.", getName()); final Realm realm = this.context.getRealm(); try { CommonUtils.assertTrue(realm instanceof CasRealm, "Expected CasRealm but got " + realm.getInfo()); @@ -166,7 +165,7 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements /** {@inheritDoc} */ public void lifecycleEvent(final LifecycleEvent event) { if (AFTER_START_EVENT.equals(event.getType())) { - this.log.debug(getName() + " processing lifecycle event " + AFTER_START_EVENT); + logger.debug("{} processing lifecycle event {}", getName(), AFTER_START_EVENT); this.delegate.setTicketValidator(getTicketValidator()); this.delegate.setArtifactParameterName(getArtifactParameterName()); this.delegate.setServiceParameterName(getServiceParameterName()); diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasAuthenticator.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasAuthenticator.java index e4c84ac..921679a 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasAuthenticator.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; /** @@ -29,8 +28,6 @@ package org.jasig.cas.client.tomcat.v6; public abstract class AbstractCasAuthenticator extends AbstractAuthenticator { private String proxyCallbackUrl; - - protected final String getProxyCallbackUrl() { return this.proxyCallbackUrl; } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasRealm.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasRealm.java index a08cebc..932c76d 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasRealm.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractCasRealm.java @@ -1,30 +1,29 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import java.security.Principal; import org.apache.catalina.realm.RealmBase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.tomcat.CasRealm; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Base Realm implementation for all CAS realms. @@ -36,9 +35,7 @@ import org.jasig.cas.client.tomcat.CasRealm; public abstract class AbstractCasRealm extends RealmBase implements CasRealm { /** Logger instance */ - protected final Log log = LogFactory.getLog(getClass()); - - + protected final Logger logger = LoggerFactory.getLogger(getClass()); /** {@inheritDoc} */ public Principal authenticate(final Principal p) { return getDelegate().authenticate(p); diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLifecycleValve.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLifecycleValve.java index 50a0984..b511dc6 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLifecycleValve.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLifecycleValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.Lifecycle; @@ -24,8 +23,8 @@ import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleListener; import org.apache.catalina.util.LifecycleSupport; import org.apache.catalina.valves.ValveBase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Base Valve implementation for valves that need Catalina lifecycle @@ -38,7 +37,7 @@ import org.apache.commons.logging.LogFactory; public abstract class AbstractLifecycleValve extends ValveBase implements Lifecycle { /** Logger instance */ - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /** Lifecycle listeners */ private LifecycleSupport lifecycle = new LifecycleSupport(this); @@ -61,12 +60,12 @@ public abstract class AbstractLifecycleValve extends ValveBase implements Lifecy /** {@inheritDoc} */ public void start() throws LifecycleException { - log.debug(getName() + " starting."); + logger.debug("{} starting.", getName()); } /** {@inheritDoc} */ public void stop() throws LifecycleException { - log.debug(getName() + " stopping."); + logger.debug("{} stopping.", getName()); } /** diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLogoutValve.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLogoutValve.java index 8a9d8ee..eafa8d7 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLogoutValve.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AbstractLogoutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.connector.Request; @@ -43,7 +42,7 @@ public abstract class AbstractLogoutValve extends AbstractLifecycleValve { return; } - this.log.debug("URI is not a logout request: " + request.getRequestURI()); + logger.debug("URI is not a logout request: {}", request.getRequestURI()); getNext().invoke(request, response); } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AssertionCasRealm.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AssertionCasRealm.java index 9dcbc15..08fb69d 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AssertionCasRealm.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/AssertionCasRealm.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -40,7 +39,7 @@ public class AssertionCasRealm extends AbstractCasRealm { /** {@inheritDoc} */ public void start() throws LifecycleException { super.start(); - log.info("Startup completed."); + logger.info("Startup completed."); } /** diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas10CasAuthenticator.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas10CasAuthenticator.java index b30bdb4..46768d4 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas10CasAuthenticator.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas10CasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -54,6 +53,6 @@ public class Cas10CasAuthenticator extends AbstractCasAuthenticator { super.start(); this.ticketValidator = new Cas10TicketValidator(getCasServerUrlPrefix()); lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null); - log.info("Startup completed."); + logger.info("Startup completed."); } } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20CasAuthenticator.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20CasAuthenticator.java index 462094d..087d9e3 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20CasAuthenticator.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20CasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -60,6 +59,6 @@ public final class Cas20CasAuthenticator extends AbstractCasAuthenticator { this.ticketValidator.setProxyGrantingTicketStorage(ProxyCallbackValve.getProxyGrantingTicketStorage()); this.ticketValidator.setRenew(isRenew()); lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null); - this.log.info("Startup completed."); + logger.info("Startup completed."); } } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20ProxyCasAuthenticator.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20ProxyCasAuthenticator.java index cc577f0..41e86b7 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20ProxyCasAuthenticator.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Cas20ProxyCasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -75,6 +74,6 @@ public final class Cas20ProxyCasAuthenticator extends AbstractCasAuthenticator { this.ticketValidator.setEncoding(getEncoding()); } lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null); - this.log.info("Startup completed."); + logger.info("Startup completed."); } } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/PropertiesCasRealm.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/PropertiesCasRealm.java index 080d1ac..00d9e96 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/PropertiesCasRealm.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/PropertiesCasRealm.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -54,7 +53,7 @@ public class PropertiesCasRealm extends AbstractCasRealm { public void start() throws LifecycleException { super.start(); this.delegate.readProperties(); - this.log.info("Startup completed."); + logger.info("Startup completed."); } /** {@inheritDoc} */ diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/ProxyCallbackValve.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/ProxyCallbackValve.java index 3d1dc16..92fca01 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/ProxyCallbackValve.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/ProxyCallbackValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -73,12 +72,12 @@ public final class ProxyCallbackValve extends AbstractLifecycleValve { } catch (final Exception e) { throw new LifecycleException(e); } - this.log.info("Startup completed."); + logger.info("Startup completed."); } public void invoke(final Request request, final Response response) throws IOException, ServletException { if (this.proxyCallbackUrl.equals(request.getRequestURI())) { - this.log.debug("Processing proxy callback request."); + logger.debug("Processing proxy callback request."); CommonUtils.readAndRespondToProxyReceptorRequest(request, response, PROXY_GRANTING_TICKET_STORAGE); return; } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/RegexUriLogoutValve.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/RegexUriLogoutValve.java index 150e377..94e4bf2 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/RegexUriLogoutValve.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/RegexUriLogoutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -48,7 +47,7 @@ public final class RegexUriLogoutValve extends AbstractLogoutValve { public void start() throws LifecycleException { super.start(); this.logoutHandler.init(); - this.log.info("Startup completed."); + logger.info("Startup completed."); } /** {@inheritDoc} */ diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Saml11Authenticator.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Saml11Authenticator.java index 9247985..d349504 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Saml11Authenticator.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/Saml11Authenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -60,7 +59,7 @@ public class Saml11Authenticator extends AbstractAuthenticator { } this.ticketValidator.setRenew(isRenew()); lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null); - this.log.info("Startup completed."); + logger.info("Startup completed."); } protected TicketValidator getTicketValidator() { diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/SingleSignOutValve.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/SingleSignOutValve.java index d7c5d12..6e3549b 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/SingleSignOutValve.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/SingleSignOutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import java.io.IOException; @@ -64,7 +63,7 @@ public class SingleSignOutValve extends AbstractLifecycleValve implements Sessio public void start() throws LifecycleException { super.start(); handler.init(); - log.info("Startup completed."); + logger.info("Startup completed."); } /** {@inheritDoc} */ @@ -78,7 +77,7 @@ public class SingleSignOutValve extends AbstractLifecycleValve implements Sessio // Do not proceed up valve chain return; } else { - log.debug("Ignoring URI " + request.getRequestURI()); + logger.debug("Ignoring URI {}", request.getRequestURI()); } getNext().invoke(request, response); } @@ -87,7 +86,7 @@ public class SingleSignOutValve extends AbstractLifecycleValve implements Sessio /** {@inheritDoc} */ public void sessionEvent(final SessionEvent event) { if (Session.SESSION_DESTROYED_EVENT.equals(event.getType())) { - this.log.debug("Cleaning up SessionMappingStorage on destroySession event"); + logger.debug("Cleaning up SessionMappingStorage on destroySession event"); this.handler.getSessionMappingStorage().removeBySessionById(event.getSession().getId()); } } diff --git a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/StaticUriLogoutValve.java b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/StaticUriLogoutValve.java index 0ddbd09..845501f 100644 --- a/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/StaticUriLogoutValve.java +++ b/cas-client-integration-tomcat-v6/src/main/java/org/jasig/cas/client/tomcat/v6/StaticUriLogoutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v6; import org.apache.catalina.LifecycleException; @@ -48,7 +47,7 @@ public final class StaticUriLogoutValve extends AbstractLogoutValve { public void start() throws LifecycleException { super.start(); this.logoutHandler.init(); - this.log.info("Startup completed."); + logger.info("Startup completed."); } /** {@inheritDoc} */ diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractAuthenticator.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractAuthenticator.java index 1373676..a2d11d8 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractAuthenticator.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleEvent; @@ -27,12 +26,12 @@ import org.apache.catalina.Realm; import org.apache.catalina.authenticator.AuthenticatorBase; import org.apache.catalina.connector.Request; import org.apache.catalina.deploy.LoginConfig; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.tomcat.AuthenticatorDelegate; import org.jasig.cas.client.tomcat.CasRealm; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.validation.TicketValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -47,7 +46,7 @@ import java.security.Principal; */ public abstract class AbstractAuthenticator extends AuthenticatorBase implements LifecycleListener { - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private final AuthenticatorDelegate delegate = new AuthenticatorDelegate(); @@ -94,7 +93,7 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements protected void startInternal() throws LifecycleException { super.startInternal(); - this.log.debug(getName() + " starting."); + logger.debug("{} starting.", getName()); final Realm realm = this.context.getRealm(); try { CommonUtils.assertTrue(realm instanceof CasRealm, "Expected CasRealm but got " + realm.getInfo()); @@ -175,7 +174,7 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements /** {@inheritDoc} */ public void lifecycleEvent(final LifecycleEvent event) { if (AFTER_START_EVENT.equals(event.getType())) { - this.log.debug(getName() + " processing lifecycle event " + AFTER_START_EVENT); + logger.debug("{} processing lifecycle event {}", getName(), AFTER_START_EVENT); this.delegate.setTicketValidator(getTicketValidator()); this.delegate.setArtifactParameterName(getArtifactParameterName()); this.delegate.setServiceParameterName(getServiceParameterName()); @@ -191,7 +190,7 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements protected synchronized void setState(LifecycleState state, Object data) { super.setState(state, data); if (LifecycleState.STARTED.equals(state)) { - this.log.info(getName() + " started."); + logger.info("{} started.", getName()); } } diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasAuthenticator.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasAuthenticator.java index 1dfa263..7f451e8 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasAuthenticator.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; /** diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasRealm.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasRealm.java index 26091a3..1a5beb2 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasRealm.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractCasRealm.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import java.security.Principal; diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractLogoutValve.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractLogoutValve.java index dd24e28..b20289a 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractLogoutValve.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AbstractLogoutValve.java @@ -1,30 +1,29 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.valves.ValveBase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.tomcat.LogoutHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.ServletException; import java.io.IOException; @@ -40,7 +39,7 @@ import java.io.IOException; */ public abstract class AbstractLogoutValve extends ValveBase { - protected final Log log = LogFactory.getLog(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); public final void invoke(final Request request, final Response response) throws IOException, ServletException { if (getLogoutHandler().isLogoutRequest(request)) { @@ -49,7 +48,7 @@ public abstract class AbstractLogoutValve extends ValveBase { return; } - this.log.debug("URI is not a logout request: " + request.getRequestURI()); + logger.debug("URI is not a logout request: {}", request.getRequestURI()); getNext().invoke(request, response); } diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AssertionCasRealm.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AssertionCasRealm.java index edfddba..43bd27c 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AssertionCasRealm.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/AssertionCasRealm.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.jasig.cas.client.tomcat.AssertionCasRealmDelegate; diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas10CasAuthenticator.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas10CasAuthenticator.java index 3d2d593..4f82c9a 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas10CasAuthenticator.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas10CasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20CasAuthenticator.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20CasAuthenticator.java index c17d992..b8d2132 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20CasAuthenticator.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20CasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20ProxyCasAuthenticator.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20ProxyCasAuthenticator.java index cc3d275..3f17608 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20ProxyCasAuthenticator.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Cas20ProxyCasAuthenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/PropertiesCasRealm.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/PropertiesCasRealm.java index ce1dee1..39a3606 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/PropertiesCasRealm.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/PropertiesCasRealm.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/ProxyCallbackValve.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/ProxyCallbackValve.java index 5966ba1..6b78c14 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/ProxyCallbackValve.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/ProxyCallbackValve.java @@ -1,33 +1,32 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.valves.ValveBase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.util.ReflectUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.ServletException; import java.io.IOException; @@ -48,7 +47,7 @@ public final class ProxyCallbackValve extends ValveBase { private static ProxyGrantingTicketStorage PROXY_GRANTING_TICKET_STORAGE; /** Logger instance */ - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private String proxyGrantingTicketStorageClass; @@ -77,12 +76,12 @@ public final class ProxyCallbackValve extends ValveBase { } catch (final Exception e) { throw new LifecycleException(e); } - this.log.info("Startup completed."); + logger.info("Startup completed."); } public void invoke(final Request request, final Response response) throws IOException, ServletException { if (this.proxyCallbackUrl.equals(request.getRequestURI())) { - this.log.debug("Processing proxy callback request."); + logger.debug("Processing proxy callback request."); CommonUtils.readAndRespondToProxyReceptorRequest(request, response, PROXY_GRANTING_TICKET_STORAGE); return; } diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/RegexUriLogoutValve.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/RegexUriLogoutValve.java index c87ad7f..2b8ab8e 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/RegexUriLogoutValve.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/RegexUriLogoutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; @@ -46,7 +45,7 @@ public final class RegexUriLogoutValve extends AbstractLogoutValve { protected void startInternal() throws LifecycleException { super.startInternal(); this.logoutHandler.init(); - this.log.info("Startup completed."); + logger.info("Startup completed."); } /** {@inheritDoc} */ diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Saml11Authenticator.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Saml11Authenticator.java index 8487795..25281c9 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Saml11Authenticator.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/Saml11Authenticator.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; @@ -41,8 +40,6 @@ public final class Saml11Authenticator extends AbstractAuthenticator { /** SAML protocol clock drift tolerance in ms */ private int tolerance = -1; - - /** * @param ms SAML clock drift tolerance in milliseconds. */ diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/SingleSignOutValve.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/SingleSignOutValve.java index f1b0249..f314a03 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/SingleSignOutValve.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/SingleSignOutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import java.io.IOException; @@ -30,11 +29,11 @@ import org.apache.catalina.SessionListener; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.valves.ValveBase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jasig.cas.client.session.SessionMappingStorage; import org.jasig.cas.client.session.SingleSignOutHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handles logout request messages sent from the CAS server by ending the current @@ -48,7 +47,7 @@ import org.jasig.cas.client.session.SingleSignOutHandler; public class SingleSignOutValve extends ValveBase implements SessionListener { /** Logger instance */ - private final Log log = LogFactory.getLog(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private final SingleSignOutHandler handler = new SingleSignOutHandler(); @@ -63,8 +62,6 @@ public class SingleSignOutValve extends ValveBase implements SessionListener { public void setSessionMappingStorage(final SessionMappingStorage storage) { handler.setSessionMappingStorage(storage); } - - /** {@inheritDoc} */ public void invoke(final Request request, final Response response) throws IOException, ServletException { if (this.handler.isTokenRequest(request)) { @@ -76,7 +73,7 @@ public class SingleSignOutValve extends ValveBase implements SessionListener { // Do not proceed up valve chain return; } else { - this.log.debug("Ignoring URI " + request.getRequestURI()); + logger.debug("Ignoring URI {}", request.getRequestURI()); } getNext().invoke(request, response); } @@ -85,7 +82,7 @@ public class SingleSignOutValve extends ValveBase implements SessionListener { /** {@inheritDoc} */ public void sessionEvent(final SessionEvent event) { if (Session.SESSION_DESTROYED_EVENT.equals(event.getType())) { - this.log.debug("Cleaning up SessionMappingStorage on destroySession event"); + logger.debug("Cleaning up SessionMappingStorage on destroySession event"); this.handler.getSessionMappingStorage().removeBySessionById(event.getSession().getId()); } } @@ -93,8 +90,8 @@ public class SingleSignOutValve extends ValveBase implements SessionListener { /** {@inheritDoc} */ protected void startInternal() throws LifecycleException { super.startInternal(); - this.log.info("Starting..."); + logger.info("Starting..."); handler.init(); - this.log.info("Startup completed."); + logger.info("Startup completed."); } } diff --git a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/StaticUriLogoutValve.java b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/StaticUriLogoutValve.java index aaf5502..c3641e7 100644 --- a/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/StaticUriLogoutValve.java +++ b/cas-client-integration-tomcat-v7/src/main/java/org/jasig/cas/client/tomcat/v7/StaticUriLogoutValve.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.tomcat.v7; import org.apache.catalina.LifecycleException; @@ -46,7 +45,7 @@ public final class StaticUriLogoutValve extends AbstractLogoutValve { protected void startInternal() throws LifecycleException { super.startInternal(); this.logoutHandler.init(); - this.log.info("Startup completed."); + logger.info("Startup completed."); } /** {@inheritDoc} */ diff --git a/cas-client-support-distributed-ehcache/pom.xml b/cas-client-support-distributed-ehcache/pom.xml index 43c22fa..8d01ace 100644 --- a/cas-client-support-distributed-ehcache/pom.xml +++ b/cas-client-support-distributed-ehcache/pom.xml @@ -24,21 +24,11 @@ - net.sf.ehcache ehcache-core ${ehcache.version} compile jar - - - org.slf4j - slf4j-api - 1.6.1 - test - - - \ No newline at end of file diff --git a/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java b/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java index 5731292..d57ab63 100644 --- a/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java +++ b/cas-client-support-distributed-ehcache/src/main/java/org/jasig/cas/client/proxy/EhcacheBackedProxyGrantingTicketStorageImpl.java @@ -1,34 +1,29 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import net.sf.ehcache.Cache; import net.sf.ehcache.Element; import net.sf.ehcache.CacheManager; import net.sf.ehcache.distribution.RemoteCacheException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Scott Battaglia @@ -39,13 +34,13 @@ public final class EhcacheBackedProxyGrantingTicketStorageImpl extends AbstractE public static final String EHCACHE_CACHE_NAME = "org.jasig.cas.client.proxy.EhcacheBackedProxyGrantingTicketStorageImpl.cache"; - private static final Log log = LogFactory.getLog(EhcacheBackedProxyGrantingTicketStorageImpl.class); + private static final Logger logger = LoggerFactory.getLogger(EhcacheBackedProxyGrantingTicketStorageImpl.class); final Cache cache; public EhcacheBackedProxyGrantingTicketStorageImpl() { this(CacheManager.getInstance().getCache(EHCACHE_CACHE_NAME)); - log.info("Created cache with name: " + this.cache.getName()); + logger.info("Created cache with name: {}", this.cache.getName()); } public EhcacheBackedProxyGrantingTicketStorageImpl(final Cache cache) { @@ -58,7 +53,7 @@ public final class EhcacheBackedProxyGrantingTicketStorageImpl extends AbstractE try { this.cache.put(element); } catch (final RemoteCacheException e) { - log.warn("Exception accessing one of the remote servers: " + e.getMessage(), e); + logger.warn("Exception accessing one of the remote servers: {}", e.getMessage(), e); } } diff --git a/cas-client-support-distributed-ehcache/src/test/java/EhCacheBackedProxyGrantingTicketStorageImplTests.java b/cas-client-support-distributed-ehcache/src/test/java/EhCacheBackedProxyGrantingTicketStorageImplTests.java index ea56003..cefe949 100644 --- a/cas-client-support-distributed-ehcache/src/test/java/EhCacheBackedProxyGrantingTicketStorageImplTests.java +++ b/cas-client-support-distributed-ehcache/src/test/java/EhCacheBackedProxyGrantingTicketStorageImplTests.java @@ -1,3 +1,21 @@ +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at the following location: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ import junit.framework.TestCase; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; diff --git a/cas-client-support-distributed-memcached/src/main/java/org/jasig/cas/client/proxy/MemcachedBackedProxyGrantingTicketStorageImpl.java b/cas-client-support-distributed-memcached/src/main/java/org/jasig/cas/client/proxy/MemcachedBackedProxyGrantingTicketStorageImpl.java index 910eb8e..d58a291 100644 --- a/cas-client-support-distributed-memcached/src/main/java/org/jasig/cas/client/proxy/MemcachedBackedProxyGrantingTicketStorageImpl.java +++ b/cas-client-support-distributed-memcached/src/main/java/org/jasig/cas/client/proxy/MemcachedBackedProxyGrantingTicketStorageImpl.java @@ -1,22 +1,21 @@ -/** +/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: + * except in compliance with the License. You may obtain a + * copy of the License at the following location: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ - package org.jasig.cas.client.proxy; import net.spy.memcached.MemcachedClient; @@ -90,8 +89,6 @@ public final class MemcachedBackedProxyGrantingTicketStorageImpl extends Abstrac throw new IllegalStateException(e); } } - - public void saveInternal(final String proxyGrantingTicketIou, final String proxyGrantingTicket) { handleSynchronousRequest(this.client.add(proxyGrantingTicketIou, 120, proxyGrantingTicket)); } diff --git a/pom.xml b/pom.xml index 8cb137f..db7b342 100644 --- a/pom.xml +++ b/pom.xml @@ -1,207 +1,218 @@ - - org.jasig.parent - jasig-parent - 31 - - 4.0.0 - org.jasig.cas.client - 3.3-SNAPSHOT - cas-client - pom + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + org.jasig.parent + jasig-parent + 31 + + 4.0.0 + org.jasig.cas.client + 3.3-SNAPSHOT + cas-client + pom - Jasig CAS Client for Java - Jasig CAS Client for Java is the integration point for - applications that want to speak with a CAS - server, either via the CAS 1.0 or CAS 2.0 protocol. - - http://www.jasig.org/cas + Jasig CAS Client for Java + + Jasig CAS Client for Java is the integration point forapplications that want to speak with a CAS + server, either via the CAS 1.0 or CAS 2.0 protocol. + + http://www.jasig.org/cas - - JIRA - https://issues.jasig.org/browse/CASC - + + JIRA + https://issues.jasig.org/browse/CASC + - - scm:git:git@github.com:Jasig/java-cas-client.git - scm:git:git@github.com:Jasig/java-cas-client.git - https://github.com/Jasig/java-cas-client - + + scm:git:git@github.com:Jasig/java-cas-client.git + scm:git:git@github.com:Jasig/java-cas-client.git + https://github.com/Jasig/java-cas-client + - 2006 + 2006 - - - battags - Scott Battaglia - scott.battaglia@gmail.com - http://www.scottbattaglia.com - - Project Admin - Developer - - -5 - - - serac - Marvin S. Addison - marvin.addison@gmail.com - - Developer - - -5 - - + + + battags + Scott Battaglia + scott.battaglia@gmail.com + http://www.scottbattaglia.com + + Project Admin + Developer + + -5 + + + serac + Marvin S. Addison + marvin.addison@gmail.com + + Developer + + -5 + + - - Jasig - http://www.jasig.org - + + Jasig + http://www.jasig.org + - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2-beta-1 - - - ${basedir}/assembly.xml - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2-beta-1 + + + ${basedir}/assembly.xml + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.6 + + + **/*Tests* + + false + 1 + + + + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.2.1 + + forked-path + v@{project.version} + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.0 + + + enforce-banned-dependencies + + enforce + + + + + + commons-logging + + + + true + + + + + + com.mycila.maven-license-plugin + maven-license-plugin + +
src/licensing/header.txt
+ + src/licensing/header-definitions.xml + + true + + **/.idea/** + LICENSE + **/INSTALL* + **/NOTICE* + **/README* + **/readme* + **/*.log + **/*.license + **/*.txt + **/*.crt + **/*.crl + **/*.key + **/.gitignore + **/overlays/** + src/licensing/** + +
+
+
+
- - org.apache.maven.plugins - maven-surefire-plugin - 2.6 - - - **/*Tests* - - false - 1 - - - - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.2.1 - - forked-path - v@{project.version} - - - -
-
- - - - junit - junit - 4.8.2 - test - - - commons-logging - commons-logging - 1.1 - compile - - - log4j - log4j - - - logkit - logkit - - - avalon-framework - avalon-framework - - - - - javax.servlet - servlet-api - 2.4 - provided - - - - - cas-client-core - cas-client-integration-atlassian - cas-client-integration-jboss - cas-client-support-distributed-ehcache - cas-client-support-distributed-memcached - cas-client-integration-tomcat-common - cas-client-integration-tomcat-v6 - cas-client-integration-tomcat-v7 - - - - 2.2.0 - 3.0.2 - + + 2.2.0 + 3.0.2 + 1.7.1 +
diff --git a/src/licensing/header-definitions.xml b/src/licensing/header-definitions.xml new file mode 100644 index 0000000..39fb559 --- /dev/null +++ b/src/licensing/header-definitions.xml @@ -0,0 +1,12 @@ + + + + /* + * + */ + ( |\t)*/\*( |\t)*$ + ( |\t)*\*/( |\t)*$ + true + true + + \ No newline at end of file diff --git a/src/licensing/header.txt b/src/licensing/header.txt new file mode 100644 index 0000000..81fb427 --- /dev/null +++ b/src/licensing/header.txt @@ -0,0 +1,16 @@ +Licensed to Jasig under one or more contributor license +agreements. See the NOTICE file distributed with this work +for additional information regarding copyright ownership. +Jasig licenses this file to you under the Apache License, +Version 2.0 (the "License"); you may not use this file +except in compliance with the License. You may obtain a +copy of the License at the following location: + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. \ No newline at end of file