01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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
35: StatelessTicketCache {
36:
37: /**
38: * @return null since we are not storing any tickets.
39: */
40: public CasAuthenticationToken getByTicketId(
41: final String serviceTicket) {
42: return null;
43: }
44:
45: /**
46: * This is a no-op since we are not storing tickets.
47: */
48: public void putTicketInCache(final CasAuthenticationToken token) {
49: // nothing to do
50: }
51:
52: /**
53: * This is a no-op since we are not storing tickets.
54: */
55: public void removeTicketFromCache(final CasAuthenticationToken token) {
56: // nothing to do
57: }
58:
59: /**
60: * This is a no-op since we are not storing tickets.
61: */
62: public void removeTicketFromCache(final String serviceTicket) {
63: // nothing to do
64: }
65: }
|