Listener for user session timeouts
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 12 Nov 2006 23:15:28 +0000 (23:15 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 12 Nov 2006 23:15:28 +0000 (23:15 +0000)
Login/Logout events

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2075 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/session/ContainerSessionListener.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/session/LoginEvent.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/session/LogoutEvent.java [new file with mode: 0644]

diff --git a/src/edu/internet2/middleware/shibboleth/idp/session/ContainerSessionListener.java b/src/edu/internet2/middleware/shibboleth/idp/session/ContainerSessionListener.java
new file mode 100644 (file)
index 0000000..a1b198d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright [2006] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed 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
+ *
+ * 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 edu.internet2.middleware.shibboleth.idp.session;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * A listener that listens for the destruction of {@link HttpSession}s.  This allows
+ * the {@link SessionManager} to appropriately destroy a shibboleth session whether the 
+ * HTTP session is destroyed explicitly or through inactivity.
+ */
+public class ContainerSessionListener implements HttpSessionListener {
+
+    /**
+     * A no-op operation.
+     */
+    public void sessionCreated(HttpSessionEvent arg0) {
+        // we don't care about session creations
+    }
+
+    /** {@inheritDoc} */
+    public void sessionDestroyed(HttpSessionEvent arg0) {
+        // TODO Auto-generated method stub
+
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/session/LoginEvent.java b/src/edu/internet2/middleware/shibboleth/idp/session/LoginEvent.java
new file mode 100644 (file)
index 0000000..6cdfac0
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright [2006] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed 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
+ *
+ * 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 edu.internet2.middleware.shibboleth.idp.session;
+
+import org.springframework.context.ApplicationEvent;
+
+/**
+ * An event representing the creation of a Shibboleth session that occured 
+ * because a user logged into the system.
+ */
+public class LoginEvent extends ApplicationEvent {
+
+    public LoginEvent(SessionManager sessionManager){
+        super(sessionManager);
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/session/LogoutEvent.java b/src/edu/internet2/middleware/shibboleth/idp/session/LogoutEvent.java
new file mode 100644 (file)
index 0000000..0e92e11
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright [2006] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed 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
+ *
+ * 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 edu.internet2.middleware.shibboleth.idp.session;
+
+import org.springframework.context.ApplicationEvent;
+
+/**
+ * An event representing the destruction of a Shibboleth session that occured 
+ * because a user logged out of the system or because the application timed out.
+ */
+public class LogoutEvent extends ApplicationEvent {
+
+    public LogoutEvent(SessionManager sessionManager){
+        super(sessionManager);
+    }
+}