/** * Notifies users that a <code>ChatRoom</code> has been activated. * * @param room - the <code>ChatRoom</code> that has been activated. */ protected void fireChatRoomActivated( ChatRoom room ) { for ( final ChatRoomListener listener : chatRoomListeners ) { try { listener.chatRoomActivated( room ); } catch ( Exception e ) { Log.error( "A ChatRoomListener (" + listener + ") threw an exception while processing a 'activated' event for room: " + room, e ); } } }
/** * Notifies users that a <code>ChatRoom</code> has been closed. * * @param room - the <code>ChatRoom</code> that has been closed. */ protected void fireChatRoomClosed( ChatRoom room ) { for ( final ChatRoomListener listener : chatRoomListeners ) { try { listener.chatRoomClosed( room ); } catch ( Exception e ) { Log.error( "A ChatRoomListener (" + listener + ") threw an exception while processing a 'closed' event for room: " + room, e ); } } }
/** * Notifies users that a <code>ChatRoom</code> has been left. * * @param room - the <code>ChatRoom</code> that has been left */ protected void fireChatRoomLeft( ChatRoom room ) { for ( final ChatRoomListener listener : chatRoomListeners ) { try { listener.chatRoomLeft( room ); } catch ( Exception e ) { Log.error( "A ChatRoomListener (" + listener + ") threw an exception while processing a 'left' event for room: " + room, e ); } } }
/** * Notifies users that a <code>ChatRoom</code> has been opened. * * @param room - the <code>ChatRoom</code> that has been opened. */ protected void fireChatRoomOpened( ChatRoom room ) { for ( final ChatRoomListener listener : chatRoomListeners ) { try { listener.chatRoomOpened( room ); } catch ( Exception e ) { Log.error( "A ChatRoomListener (" + listener + ") threw an exception while processing a 'opened' event for room: " + room, e ); } } }
/** * Notifies users that a user has left a <code>ChatRoom</code>. * * @param room - the <code>ChatRoom</code> that a user has left. * @param userid - the userid of the person. */ protected void fireUserHasLeft( final ChatRoom room, final Resourcepart userid ) { SwingUtilities.invokeLater( () -> { for ( final ChatRoomListener listener : chatRoomListeners ) { try { listener.userHasLeft( room, userid.toString() ); } catch ( Exception e ) { Log.error( "A ChatRoomListener (" + listener + ") threw an exception while processing a 'user left' event for user '" + userid + "' in room: " + room, e ); } } } ); }
/** * Notifies users that a user has joined a <code>ChatRoom</code>. * * @param room - the <code>ChatRoom</code> that a user has joined. * @param userid - the userid of the person. */ protected void fireUserHasJoined( final ChatRoom room, final Resourcepart userid ) { SwingUtilities.invokeLater( () -> { for ( final ChatRoomListener listener : chatRoomListeners ) { try { listener.userHasJoined( room, userid.toString() ); } catch ( Exception e ) { Log.error( "A ChatRoomListener (" + listener + ") threw an exception while processing a 'user joined' event for user '" + userid + "' in room: " + room, e ); } } } ); }