Commit d9ab7138 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1221] Added listener for when resources are bound from Guus and updated...

[JM-1221] Added listener for when resources are bound from Guus and updated plugins/components that were using it.   (namely, sip, gateway, motd, and enterprise)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9883 b35dd754-fafc-0310-a699-88a17e54d16e
parent 06e6e405
...@@ -74,7 +74,10 @@ public class SessionEventDispatcher { ...@@ -74,7 +74,10 @@ public class SessionEventDispatcher {
listener.anonymousSessionDestroyed(session); listener.anonymousSessionDestroyed(session);
break; break;
} }
case resource_bound: {
listener.resourceBound(session);
break;
}
default: default:
break; break;
} }
...@@ -110,5 +113,9 @@ public class SessionEventDispatcher { ...@@ -110,5 +113,9 @@ public class SessionEventDispatcher {
*/ */
anonymous_session_destroyed, anonymous_session_destroyed,
/**
* A resource was bound to the session.
*/
resource_bound
} }
} }
\ No newline at end of file
...@@ -46,4 +46,11 @@ public interface SessionEventListener { ...@@ -46,4 +46,11 @@ public interface SessionEventListener {
* @param session the authenticated session of an anonymous user. * @param session the authenticated session of an anonymous user.
*/ */
public void anonymousSessionDestroyed(Session session); public void anonymousSessionDestroyed(Session session);
/**
* A session has finished resource binding.
*
* @param session the session on which resource binding was performed.
*/
public void resourceBound(Session session);
} }
\ No newline at end of file
...@@ -134,6 +134,8 @@ public class IQBindHandler extends IQHandler { ...@@ -134,6 +134,8 @@ public class IQBindHandler extends IQHandler {
child.addElement("jid").setText(session.getAddress().toString()); child.addElement("jid").setText(session.getAddress().toString());
// Send the response directly since a route does not exist at this point. // Send the response directly since a route does not exist at this point.
session.process(reply); session.process(reply);
// After the client has been informed, inform all listeners as well.
SessionEventDispatcher.dispatchEvent(session, EventType.resource_bound);
return null; return null;
} }
......
...@@ -283,6 +283,10 @@ public class ConnectionMultiplexerManager implements SessionEventListener { ...@@ -283,6 +283,10 @@ public class ConnectionMultiplexerManager implements SessionEventListener {
removeSession(session); removeSession(session);
} }
public void resourceBound(Session session) {
// Do nothing.
}
private void removeSession(Session session) { private void removeSession(Session session) {
// Remove trace indicating that a connection manager is hosting a connection // Remove trace indicating that a connection manager is hosting a connection
String streamID = session.getStreamID().getID(); String streamID = session.getStreamID().getID();
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<name>MotD (Message of the Day)</name> <name>MotD (Message of the Day)</name>
<description>Allows admins to have a message sent to users each time they log in.</description> <description>Allows admins to have a message sent to users each time they log in.</description>
<author>Ryan Graham</author> <author>Ryan Graham</author>
<version>1.0.3</version> <version>1.0.4</version>
<date>12/27/2007</date> <date>12/27/2007</date>
<minServerVersion>3.4.0</minServerVersion> <minServerVersion>3.5.0</minServerVersion>
<adminconsole> <adminconsole>
<tab id="tab-users"> <tab id="tab-users">
......
...@@ -92,6 +92,10 @@ public class MotDPlugin implements Plugin { ...@@ -92,6 +92,10 @@ public class MotDPlugin implements Plugin {
//ignore //ignore
} }
public void resourceBound(Session session) {
// Do nothing.
}
public void anonymousSessionCreated(Session session) { public void anonymousSessionCreated(Session session) {
//ignore //ignore
} }
......
...@@ -195,4 +195,8 @@ public class SipComponent implements Component, SessionEventListener { ...@@ -195,4 +195,8 @@ public class SipComponent implements Component, SessionEventListener {
} }
} }
public void resourceBound(Session session) {
// Do nothing.
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment