From 006785e37487aec8d0dc045479928876f1155935 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Thu, 19 Apr 2012 10:45:25 -0500 Subject: [PATCH] Issue #427 consolidated user ids Change-Id: I008c47320bbb5819db0607e7f695b3ecffa30387 Former-commit-id: 9e137757a7ed7bd9f319a1984aed40b6de960a35 --- .../data/CollaborationDataManager.java | 4 +- .../collaboration/data/CollaborationUser.java | 4 +- .../collaboration/ui/CollaborationUtils.java | 7 +- .../ui/role/DataProviderEventController.java | 7 +- .../ui/session/CollaborationSessionView.java | 5 +- .../collaboration/ui/session/SessionView.java | 13 +- ...f.common.serialization.ISerializableObject | 1 - .../comm/identity/ISharedDisplaySession.java | 10 +- .../event/IVenueParticipantEvent.java | 18 +-- .../comm/identity/info/IVenue.java | 56 +++---- .../comm/identity/invite/VenueInvite.java | 14 +- .../listener/IVenueInvitationListener.java | 16 +- .../listener/IVenueParticipantListener.java | 33 ++-- .../comm/identity/roster/IRoster.java | 71 +++++---- .../comm/identity/roster/IRosterEntry.java | 16 +- .../comm/identity/roster/IRosterManager.java | 4 +- .../comm/identity/user/IChatID.java | 53 ------- .../comm/identity/user/IVenueParticipant.java | 49 ------ .../comm/provider/TransferRoleCommand.java | 8 +- .../provider/event/VenueParticipantEvent.java | 12 +- .../comm/provider/info/Venue.java | 12 +- .../comm/provider/roster/Roster.java | 50 +++--- .../comm/provider/roster/RosterEntry.java | 106 ++----------- .../comm/provider/roster/RosterGroup.java | 4 +- .../comm/provider/roster/RosterManager.java | 39 +++-- .../comm/provider/session/SessionManager.java | 19 +-- .../session/SharedDisplaySession.java | 14 +- .../comm/provider/session/VenueSession.java | 21 +-- .../comm/provider/user/IDConverter.java | 10 +- .../comm/provider/user/RosterId.java | 142 ------------------ .../comm/provider/user/UserId.java | 42 ++++-- .../comm/provider/user/VenueParticipant.java | 135 ----------------- 32 files changed, 279 insertions(+), 716 deletions(-) delete mode 100644 cave/com.raytheon.uf.viz.collaboration/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject delete mode 100644 cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IChatID.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IVenueParticipant.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/RosterId.java delete mode 100644 cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/VenueParticipant.java diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationDataManager.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationDataManager.java index 9af3d43fbf..969e28cf68 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationDataManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationDataManager.java @@ -58,13 +58,13 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueInvitationEve import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup; -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.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage; import com.raytheon.uf.viz.collaboration.comm.provider.roster.RosterEntry; import com.raytheon.uf.viz.collaboration.comm.provider.session.SessionManager; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils; import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor; import com.raytheon.uf.viz.collaboration.ui.login.LoginData; @@ -658,7 +658,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber { presence.setStatusMessage(loginData.getModeMessage()); try { sessionManager.getAccountManager().sendPresence(presence); - IChatID id = sessionManager.getUser(); + UserId id = sessionManager.getUser(); RosterEntry rosterEntry = new RosterEntry(id); rosterEntry.setPresence(presence); handleModifiedPresence(rosterEntry); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationUser.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationUser.java index e50db24a08..bcde202ee1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationUser.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/data/CollaborationUser.java @@ -2,7 +2,7 @@ package com.raytheon.uf.viz.collaboration.data; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence.Type; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * This software was developed and / or modified by Raytheon Company, @@ -44,7 +44,7 @@ public class CollaborationUser extends CollaborationNode { String session; - IChatID iChatID; + UserId iChatID; public CollaborationUser(String id) { super(id); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationUtils.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationUtils.java index 1bbfece430..9b3c9beac3 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationUtils.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/CollaborationUtils.java @@ -29,9 +29,8 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence.Mode; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; import com.raytheon.uf.viz.collaboration.comm.provider.Tools; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.data.CollaborationNode; import com.raytheon.uf.viz.core.icon.IconUtil; @@ -97,7 +96,7 @@ public class CollaborationUtils { * @return userId */ public static String makeUserId(IRosterEntry rosterEntry) { - IChatID chatId = rosterEntry.getUser(); + UserId chatId = rosterEntry.getUser(); String userId = chatId.getName() + Tools.NAME_DELIM + chatId.getHost(); return userId; } @@ -109,7 +108,7 @@ public class CollaborationUtils { * @param participant * @return userId */ - public static String makeUserId(IVenueParticipant participant) { + public static String makeUserId(UserId participant) { StringBuilder sb = new StringBuilder(participant.getName()); sb.append(Tools.NAME_DELIM); int start = sb.length(); 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 index e34c49f70a..2524fba2de 100644 --- 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 @@ -28,10 +28,10 @@ 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.ISharedDisplaySession; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; -import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueParticipantEvent; import com.raytheon.uf.viz.collaboration.data.SessionContainer; import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup; @@ -85,7 +85,7 @@ public class DataProviderEventController extends AbstractRoleEventController { } @Subscribe - public void participantChanged(VenueParticipantEvent event) { + public void participantChanged(IVenueParticipantEvent event) { if (event.getEventType().equals(ParticipantEventType.ARRIVED)) { // TODO this seems to trigger when you create the room, in which // case you don't need to send it for yourself @@ -95,8 +95,7 @@ public class DataProviderEventController extends AbstractRoleEventController { .getActiveEditorAs(AbstractEditor.class); SharedEditorData se = EditorSetup.extractSharedEditorData(editor); try { - session.sendObjectToPeer(event.getParticipant() - .getQualifiedId(), se); + session.sendObjectToPeer(event.getParticipant(), se); } catch (CollaborationException e) { statusHandler.handle(Priority.PROBLEM, "Error sending initialization data to new participant " diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java index 24484f0bb8..53333143f6 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/CollaborationSessionView.java @@ -44,7 +44,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.provider.Tools; import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; -import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager; import com.raytheon.uf.viz.collaboration.data.CollaborationUser; @@ -149,8 +149,7 @@ public class CollaborationSessionView extends SessionView { // TODO need to send invite/request for transfer, and then if successful // deactivate the local ones since we won't receive the message TransferRoleCommand trc = new TransferRoleCommand(); - VenueParticipant vp = new VenueParticipant(Tools.parseName(fqname), - Tools.parseHost(fqname)); + UserId vp = new UserId(Tools.parseName(fqname), Tools.parseHost(fqname)); trc.setUser(vp); session.setCurrentSessionLeader(vp); trc.setRole(ParticipantRole.SESSION_LEADER); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java index 3ad38ed17c..47360f6b16 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/SessionView.java @@ -67,9 +67,9 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEv import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; import com.raytheon.uf.viz.collaboration.comm.provider.session.SessionManager; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager; import com.raytheon.uf.viz.collaboration.data.CollaborationUser; import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils; @@ -355,8 +355,7 @@ public class SessionView extends AbstractSessionView { List users = new ArrayList(); if (session != null) { - for (IVenueParticipant participant : session.getVenue() - .getParticipants()) { + for (UserId participant : session.getVenue().getParticipants()) { String userId = CollaborationUtils.makeUserId(participant); CollaborationUser user = new CollaborationUser(userId, @@ -562,7 +561,7 @@ public class SessionView extends AbstractSessionView { throws Exception { System.out.println("++ ParticipantHander type " + event.getEventType()); final ParticipantEventType type = event.getEventType(); - final IVenueParticipant participant = event.getParticipant(); + final UserId participant = event.getParticipant(); final IPresence presence = event.getPresence(); VizApp.runAsync(new Runnable() { @@ -591,7 +590,7 @@ public class SessionView extends AbstractSessionView { } @SuppressWarnings("unchecked") - private void participantArrived(IVenueParticipant participant) { + private void participantArrived(UserId participant) { List users = (List) usersTable .getInput(); String name = participant.getFQName(); @@ -608,7 +607,7 @@ public class SessionView extends AbstractSessionView { } @SuppressWarnings("unchecked") - private void participantDeparted(IVenueParticipant participant) { + private void participantDeparted(UserId participant) { System.out.println("++++ handle departed here: " + participant.getName() + ", " + participant.getFQName()); String userId = CollaborationUtils.makeUserId(participant); @@ -628,7 +627,7 @@ public class SessionView extends AbstractSessionView { * @param presence */ @SuppressWarnings("unchecked") - private void participantPresenceUpdated(IVenueParticipant participant, + private void participantPresenceUpdated(UserId participant, IPresence presence) { // Ignore the presence's mode/type. May not be the same as the user's. // TODO Keep as a place holder for now since it may be needed to set diff --git a/cave/com.raytheon.uf.viz.collaboration/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/cave/com.raytheon.uf.viz.collaboration/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index b6f21687b7..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1 +0,0 @@ -com.raytheon.uf.viz.collaboration.comm.provider.session.TestJAXBObject \ No newline at end of file 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 3fede6c39c..78348b59bf 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 @@ -20,8 +20,8 @@ package com.raytheon.uf.viz.collaboration.comm.identity; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * @@ -92,28 +92,28 @@ public interface ISharedDisplaySession extends IVenueSession { * * @return */ - public IVenueParticipant getCurrentDataProvider(); + public UserId getCurrentDataProvider(); /** * Returns the current Session Leader for the session * * @return */ - public IVenueParticipant getCurrentSessionLeader(); + public UserId getCurrentSessionLeader(); /** * Sets the current Data Provider for the session * * @param participant */ - public void setCurrentDataProvider(IVenueParticipant participant); + public void setCurrentDataProvider(UserId participant); /** * Sets the current Session Leader for the session * * @param participant */ - public void setCurrentSessionLeader(IVenueParticipant participant); + public void setCurrentSessionLeader(UserId participant); /** * Checks if the currently logged in user has the role on this session diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IVenueParticipantEvent.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IVenueParticipantEvent.java index 270bb7e363..d2738b2c6e 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IVenueParticipantEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IVenueParticipantEvent.java @@ -20,23 +20,23 @@ package com.raytheon.uf.viz.collaboration.comm.identity.event; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 20, 2012            jkorman     Initial creation
- *
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public interface IVenueParticipantEvent { @@ -46,13 +46,13 @@ public interface IVenueParticipantEvent { * @return */ ParticipantEventType getEventType(); - + /** * * @return */ - IVenueParticipant getParticipant(); - + UserId getParticipant(); + /** * * @return diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/info/IVenue.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/info/IVenue.java index 1cc8a530aa..f615620080 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/info/IVenue.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/info/IVenue.java @@ -21,24 +21,24 @@ package com.raytheon.uf.viz.collaboration.comm.identity.info; import java.util.Collection; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** - * Provides information about a venue. In addition implementations will - * act as a target for participant updates such as + * Provides information about a venue. In addition implementations will act as a + * target for participant updates such as * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 1, 2012            jkorman     Initial creation
- *
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public interface IVenue { @@ -48,29 +48,29 @@ public interface IVenue { * @return */ IVenueInfo getInfo(); - - /** - * - * @return - */ - void setInfo(IVenueInfo info); - - /** - * - * @return - */ - Collection getParticipants(); - - /** - * - * @return - */ - void addParticipant(IVenueParticipant participant); /** * * @return */ - void removeParticipant(IVenueParticipant participant); - + void setInfo(IVenueInfo info); + + /** + * + * @return + */ + Collection getParticipants(); + + /** + * + * @return + */ + void addParticipant(UserId participant); + + /** + * + * @return + */ + void removeParticipant(UserId participant); + } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/invite/VenueInvite.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/invite/VenueInvite.java index ca5f18edc3..7fcf56547e 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/invite/VenueInvite.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/invite/VenueInvite.java @@ -21,7 +21,7 @@ package com.raytheon.uf.viz.collaboration.comm.identity.invite; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * An invite message for inviting another user to a venue. @@ -50,10 +50,10 @@ public class VenueInvite { private String message; @DynamicSerializeElement - private IVenueParticipant sessionLeader; + private UserId sessionLeader; @DynamicSerializeElement - private IVenueParticipant dataProvider; + private UserId dataProvider; @DynamicSerializeElement private String sessionId; @@ -74,19 +74,19 @@ public class VenueInvite { this.message = message; } - public IVenueParticipant getSessionLeader() { + public UserId getSessionLeader() { return sessionLeader; } - public void setSessionLeader(IVenueParticipant sessionLeader) { + public void setSessionLeader(UserId sessionLeader) { this.sessionLeader = sessionLeader; } - public IVenueParticipant getDataProvider() { + public UserId getDataProvider() { return dataProvider; } - public void setDataProvider(IVenueParticipant dataProvider) { + public void setDataProvider(UserId dataProvider) { this.dataProvider = dataProvider; } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueInvitationListener.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueInvitationListener.java index ea55703161..0439e6446f 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueInvitationListener.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueInvitationListener.java @@ -19,25 +19,24 @@ **/ package com.raytheon.uf.viz.collaboration.comm.identity.listener; -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.provider.user.UserId; /** * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 13, 2012            jkorman     Initial creation
- *
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public interface IVenueInvitationListener { @@ -49,5 +48,6 @@ public interface IVenueInvitationListener { * @param subject * @param body */ - void handleInvitation(IQualifiedID roomId, IChatID from, String subject, String body); + void handleInvitation(IQualifiedID roomId, UserId from, String subject, + String body); } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueParticipantListener.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueParticipantListener.java index 46af580f42..48fee2ea02 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueParticipantListener.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/listener/IVenueParticipantListener.java @@ -20,51 +20,58 @@ package com.raytheon.uf.viz.collaboration.comm.identity.listener; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 6, 2012            jkorman     Initial creation
- *
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public interface IVenueParticipantListener { /** * A participant has arrived in the venue. - * @param participant The participant who has arrived. + * + * @param participant + * The participant who has arrived. */ - public void handleArrived(IVenueParticipant participant); + public void handleArrived(UserId participant); /** * A participant has has updated their information. - * @param participant The participant whose information has been updated. + * + * @param participant + * The participant whose information has been updated. */ - public void handleUpdated(IVenueParticipant participant); + public void handleUpdated(UserId participant); /** * A participant has departed this venue. - * @param participant The participant who has departed. + * + * @param participant + * The participant who has departed. */ - public void handleDeparted(IVenueParticipant participant); + public void handleDeparted(UserId participant); /** * Presence information about the participant who has arrived, updated, or * departed the venue. + * * @param fromID * @param presence */ - public void handlePresenceUpdated(IVenueParticipant fromID, IPresence presence); + public void handlePresenceUpdated(UserId fromID, IPresence presence); } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRoster.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRoster.java index 83952b6560..d8bc0f6148 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRoster.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRoster.java @@ -22,104 +22,117 @@ package com.raytheon.uf.viz.collaboration.comm.identity.roster; import java.util.Collection; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; import com.raytheon.uf.viz.collaboration.comm.identity.user.ID; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** - * The Roster provides a structure to maintain user contacts. These - * contacts may be organized into groups beneath the Roster. A single - * user contact may be associated with more than a single group. As - * of this time nesting is not allowed, that is groups may not contain - * groups. + * The Roster provides a structure to maintain user contacts. These contacts may + * be organized into groups beneath the Roster. A single user contact may be + * associated with more than a single group. As of this time nesting is not + * allowed, that is groups may not contain groups. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 27, 2012            jkorman     Initial creation
- *
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public interface IRoster { /** * Add an entry directly to the roster. + * * @param item */ void addRosterEntry(IRosterEntry entry); /** * Add this user to the roster. + * * @param user * @param nickName * @param groups */ - void addRosterEntry(IQualifiedID user, String nickName, String [] groups); + void addRosterEntry(IQualifiedID user, String nickName, String[] groups); /** * Request that the specified entry be modified in the roster. - * @param entry The entry to modify. This entry will contain the modifications - * to apply. + * + * @param entry + * The entry to modify. This entry will contain the modifications + * to apply. * @return The modified roster entry. */ IRosterEntry modifyRosterEntry(IRosterEntry entry); - + /** * Request that the user be removed from the roster. - * @param user The identification of the user to be removed. + * + * @param user + * The identification of the user to be removed. */ void removeFromRoster(ID user); - + /** * Get all entries associated with this roster. + * * @return A Collection of entries belonging to this Roster. */ Collection getEntries(); - + /** - * Add a group to the roster. This method adds to the roster - * level groups only. - * @param group A group to add. + * Add a group to the roster. This method adds to the roster level groups + * only. + * + * @param group + * A group to add. */ void addGroup(IRosterGroup group); /** * Removes a group from the roster level groups. - * @param groupName Name of the group to remove. + * + * @param groupName + * Name of the group to remove. */ void removeGroup(String groupName); - + /** * Get all groups associated with this roster. + * * @return A Collection of groups belonging to this Roster. */ Collection getGroups(); - + /** * * @return */ - IChatID getUser(); - + UserId getUser(); + /** * Does this roster support nested groups? + * * @return This roster supports nested groups. */ boolean supportsNestedGroups(); - + /** * Signifies whether this roster associated with a chat room. + * * @return Is this roster associated with a chat room. */ boolean isRoomRoster(); - + /** * * @param account @@ -133,6 +146,6 @@ public interface IRoster { * * @param userId */ - void sendRosterRemove(IChatID userId) throws CollaborationException; + void sendRosterRemove(UserId userId) throws CollaborationException; } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterEntry.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterEntry.java index bcbc90a3cc..5ca7451f0c 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterEntry.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterEntry.java @@ -3,27 +3,27 @@ package com.raytheon.uf.viz.collaboration.comm.identity.roster; import java.util.Collection; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; public interface IRosterEntry extends IRosterItem { - + /** - * Get a collection of groups that contain this entry. If the - * entry is not contained by a group a not null empty collection - * shall be returned. + * Get a collection of groups that contain this entry. If the entry is not + * contained by a group a not null empty collection shall be returned. + * * @return Collection that contains this entry. */ Collection getGroups(); - + /** * * @return */ IPresence getPresence(); - + /** * * @return */ - IChatID getUser(); + UserId getUser(); } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterManager.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterManager.java index 16811dee3d..7b09d928a6 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterManager.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/roster/IRosterManager.java @@ -23,7 +23,7 @@ import java.util.Collection; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.listener.IRosterListener; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO @@ -88,6 +88,6 @@ public interface IRosterManager { * * @param userId */ - void sendRosterRemove(IChatID userId) throws CollaborationException; + void sendRosterRemove(UserId userId) throws CollaborationException; } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IChatID.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IChatID.java deleted file mode 100644 index cc2df99e48..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IChatID.java +++ /dev/null @@ -1,53 +0,0 @@ -/** -a * 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.user; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Feb 24, 2012            jkorman     Initial creation
- * 
- * 
- * - * @author jkorman - * @version 1.0 - */ - -public interface IChatID extends IQualifiedID { - - /** - * - * @param nickname - */ - void setNickname(String nickname); - - /** - * - * @return - */ - String getNickname(); - -} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IVenueParticipant.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IVenueParticipant.java deleted file mode 100644 index d6aed82ba2..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/user/IVenueParticipant.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.user; - -import com.raytheon.uf.viz.collaboration.comm.identity.IPropertied; - -/** - * TODO Add Description - * - *
- *
- * SOFTWARE HISTORY
- *
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 1, 2012            jkorman     Initial creation
- *
- * 
- * - * @author jkorman - * @version 1.0 - */ - -public interface IVenueParticipant extends IChatID, IPropertied { - - /** - * Return the identifier as a qualified field. Removes the "domain" - * conference from the host string if found. - * @return The qualified id. - */ - IQualifiedID getQualifiedId(); -} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/TransferRoleCommand.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/TransferRoleCommand.java index 9a1a1caa30..bbdc7977e8 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/TransferRoleCommand.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/TransferRoleCommand.java @@ -21,8 +21,8 @@ package com.raytheon.uf.viz.collaboration.comm.provider; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * A command to transfer a role to a different user on the session. @@ -48,7 +48,7 @@ public class TransferRoleCommand { private ParticipantRole role; @DynamicSerializeElement - private IVenueParticipant user; + private UserId user; public ParticipantRole getRole() { return role; @@ -58,11 +58,11 @@ public class TransferRoleCommand { this.role = role; } - public IVenueParticipant getUser() { + public UserId getUser() { return user; } - public void setUser(IVenueParticipant user) { + public void setUser(UserId user) { this.user = user; } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/VenueParticipantEvent.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/VenueParticipantEvent.java index b18860445f..5e17764eb1 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/VenueParticipantEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/VenueParticipantEvent.java @@ -22,7 +22,7 @@ package com.raytheon.uf.viz.collaboration.comm.provider.event; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -45,18 +45,18 @@ public class VenueParticipantEvent implements IVenueParticipantEvent { private final ParticipantEventType eventType; - private final IVenueParticipant participant; + private final UserId participant; private IPresence presence; - public VenueParticipantEvent(IVenueParticipant participant, + public VenueParticipantEvent(UserId participant, ParticipantEventType eventType) { this.participant = participant; this.eventType = eventType; } - public VenueParticipantEvent(IVenueParticipant participant, - IPresence presence, ParticipantEventType eventType) { + public VenueParticipantEvent(UserId participant, IPresence presence, + ParticipantEventType eventType) { this.participant = participant; this.eventType = eventType; this.presence = presence; @@ -74,7 +74,7 @@ public class VenueParticipantEvent implements IVenueParticipantEvent { * @see com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent#getParticipant() */ @Override - public IVenueParticipant getParticipant() { + public UserId getParticipant() { return participant; } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/info/Venue.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/info/Venue.java index be608c3685..3bdb35d14f 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/info/Venue.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/info/Venue.java @@ -25,7 +25,7 @@ import java.util.Map; import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue; import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -48,13 +48,13 @@ public class Venue implements IVenue { private IVenueInfo info; - private Map participants; + private Map participants; /** * */ public Venue() { - participants = new HashMap(); + participants = new HashMap(); } /** @@ -78,7 +78,7 @@ public class Venue implements IVenue { * @see com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue#getParticipants() */ @Override - public Collection getParticipants() { + public Collection getParticipants() { return participants.values(); } @@ -87,7 +87,7 @@ public class Venue implements IVenue { * @see com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue#addParticipant(com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant) */ @Override - public void addParticipant(IVenueParticipant participant) { + public void addParticipant(UserId participant) { participants.put(participant.getName(), participant); } @@ -96,7 +96,7 @@ public class Venue implements IVenue { * @see com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue#removeParticipant(com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant) */ @Override - public void removeParticipant(IVenueParticipant participant) { + public void removeParticipant(UserId participant) { participants.remove(participant).getName(); } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/Roster.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/Roster.java index dee2d4bad6..dc5fee741b 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/Roster.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/Roster.java @@ -29,11 +29,11 @@ import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; import com.raytheon.uf.viz.collaboration.comm.identity.user.ID; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; -import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; +import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -62,7 +62,7 @@ public class Roster extends RosterItem implements IRoster { // Map of all roster groups in this roster. private Map groups = null; - private final IChatID user; + private final UserId user; private boolean roomRoster = false; @@ -72,7 +72,7 @@ public class Roster extends RosterItem implements IRoster { * * @param user */ - public Roster(IChatID user, IRosterManager manager) { + public Roster(UserId user, IRosterManager manager) { rosterManager = manager; this.user = user; internalEntries = new HashMap(); @@ -85,10 +85,10 @@ public class Roster extends RosterItem implements IRoster { * @see com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster#getUser() */ @Override - public IChatID getUser() { + public UserId getUser() { return user; } - + /** * Does this roster support nested groups? * @@ -117,15 +117,15 @@ public class Roster extends RosterItem implements IRoster { @Override public void addRosterEntry(IRosterEntry entry) { IRosterEntry re = null; - + IQualifiedID id = entry.getUser(); re = internalEntries.get(id); // ensure the entry is not present! - if(re == null) { + if (re == null) { // put in the internal entries first. internalEntries.put(entry.getUser(), entry); - - for(IRosterGroup g : entry.getGroups()) { + + for (IRosterGroup g : entry.getGroups()) { RosterGroup rg = (RosterGroup) g; rg.setRoster(this); } @@ -207,12 +207,12 @@ public class Roster extends RosterItem implements IRoster { if (user != null) { IRosterEntry entry = internalEntries.get(user.getFQName()); if (entry == null) { - RosterId id = new RosterId(user.getName(), user.getHost(), - null, user.getResource()); + UserId id = new UserId(user.getName(), user.getHost(), + user.getResource()); entry = new RosterEntry(id); } internalEntries.put(entry.getUser(), entry); - + listRoster(); } } @@ -272,7 +272,7 @@ public class Roster extends RosterItem implements IRoster { * @param userId */ @Override - public void sendRosterRemove(IChatID userId) throws CollaborationException { + public void sendRosterRemove(UserId userId) throws CollaborationException { rosterManager.sendRosterRemove(userId); } @@ -289,7 +289,7 @@ public class Roster extends RosterItem implements IRoster { if (o instanceof org.eclipse.ecf.presence.roster.IRosterEntry) { org.eclipse.ecf.presence.roster.IRosterEntry entry = (org.eclipse.ecf.presence.roster.IRosterEntry) o; - IChatID id = RosterId.convertFrom(entry.getUser()); + UserId id = IDConverter.convertFrom(entry.getUser()); RosterEntry re = new RosterEntry(id); // Check to see if we already have an entry @@ -318,34 +318,32 @@ public class Roster extends RosterItem implements IRoster { // // ******************************************* - public void listRoster() { - - System.out.println("##########################################################################"); + + System.out + .println("##########################################################################"); System.out.println("Roster for : " + user.getFQName()); System.out.println("#####################################"); System.out.println("# Ungrouped entries"); System.out.println("-------------------------------------"); Collection entries = getEntries(); - for(IRosterEntry r : entries) { + for (IRosterEntry r : entries) { System.out.print(" " + r.getName()); } System.out.println("#####################################"); System.out.println("# Groups "); System.out.println("-------------------------------------"); Collection groups = getGroups(); - for(IRosterGroup g : groups) { + for (IRosterGroup g : groups) { System.out.print(" " + g.getName()); entries = g.getEntries(); - for(IRosterEntry r : entries) { + for (IRosterEntry r : entries) { System.out.print(" " + r.getName()); } System.out.println("-----------------"); } - System.out.println("##########################################################################"); + System.out + .println("##########################################################################"); } - - - - + } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterEntry.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterEntry.java index 58ace92b3f..1626d0d432 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterEntry.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterEntry.java @@ -28,10 +28,9 @@ import org.eclipse.ecf.core.identity.ID; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; import com.raytheon.uf.viz.collaboration.comm.provider.Tools; -import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -53,7 +52,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; public class RosterEntry extends RosterItem implements IRosterEntry, IMutableRosterEntry { - private IChatID userId = null; + private UserId userId = null; private IPresence presence = null; @@ -63,7 +62,7 @@ public class RosterEntry extends RosterItem implements IRosterEntry, * * @param id */ - public RosterEntry(IChatID id) { + public RosterEntry(UserId id) { userId = id; setName(id.getFQName()); groups = new HashMap(); @@ -73,7 +72,7 @@ public class RosterEntry extends RosterItem implements IRosterEntry, * */ @Override - public IChatID getUser() { + public UserId getUser() { return userId; } @@ -152,15 +151,16 @@ public class RosterEntry extends RosterItem implements IRosterEntry, * @param entry * @return */ - public static IRosterEntry convertEntry(org.eclipse.ecf.presence.roster.IRosterEntry entry) { + public static IRosterEntry convertEntry( + org.eclipse.ecf.presence.roster.IRosterEntry entry) { RosterEntry rosterEntry = null; - if(entry != null) { + if (entry != null) { ID id = entry.getUser().getID(); - + String name = Tools.parseName(id.getName()); String host = Tools.parseHost(id.getName()); String resource = Tools.parseResource(id.getName()); - IChatID rosterId = new RosterId(name, host, resource); + UserId rosterId = new UserId(name, host, resource); rosterEntry = new RosterEntry(rosterId); IPresence p = Presence.convertPresence(entry.getPresence()); @@ -168,94 +168,14 @@ public class RosterEntry extends RosterItem implements IRosterEntry, // Now check the groups @SuppressWarnings("unchecked") - Collection inGroups = entry.getGroups(); - for(org.eclipse.ecf.presence.roster.IRosterGroup g : inGroups) { - RosterGroup group = new RosterGroup(g.getName(), null,null); + Collection inGroups = entry + .getGroups(); + for (org.eclipse.ecf.presence.roster.IRosterGroup g : inGroups) { + RosterGroup group = new RosterGroup(g.getName(), null, null); rosterEntry.addGroup(group); } } return rosterEntry; } - - - public static final void main(String[] args) { - - IChatID id = new IChatID() { - - private String name = null; - - private String nickName = null; - - private String host = null; - - private String resource = null; - - @Override - public void setName(String userName) { - name = userName; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setNickname(String nickname) { - nickName = nickname; - } - - @Override - public String getNickname() { - return nickName; - - } - - @Override - public void setHost(String hostName) { - host = hostName; - } - - @Override - public String getHost() { - return host; - } - - @Override - public String getResource() { - return resource; - } - - @Override - public void setResource(String resource) { - this.resource = resource; - } - - @Override - public String getFQName() { - StringBuilder sb = new StringBuilder(name); - sb.append("@"); - sb.append(host); - if (resource != null) { - sb.append("/"); - sb.append(resource); - } - - return sb.toString(); - } - - }; - - id.setName("fred"); - id.setHost("awipscm.omaha.us.ray.com"); - id.setResource("smack"); - - IMutableRosterEntry entry = new RosterEntry(id); - entry.setPresence(new Presence()); - - IRosterEntry en = entry; - - System.out.println(id.getFQName()); - } } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterGroup.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterGroup.java index d420dc9319..ff626229b6 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterGroup.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterGroup.java @@ -28,7 +28,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterItem; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; -import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -71,7 +71,7 @@ public class RosterGroup extends RosterItem implements IRosterGroup { IRosterEntry re = entries.get(entry.getUser()); if (re == null) { IQualifiedID user = entry.getUser(); - RosterId id = new RosterId(user.getName(), user.getHost(), null, + UserId id = new UserId(user.getName(), user.getHost(), user.getResource()); re = new RosterEntry(id); diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterManager.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterManager.java index b4cf001e98..bf9aaf818d 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterManager.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/roster/RosterManager.java @@ -32,11 +32,10 @@ import com.raytheon.uf.viz.collaboration.comm.identity.listener.IRosterListener; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; import com.raytheon.uf.viz.collaboration.comm.provider.session.SessionManager; import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; -import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -62,7 +61,7 @@ public class RosterManager implements IRosterManager { private IRoster roster; private org.eclipse.ecf.presence.roster.IRoster baseRoster; - + private SessionManager sessionManager; /** @@ -72,7 +71,7 @@ public class RosterManager implements IRosterManager { public RosterManager(SessionManager manager) { sessionManager = manager; updateRoster(); - } + } /** * @@ -85,10 +84,11 @@ public class RosterManager implements IRosterManager { } private void updateRoster() { - baseRoster = sessionManager.getPresenceContainerAdapter().getRosterManager().getRoster(); + baseRoster = sessionManager.getPresenceContainerAdapter() + .getRosterManager().getRoster(); roster = toLocalRoster(baseRoster); } - + /** * * @param listener @@ -149,13 +149,13 @@ public class RosterManager implements IRosterManager { * @param userId */ @Override - public void sendRosterRemove(IChatID userId) throws CollaborationException { + public void sendRosterRemove(UserId userId) throws CollaborationException { IPresenceContainerAdapter adapter = baseRoster .getPresenceContainerAdapter(); org.eclipse.ecf.presence.roster.IRosterManager manager = adapter .getRosterManager(); - + IRosterSubscriptionSender sender = manager .getRosterSubscriptionSender(); @@ -174,16 +174,16 @@ public class RosterManager implements IRosterManager { * @param fromId * @param presence */ - public void updateEntry(IChatID fromId, IPresence presence) { + public void updateEntry(UserId fromId, IPresence presence) { RosterEntry re = new RosterEntry(fromId); re.setPresence(presence); IRosterEntry modified = roster.modifyRosterEntry(re); - if(modified != null) { + if (modified != null) { sessionManager.getEventPublisher().post(re); } } - + /** * * @param fromId @@ -191,11 +191,11 @@ public class RosterManager implements IRosterManager { */ public void updateEntry(IRosterEntry entry) { IRosterEntry modified = roster.modifyRosterEntry(entry); - if(modified != null) { + if (modified != null) { sessionManager.getEventPublisher().post(entry); } } - + /** * * @param roster @@ -205,7 +205,7 @@ public class RosterManager implements IRosterManager { Roster newRoster = null; if (roster != null) { - IChatID id = IDConverter.convertFrom(roster.getUser()); + UserId id = IDConverter.convertFrom(roster.getUser()); newRoster = new Roster(id, this); @SuppressWarnings("rawtypes") @@ -214,7 +214,7 @@ public class RosterManager implements IRosterManager { if (o instanceof org.eclipse.ecf.presence.roster.IRosterEntry) { org.eclipse.ecf.presence.roster.IRosterEntry entry = (org.eclipse.ecf.presence.roster.IRosterEntry) o; - id = RosterId.convertFrom(entry.getUser()); + id = IDConverter.convertFrom(entry.getUser()); RosterEntry re = new RosterEntry(id); if (!newRoster.getEntries().contains(re)) { IPresence p = Presence.convertPresence(entry @@ -231,7 +231,8 @@ public class RosterManager implements IRosterManager { newRoster.populateGroup(newGroup, group.getEntries()); newRoster.addGroup(newGroup); } else { - System.out.println("RosterManager.toLocalRoster " + o.getClass().getName()); + System.out.println("RosterManager.toLocalRoster " + + o.getClass().getName()); } } } @@ -246,10 +247,8 @@ public class RosterManager implements IRosterManager { return sessionManager; } - private void printRoster(IRoster roster) { - + } - - + } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SessionManager.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SessionManager.java index 10bae67b81..b8af526ac6 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SessionManager.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SessionManager.java @@ -65,9 +65,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.RosterChangeType; import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager; -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; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; import com.raytheon.uf.viz.collaboration.comm.provider.Tools; import com.raytheon.uf.viz.collaboration.comm.provider.event.RosterChangeEvent; @@ -76,9 +74,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.info.InfoAdapter; import com.raytheon.uf.viz.collaboration.comm.provider.roster.RosterEntry; import com.raytheon.uf.viz.collaboration.comm.provider.roster.RosterManager; import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; -import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId; -import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant; /** * @@ -125,7 +122,7 @@ public class SessionManager implements IEventPublisher { private String password; - private IChatID user; + private UserId user; private IPresence userPresence; @@ -245,7 +242,7 @@ public class SessionManager implements IEventPublisher { String name = Tools.parseName(id.getName()); String host = Tools.parseHost(id.getName()); String resource = Tools.parseResource(id.getName()); - user = new RosterId(name, host, resource); + user = new UserId(name, host, resource); } setupAccountManager(); @@ -261,7 +258,7 @@ public class SessionManager implements IEventPublisher { * @return * @see com.raytheon.uf.viz.collaboration.comm.identity.roster.IRoster#getUser() */ - public IChatID getUser() { + public UserId getUser() { return user; } @@ -426,7 +423,7 @@ public class SessionManager implements IEventPublisher { String name = Tools.parseName(account); String host = Tools.parseHost(account); - IVenueParticipant me = new VenueParticipant(name, host); + UserId me = new UserId(name, host); session.setUserId(me); session.setCurrentDataProvider(invitation.getInvite() .getDataProvider()); @@ -458,7 +455,7 @@ public class SessionManager implements IEventPublisher { String name = Tools.parseName(account); String host = Tools.parseHost(account); - IVenueParticipant me = new VenueParticipant(name, host); + UserId me = new UserId(name, host); session.setCurrentSessionLeader(me); session.setCurrentDataProvider(me); @@ -577,7 +574,7 @@ public class SessionManager implements IEventPublisher { String host = Tools.parseHost(fromId.getName()); String resource = Tools.parseResource(fromId.getName()); - IChatID id = new RosterId(name, host, resource); + UserId id = new UserId(name, host, resource); if (rosterManager != null) { ((RosterManager) rosterManager).updateEntry(id, p); @@ -680,7 +677,7 @@ public class SessionManager implements IEventPublisher { if (venueId != null) { IQualifiedID id = IDConverter.convertFrom(from); - IChatID invitor = new RosterId(id.getName(), + UserId invitor = new UserId(id.getName(), id.getHost(), id.getResource()); VenueInvite received; diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java index 812c0dd30b..5e3dd568ba 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/SharedDisplaySession.java @@ -25,10 +25,10 @@ import com.google.common.eventbus.EventBus; import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage; import com.raytheon.uf.viz.collaboration.comm.provider.Tools; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * TODO Add Description @@ -50,9 +50,9 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools; public class SharedDisplaySession extends VenueSession implements ISharedDisplaySession { - private IVenueParticipant sessionLeader = null; + private UserId sessionLeader = null; - private IVenueParticipant dataProvider = null; + private UserId dataProvider = null; public SharedDisplaySession(IContainer container, EventBus externalBus, SessionManager manager) throws CollaborationException { @@ -99,7 +99,7 @@ public class SharedDisplaySession extends VenueSession implements * @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#getCurrentDataProvider() */ @Override - public IVenueParticipant getCurrentDataProvider() { + public UserId getCurrentDataProvider() { return dataProvider; } @@ -110,7 +110,7 @@ public class SharedDisplaySession extends VenueSession implements * @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#getCurrentSessionLeader() */ @Override - public IVenueParticipant getCurrentSessionLeader() { + public UserId getCurrentSessionLeader() { return sessionLeader; } @@ -131,12 +131,12 @@ public class SharedDisplaySession extends VenueSession implements } @Override - public void setCurrentSessionLeader(IVenueParticipant id) { + public void setCurrentSessionLeader(UserId id) { sessionLeader = id; } @Override - public void setCurrentDataProvider(IVenueParticipant id) { + public void setCurrentDataProvider(UserId id) { dataProvider = id; } 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 aa72a063b0..0ca568eb82 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 @@ -52,7 +52,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventTyp import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue; import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite; import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; import com.raytheon.uf.viz.collaboration.comm.provider.CollaborationMessage; import com.raytheon.uf.viz.collaboration.comm.provider.Presence; import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage; @@ -60,8 +59,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools; import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueParticipantEvent; import com.raytheon.uf.viz.collaboration.comm.provider.info.InfoAdapter; import com.raytheon.uf.viz.collaboration.comm.provider.info.Venue; -import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterId; -import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant; +import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; +import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; /** * @@ -191,11 +190,7 @@ public class VenueSession extends BaseSession implements IVenueSession { venue = new Venue(); ID[] ids = venueContainer.getChatRoomParticipants(); for (ID id : ids) { - String fullName = id.getName(); - IVenueParticipant vp = new VenueParticipant(); - vp.setName(Tools.parseName(fullName)); - vp.setHost(Tools.parseHost(fullName)); - vp.setResource(Tools.parseResource(fullName)); + UserId vp = IDConverter.convertFrom(id); venue.addParticipant(vp); } venue.setInfo(InfoAdapter.createVenueInfo(venueInfo)); @@ -302,7 +297,7 @@ public class VenueSession extends BaseSession implements IVenueSession { } } - protected void setUserId(IVenueParticipant id) { + protected void setUserId(UserId id) { this.userID = id; } @@ -383,11 +378,7 @@ public class VenueSession extends BaseSession implements IVenueSession { public void handlePresenceUpdated(ID fromID, org.eclipse.ecf.presence.IPresence presence) { - IVenueParticipant vp = new VenueParticipant(); - String fullName = fromID.getName(); - vp.setName(Tools.parseName(fullName)); - vp.setHost(Tools.parseHost(fullName)); - vp.setResource(Tools.parseResource(fullName)); + UserId vp = IDConverter.convertFrom(fromID); IPresence p = Presence.convertPresence(presence); IVenueParticipantEvent event = null; if (IPresence.Type.AVAILABLE.equals(p.getType())) { @@ -514,7 +505,7 @@ public class VenueSession extends BaseSession implements IVenueSession { .getFromID(); XMPPRoomID rID = (XMPPRoomID) msg.getChatRoomID(); - IQualifiedID id = new RosterId(cID.getUsername(), rID.getHostname()); + IQualifiedID id = new UserId(cID.getUsername(), rID.getHostname()); message.setFrom(id); } return message; diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/IDConverter.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/IDConverter.java index 5ddc9da560..b06b774a4f 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/IDConverter.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/IDConverter.java @@ -19,8 +19,6 @@ **/ package com.raytheon.uf.viz.collaboration.comm.provider.user; -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.provider.Tools; /** @@ -47,7 +45,7 @@ public class IDConverter { * @param user * @return */ - public static IQualifiedID convertFrom(org.eclipse.ecf.core.identity.ID id) { + public static UserId convertFrom(org.eclipse.ecf.core.identity.ID id) { String name = Tools.parseName(id.getName()); String host = Tools.parseHost(id.getName()); String rsc = Tools.parseResource(id.getName()); @@ -59,11 +57,11 @@ public class IDConverter { * @param user * @return */ - public static IChatID convertFrom(org.eclipse.ecf.core.user.IUser user) { + public static UserId convertFrom(org.eclipse.ecf.core.user.IUser user) { String name = Tools.parseName(user.getID().getName()); String host = Tools.parseHost(user.getID().getName()); - RosterId rosterId = new RosterId(name, host); - rosterId.setNickname(user.getNickname()); + UserId rosterId = new UserId(name, host); + rosterId.setAlias(user.getNickname()); return rosterId; } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/RosterId.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/RosterId.java deleted file mode 100644 index d442a4cabe..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/RosterId.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * 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.provider.user; - -import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; -import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID; -import com.raytheon.uf.viz.collaboration.comm.provider.Tools; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 21, 2012            jkorman     Initial creation
- * 
- * 
- * - * @author jkorman - * @version 1.0 - */ -@DynamicSerialize -public class RosterId extends UserId implements IChatID { - - @DynamicSerializeElement - protected String nickname; - - /** - * - * @param userName - * @param hostName - */ - public RosterId(String userName, String hostName) { - super(userName, hostName); - } - - /** - * - * @param userName - * @param hostName - * @param nickName - * @param resource - */ - public RosterId(String userName, String hostName, String resource) { - super(userName, hostName, resource); - } - - /** - * - * @param userName - * @param hostName - * @param nickName - * @param resource - */ - public RosterId(String userName, String hostName, String resource, - String nickName) { - super(userName, hostName, resource); - nickname = nickName; - } - - /** - * @see com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID#setNickname(java.lang.String) - */ - @Override - public void setNickname(String nickname) { - this.nickname = nickname; - } - - /** - * @see com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID#getNickname() - */ - @Override - public String getNickname() { - return nickname; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (getClass() != obj.getClass()) - return false; - RosterId other = (RosterId) obj; - if (nickname == null) { - if (other.nickname != null) - return false; - } - return true; - } - - /** - * - * @param user - * @return - */ - public static IChatID convertFrom(org.eclipse.ecf.core.user.IUser user) { - String name = Tools.parseName(user.getID().getName()); - String host = Tools.parseHost(user.getID().getName()); - return new RosterId(name, host, user.getNickname(), null); - } - -} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/UserId.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/UserId.java index 17e133c911..cf69ddbb98 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/UserId.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/UserId.java @@ -42,6 +42,8 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; @DynamicSerialize public class UserId implements IQualifiedID { + private static final String CONF_ID = "conference."; + @DynamicSerializeElement protected String name; @@ -51,9 +53,9 @@ public class UserId implements IQualifiedID { @DynamicSerializeElement protected String resource; - /** - * - */ + @DynamicSerializeElement + protected String alias; + public UserId() { } @@ -64,9 +66,7 @@ public class UserId implements IQualifiedID { * @param hostName */ public UserId(String userName, String hostName) { - this.name = userName; - this.host = hostName; - resource = null; + this(userName, hostName, null); } /** @@ -75,10 +75,16 @@ public class UserId implements IQualifiedID { * @param hostName * @param resourceName */ - public UserId(String userName, String hostName, String resourceName) { + public UserId(String userName, String hostName, String resource) { + this(userName, hostName, resource, null); + } + + public UserId(String userName, String hostName, String resource, + String alias) { this.name = userName; this.host = hostName; - resource = resourceName; + this.resource = resource; + this.alias = alias; } /** @@ -148,7 +154,11 @@ public class UserId implements IQualifiedID { public String getFQName() { StringBuilder sb = new StringBuilder(name); sb.append("@"); - sb.append(host); + String hostname = host; + if (hostname.startsWith(CONF_ID)) { + hostname = hostname.substring(CONF_ID.length()); + } + sb.append(hostname); sb.append("/"); if (resource != null) { sb.append(resource); @@ -157,6 +167,7 @@ public class UserId implements IQualifiedID { // requiring a resource for peerToPeer to go through sb.append("resource"); } + System.out.println(sb.toString()); return sb.toString(); } @@ -208,4 +219,17 @@ public class UserId implements IQualifiedID { return true; } + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + @Override + public String toString() { + return this.getFQName(); + } + } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/VenueParticipant.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/VenueParticipant.java deleted file mode 100644 index b922e23618..0000000000 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/user/VenueParticipant.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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.provider.user; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; -import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 1, 2012            jkorman     Initial creation
- * 
- * 
- * - * @author jkorman - * @version 1.0 - */ - -@DynamicSerialize -public class VenueParticipant extends RosterId implements IVenueParticipant { - - private static String CONF_ID = "conference."; - - private Map properties; - - public VenueParticipant() { - this(null, null); - } - - /** - * - */ - public VenueParticipant(String name, String host) { - this(name, host, null); - } - - /** - * - */ - public VenueParticipant(String name, String host, String resource) { - super(name, host, resource); - this.name = name; - this.host = host; - this.properties = new HashMap(); - } - - /** - * @see com.raytheon.uf.viz.collaboration.comm.identity.IPropertied#setProperty(java.lang.String, - * java.lang.String) - */ - @Override - public void setProperty(String key, String value) { - properties.put(key, value); - } - - /** - * @see com.raytheon.uf.viz.collaboration.comm.identity.IPropertied#getProperty(java.lang.String, - * java.lang.String) - */ - @Override - public String getProperty(String key, String defaultValue) { - String value = properties.get(key); - if (value == null) { - value = defaultValue; - } - return value; - } - - /** - * @see com.raytheon.uf.viz.collaboration.comm.identity.IPropertied#getProperties() - */ - @Override - public Collection getProperties() { - return null; - } - - /** - * Return the identifier as a qualified field. Removes the "domain" - * conference from the host string if found. - * - * @return The qualified id. - */ - @Override - public IQualifiedID getQualifiedId() { - String hostName = host; - if (hostName != null) { - if (hostName.startsWith(CONF_ID)) { - hostName = hostName.substring(CONF_ID.length()); - } - } - - UserId id = new UserId(getName(), hostName); - id.setResource(resource); - - return id; - } - - public void setProperties(Map properties) { - this.properties = properties; - } - - @Override - public String toString() { - return this.getFQName(); - } - -}