001: /*
002: * JOSSO: Java Open Single Sign-On
003: *
004: * Copyright 2004-2008, Atricore, Inc.
005: *
006: * This is free software; you can redistribute it and/or modify it
007: * under the terms of the GNU Lesser General Public License as
008: * published by the Free Software Foundation; either version 2.1 of
009: * the License, or (at your option) any later version.
010: *
011: * This software is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this software; if not, write to the Free
018: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
020: */
021: package org.josso.gateway.event.security;
022:
023: import org.josso.auth.Credential;
024: import org.josso.gateway.event.SSOEvent;
025: import org.josso.gateway.event.SSOEventManagerImpl;
026:
027: /**
028: * This is the default implementation of the SSOSecurityEventManager
029: *
030: * @author <a href="mailto:sgonzalez@josso.org">Sebastian Gonzalez Oyuela</a>
031: * @version $Id: SSOSecurityEventManagerImpl.java 508 2008-02-18 13:32:29Z sgonzalez $
032: */
033: public abstract class SSOSecurityEventManagerImpl extends
034: SSOEventManagerImpl implements SSOSecurityEventManager {
035:
036: /**
037: * This method creates a new SSOIdentityEvent and invokes the fireSSOEvent method.
038: *
039: * @see #fireSSOEvent
040: */
041: public void fireAuthenticationFailureEvent(String remoteHost,
042: String scheme, Credential[] credentials, Throwable error) {
043: SSOIdentityEvent event = new SSOIdentityEvent(remoteHost,
044: scheme, credentials, error);
045: fireSSOEvent(event);
046: }
047:
048: /**
049: * This method creates a new SSOIdentityEvent and invokes the fireSSOEvent method.
050: *
051: * @see #fireSSOEvent
052: */
053: public void fireAuthenticationSuccessEvent(String remoteHost,
054: String scheme, String username, String sessionId) {
055: SSOIdentityEvent event = new SSOIdentityEvent(remoteHost,
056: scheme, username, sessionId);
057: fireSSOEvent(event);
058:
059: }
060:
061: /**
062: * This method creates a new SSOIdentityEvent and invokes the fireSSOEvent method.
063: *
064: * @see #fireSSOEvent
065: */
066: public void fireLogoutSuccessEvent(String remoteHost,
067: String username, String sessionId) {
068: SSOIdentityEvent event = new SSOIdentityEvent(remoteHost,
069: username, sessionId);
070: fireSSOEvent(event);
071: }
072:
073: /**
074: * This method creates a new SSOIdentityEvent and invokes the fireSSOEvent method.
075: *
076: * @see #fireSSOEvent
077: */
078: public void fireLogoutFailureEvent(String remoteHost,
079: String username, String sessionId, Throwable error) {
080: SSOIdentityEvent event = new SSOIdentityEvent(remoteHost,
081: username, sessionId, error);
082: fireSSOEvent(event);
083: }
084:
085: /**
086: * This method creates a new SSOIdentityEvent and invokes the fireSSOEvent method.
087: *
088: * @see #fireSSOEvent
089: */
090: public void fireSessionEvent(String username, String sessionId,
091: String type, Object data) {
092: SSOEvent event = new SSOSessionEvent(username, sessionId, type,
093: data);
094: fireSSOEvent(event);
095: }
096:
097: public void fireSessionFailureEvent(String username,
098: String sessionId, String type, Throwable error) {
099: SSOEvent event = new SSOSessionEvent(username, sessionId, type,
100: error);
101: fireSSOEvent(event);
102: }
103:
104: }
|