View Javadoc

1   /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.acegisecurity.providers.cas.cache;
16  
17  import org.acegisecurity.providers.cas.CasAuthenticationProvider;
18  import org.acegisecurity.providers.cas.CasAuthenticationToken;
19  import org.acegisecurity.providers.cas.StatelessTicketCache;
20  
21  /**
22   * Implementation of @link {@link StatelessTicketCache} that has no backing cache.  Useful
23   * in instances where storing of tickets for stateless session management is not required.
24   * <p>
25   * This is the default StatelessTicketCache of the @link {@link CasAuthenticationProvider} to
26   * eliminate the unnecessary dependency on EhCache that applications have even if they are not using
27   * the stateless session management.
28   * 
29   * @author Scott Battaglia
30   * @version $Id$
31   *
32   *@see CasAuthenticationProvider
33   */
34  public final class NullStatelessTicketCache implements StatelessTicketCache {
35  
36  	/**
37  	 * @return null since we are not storing any tickets.
38  	 */
39  	public CasAuthenticationToken getByTicketId(final String serviceTicket) {
40  		return null;
41  	}
42  
43  	/**
44  	 * This is a no-op since we are not storing tickets.
45  	 */
46  	public void putTicketInCache(final CasAuthenticationToken token) {
47  		// nothing to do
48  	}
49  
50  	/**
51  	 * This is a no-op since we are not storing tickets.
52  	 */
53  	public void removeTicketFromCache(final CasAuthenticationToken token) {
54  		// nothing to do
55  	}
56  
57  	/**
58  	 * This is a no-op since we are not storing tickets.
59  	 */
60  	public void removeTicketFromCache(final String serviceTicket) {
61  		// nothing to do
62  	}
63  }