From 0e9194429e8ffde91d306e2d66529149ef05d1e5 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Mon, 26 Mar 2012 13:05:01 -0500 Subject: [PATCH] Issue #427 initial role based event handling Change-Id: I73d4df3f09c7cfa60025142ec5a4dccdad4423bb Former-commit-id: e76039c56e0a5908f64b3cb603482af0704861c1 [formerly bac31f361350513d87ede100cea5c7ec66fb2fdd] [formerly 4d7a53c5839dd20bbb760600322b3cef24a01330] [formerly 619d19e24c198409148d5bdda5743de0535b7a2b [formerly 4d7a53c5839dd20bbb760600322b3cef24a01330 [formerly b752ced02d726771a6e11a9982967a892d2e55f3]]] Former-commit-id: 619d19e24c198409148d5bdda5743de0535b7a2b Former-commit-id: 4440838cbe883a84c237cc8d0f49c75f814df106 [formerly 62b16fef0d5072fd0a1b6f7c37c7c79dee559d81] Former-commit-id: 998c9df260e3124dcc5e547d6bba76ce2722e1b8 --- .../plugin.xml | 9 ++ .../collaboration/ui/editor/EditorSetup.java | 9 +- .../collaboration/ui/editor/SharedEditor.java | 3 +- .../ui/role/AbstractRoleEventController.java | 60 ++++++++++++++ .../ui/role/DataProviderEventController.java | 82 +++++++++++++++++++ .../ui/role/IRoleEventController.java | 46 +++++++++++ .../ui/role/ParticipantEventController.java | 67 +++++++++++++++ .../comm/identity/ISharedDisplaySession.java | 30 ++++--- .../comm/identity/event/IInitData.java | 41 ++++++++++ .../comm/provider/session/VenueSession.java | 58 ++++++------- 10 files changed, 354 insertions(+), 51 deletions(-) create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java create mode 100644 cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java create mode 100644 cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IInitData.java diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml b/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml index 3a17220d65..1e3ddd9ad8 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml +++ b/cave/com.raytheon.uf.viz.collaboration.ui/plugin.xml @@ -131,4 +131,13 @@ + + + + diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java index d8c9b679bd..1fceb34cce 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/EditorSetup.java @@ -104,7 +104,8 @@ public class EditorSetup { return se; } - public static void createEditor(SharedEditor sharedEditor) { + public static CollaborationEditor createEditor(SharedEditor sharedEditor) { + CollaborationEditor editor = null; AbstractRenderableDisplay[] displays = new AbstractRenderableDisplay[1]; try { // TODO make it work with any IDescriptor and @@ -133,12 +134,12 @@ public class EditorSetup { disp.setExtent(extent); displays[0] = disp; - UiUtil.createEditor(CollaborationEditor.EDITOR_ID, displays); + editor = (CollaborationEditor) UiUtil.createEditor( + CollaborationEditor.EDITOR_ID, displays); } catch (VizException e) { - // TODO Auto-generated catch block. Please revise as appropriate. statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } - + return editor; } // TODO delete diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedEditor.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedEditor.java index c2b33de96b..bab42ac385 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedEditor.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/SharedEditor.java @@ -32,6 +32,7 @@ import org.geotools.coverage.grid.GeneralGridGeometry; import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter; import com.raytheon.uf.common.serialization.adapters.JTSEnvelopeAdapter; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IInitData; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.vividsolutions.jts.geom.Envelope; @@ -55,7 +56,7 @@ import com.vividsolutions.jts.geom.Envelope; @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement -public class SharedEditor implements ISerializableObject { +public class SharedEditor implements ISerializableObject, IInitData { /** The geometry of the descriptor */ private GeneralGridGeometry geometry; diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java new file mode 100644 index 0000000000..095991d6d3 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/AbstractRoleEventController.java @@ -0,0 +1,60 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.role; + +import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession; + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public abstract class AbstractRoleEventController implements + IRoleEventController { + + protected VenueSession session; + + protected AbstractRoleEventController(VenueSession session) { + this.session = session; + } + + @Override + public void startup() { + session.registerEventHandler(this); + } + + @Override + public void shutdown() { + session.unRegisterEventHandler(this); + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java new file mode 100644 index 0000000000..e8665ce36b --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/DataProviderEventController.java @@ -0,0 +1,82 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.role; + +import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; +import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; +import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueParticipantEvent; +import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession; +import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup; +import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditor; +import com.raytheon.viz.ui.VizWorkbenchManager; +import com.raytheon.viz.ui.editor.AbstractEditor; + +/** + * Handles the events of a session that are specific to the Data Provider role. + * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class DataProviderEventController extends AbstractRoleEventController { + + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(DataProviderEventController.class); + + private VenueSession session; + + public DataProviderEventController(VenueSession session) { + super(session); + } + + @Subscribe + public void participantChanged(VenueParticipantEvent event) { + if (event.getEventType().equals(ParticipantEventType.ARRIVED)) { + // TODO instead of going to active editor, should get ones + // specifically shared with this session + AbstractEditor editor = (AbstractEditor) VizWorkbenchManager + .getInstance().getActiveEditor(); + SharedEditor se = EditorSetup.extractSharedEditor(editor); + try { + session.sendInitData(event.getParticipant(), se); + } catch (CollaborationException e) { + statusHandler.handle(Priority.PROBLEM, + "Error sending initialization data to new participant " + + event.getParticipant().getName(), e); + } + } + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java new file mode 100644 index 0000000000..ffd9dcf5b3 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/IRoleEventController.java @@ -0,0 +1,46 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.role; + + +/** + * TODO Add Description + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public interface IRoleEventController { + + public void startup(); + + public void shutdown(); + +} diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java new file mode 100644 index 0000000000..3b25dc1373 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/role/ParticipantEventController.java @@ -0,0 +1,67 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.ui.role; + +import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IInitData; +import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession; +import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor; +import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup; +import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditor; + +/** + * Handles the events of a session that are specific to the Participant role. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2012            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class ParticipantEventController extends AbstractRoleEventController { + + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(ParticipantEventController.class); + + public ParticipantEventController(VenueSession session) { + super(session); + } + + @Subscribe + public void initDataArrived(IInitData initData) { + if (initData instanceof SharedEditor) { + SharedEditor se = (SharedEditor) initData; + CollaborationEditor editor = EditorSetup.createEditor(se); + // TODO need to send the editor somewhere so it can be tied to the + // session for the link to editor capability + } + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/ISharedDisplaySession.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/ISharedDisplaySession.java index 1ac4a95020..758ed9ffa4 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/ISharedDisplaySession.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/ISharedDisplaySession.java @@ -21,6 +21,7 @@ package com.raytheon.uf.viz.collaboration.comm.identity; import com.raytheon.uf.viz.collaboration.comm.identity.event.IDisplayEvent; import com.raytheon.uf.viz.collaboration.comm.identity.event.IEventPublisher; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IInitData; import com.raytheon.uf.viz.collaboration.comm.identity.event.IRenderable; import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; @@ -38,8 +39,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; * venue. *
  • TextMessage : Text messages send between users. Meant to * be displayed as conversation.
  • - *
  • IDisplayEvent : These messages are CAVE to CAVE - * events
  • + *
  • IDisplayEvent : These messages are CAVE to CAVE events
  • *
  • IRenderable : These messages are CAVE to CAVE * display......
  • * @@ -61,33 +61,35 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; */ public interface ISharedDisplaySession extends IEventPublisher { - + /** * Send a single initialization object to a participant who has joined an - * in-progress collaboration session. + * in-progress collaboration session. * * @param participant * @param initData */ - void sendInitData(IChatID participant, Object initData) throws CollaborationException; - + void sendInitData(IChatID participant, IInitData initData) + throws CollaborationException; + /** * * @param event */ void sendEvent(IDisplayEvent event) throws CollaborationException; - + /** * */ - void sendRenderableObject(IRenderable renderable) throws CollaborationException; + void sendRenderableObject(IRenderable renderable) + throws CollaborationException; /** * * @return */ IChatID getCurrentDataProvider(); - + /** * * @return @@ -100,22 +102,24 @@ public interface ISharedDisplaySession extends IEventPublisher { * @return */ boolean hasRole(ParticipantRole role); - + /** * * @return */ IQualifiedID getUserID(); - + /** * Gets the connection status of the session. + * * @return The connection status. */ boolean isConnected(); - + /** * Get the session identifier. - * @return The session identifier. + * + * @return The session identifier. */ String getSessionId(); diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IInitData.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IInitData.java new file mode 100644 index 0000000000..c49214b3b1 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IInitData.java @@ -0,0 +1,41 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.comm.identity.event; + +/** + * TODO Add Description + * + *
    + *
    + * SOFTWARE HISTORY
    + *
    + * Date         Ticket#    Engineer    Description
    + * ------------ ---------- ----------- --------------------------
    + * Mar 26, 2012            njensen     Initial creation
    + *
    + * 
    + * + * @author njensen + * @version 1.0 + */ + +public interface IInitData { + +} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java index d7f106bab8..944a6078ca 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/VenueSession.java @@ -20,24 +20,19 @@ package com.raytheon.uf.viz.collaboration.comm.provider.session; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.UUID; import org.eclipse.ecf.core.IContainer; import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDFactory; -import org.eclipse.ecf.core.identity.Namespace; import org.eclipse.ecf.core.user.IUser; import org.eclipse.ecf.core.util.ECFException; import org.eclipse.ecf.presence.IIMMessageEvent; import org.eclipse.ecf.presence.IIMMessageListener; -import org.eclipse.ecf.presence.IPresenceContainerAdapter; -import org.eclipse.ecf.presence.IPresenceSender; import org.eclipse.ecf.presence.chatroom.IChatRoomContainer; import org.eclipse.ecf.presence.chatroom.IChatRoomInfo; import org.eclipse.ecf.presence.chatroom.IChatRoomInvitationSender; @@ -46,7 +41,6 @@ import org.eclipse.ecf.presence.chatroom.IChatRoomMessage; import org.eclipse.ecf.presence.chatroom.IChatRoomMessageEvent; import org.eclipse.ecf.presence.chatroom.IChatRoomMessageSender; import org.eclipse.ecf.presence.chatroom.IChatRoomParticipantListener; -import org.eclipse.ecf.presence.im.IChatMessage; import org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID; import com.google.common.eventbus.EventBus; @@ -57,6 +51,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession; import com.raytheon.uf.viz.collaboration.comm.identity.event.IDisplayEvent; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IInitData; import com.raytheon.uf.viz.collaboration.comm.identity.event.IRenderable; import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; @@ -65,7 +60,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.listener.IInvitation; import com.raytheon.uf.viz.collaboration.comm.identity.listener.IMessageFilter; import com.raytheon.uf.viz.collaboration.comm.identity.listener.IMessageListener; import com.raytheon.uf.viz.collaboration.comm.identity.listener.IPresenceListener; -import com.raytheon.uf.viz.collaboration.comm.identity.listener.IVenueParticipantListener; import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; @@ -231,22 +225,23 @@ public class VenueSession extends BaseSession implements IVenueSession, } finally { initListeners(); } - + Runnable r = new Runnable() { @Override public void run() { - for(int i = 0;i < 10;i++) { + for (int i = 0; i < 10; i++) { IRenderable r = new TestObject("Test1"); ((TestObject) r).setValue(i); - + try { System.out.println("Sending renderable " + i); sendRenderableObject(r); - if(i == 5) { - sendTextMessage(Tools.marshallData("This is a text message as a String")); + if (i == 5) { + sendTextMessage(Tools + .marshallData("This is a text message as a String")); } - + } catch (CollaborationException ce) { ce.printStackTrace(); } @@ -259,18 +254,20 @@ public class VenueSession extends BaseSession implements IVenueSession, }; Thread t = new Thread(r); t.start(); - + registerEventHandler(this); } @Subscribe public void handle(IRenderable renderable) { - System.out.println("IRenderable " + renderable.getClass().getName() + " was received"); + System.out.println("IRenderable " + renderable.getClass().getName() + + " was received"); } - + @Subscribe public void handle(IDisplayEvent event) { - System.out.println("IDisplayEvent " + event.getClass().getName() + " was received"); + System.out.println("IDisplayEvent " + event.getClass().getName() + + " was received"); } @Subscribe @@ -280,9 +277,10 @@ public class VenueSession extends BaseSession implements IVenueSession, @Subscribe public void handle(IVenueParticipantEvent event) { - System.out.println("IVenueParticipantEvent " + event.getEventType() + " was received"); + System.out.println("IVenueParticipantEvent " + event.getEventType() + + " was received"); } - + /** * * @throws ECFException @@ -630,18 +628,10 @@ public class VenueSession extends BaseSession implements IVenueSession, // ISharedDisplaySession // *************************** - /** - * - * @param - * @param - * @throws CollaborationException - * @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#sendInitData(com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID, - * java.lang.Object) - */ @Override public void sendInitData( com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID participant, - Object initData) throws CollaborationException { + IInitData initData) throws CollaborationException { PeerToPeerChat session = null; session = getP2PSession(); @@ -663,7 +653,7 @@ public class VenueSession extends BaseSession implements IVenueSession, public void sendEvent(IDisplayEvent event) throws CollaborationException { if (event != null) { String message = Tools.marshallData(event); - if(message != null) { + if (message != null) { sendTextMessage(message); } } @@ -679,7 +669,7 @@ public class VenueSession extends BaseSession implements IVenueSession, throws CollaborationException { if (renderable != null) { String message = Tools.marshallData(renderable); - if(message != null) { + if (message != null) { sendTextMessage(message); } } @@ -687,7 +677,8 @@ public class VenueSession extends BaseSession implements IVenueSession, /** * Get the identification of the user who is the DataProvider. - * @return The DataProvider user identification. + * + * @return The DataProvider user identification. * @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#getCurrentDataProvider() */ @Override @@ -697,6 +688,7 @@ public class VenueSession extends BaseSession implements IVenueSession, /** * Get the identification of the user who is the Session Leader. + * * @return The Session Leader user identification. * @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#getCurrentSessionLeader() */ @@ -773,10 +765,10 @@ public class VenueSession extends BaseSession implements IVenueSession, Object o = null; try { o = Tools.unMarshallData(body); - if(o != null) { + if (o != null) { getEventPublisher().post(o); } - } catch(CollaborationException ce) { + } catch (CollaborationException ce) { // TODO : more robust!! ce.printStackTrace(); }