01: /* Copyright 2006 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.security.provider;
07:
08: import org.jasig.portal.security.PortalSecurityException;
09:
10: /**
11: * <p>
12: * A SecurityContext that can never be authenticated.
13: * </p>
14: * <p>An unauthenticatable security context which a security context factory
15: * may return in the case where its initialization of the security context it was supposed
16: * to return failed. This allows a security context factory to "fail gracefully",
17: * fulfilling its API contract and allowing other security contexts in the chain to
18: * continue to operate.<p>
19: * <p>
20: * This class is a descendent of edu.yale.its.tp.portal.security.BrokenSecurityContext,
21: * which was distributed in the Yale CAS uPortal security provider module version
22: * 3.0.0.</p>
23: *
24: * @version $Revision$ $Date$
25: */
26: public class BrokenSecurityContext extends ChainingSecurityContext {
27:
28: private static final long serialVersionUID = 1L;
29:
30: public static final int BROKEN_AUTH_TYPE = 666;
31:
32: /**
33: * Instantiate a BrokenSecurityContext
34: */
35: public BrokenSecurityContext() {
36: super ();
37: }
38:
39: public int getAuthType() {
40: return BROKEN_AUTH_TYPE;
41: }
42:
43: public void authenticate() throws PortalSecurityException {
44: if (log.isTraceEnabled()) {
45: log.trace("entering authenticate()");
46: }
47: // Note that this.isauth is still false.
48: super .authenticate();
49: if (log.isTraceEnabled()) {
50: log.trace("returning from authenticate()");
51: }
52: return;
53: }
54:
55: public String toString() {
56: StringBuffer sb = new StringBuffer();
57: sb.append(this.getClass().getName());
58: return sb.toString();
59: }
60: }
|