Issue #427 cleanup

Change-Id: I74f9d6e99849f66ef33340685fbb08b4c9c1b768

Former-commit-id: ee08cc7a0d81fd83b90398119add8fad3428283b
This commit is contained in:
Nate Jensen 2012-04-19 13:38:16 -05:00
parent 006785e374
commit efc911ac9d
34 changed files with 206 additions and 353 deletions

View file

@ -59,11 +59,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.IRosterEntry;
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; 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.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.Presence; 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.TextMessage;
import com.raytheon.uf.viz.collaboration.comm.provider.roster.RosterEntry; 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.session.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; 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.CollaborationUtils;
import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor; import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor;
@ -99,7 +99,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
/** /**
* The connection to the server. * The connection to the server.
*/ */
private SessionManager sessionManager; private CollaborationConnection sessionManager;
String loginId; String loginId;
@ -284,7 +284,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
* *
* @return sessionManager or null if unable to get connection. * @return sessionManager or null if unable to get connection.
*/ */
synchronized public SessionManager getSessionManager() { synchronized public CollaborationConnection getSessionManager() {
// Get user's server account information and make connection. // Get user's server account information and make connection.
if (isConnected() == false) { if (isConnected() == false) {
VizApp.runSync(new Runnable() { VizApp.runSync(new Runnable() {
@ -492,7 +492,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
*/ */
public String createCollaborationSession(String venue, String subject) public String createCollaborationSession(String venue, String subject)
throws CollaborationException { throws CollaborationException {
SessionManager sessionManager = getSessionManager(); CollaborationConnection sessionManager = getSessionManager();
IVenueSession session = null; IVenueSession session = null;
String sessionId = null; String sessionId = null;
// try { // try {
@ -505,7 +505,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
ISharedDisplaySession displaySession = (ISharedDisplaySession) session; ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
sessionsMap.put(sessionId, session); sessionsMap.put(sessionId, session);
SharedDisplaySessionMgr.joinSession(displaySession, SharedDisplaySessionMgr.joinSession(displaySession,
ParticipantRole.DATA_PROVIDER); SharedDisplayRole.DATA_PROVIDER);
} }
@ -514,7 +514,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
public String createTextOnlySession(String venueName, String subject) public String createTextOnlySession(String venueName, String subject)
throws CollaborationException { throws CollaborationException {
SessionManager sessionManager = getSessionManager(); CollaborationConnection sessionManager = getSessionManager();
IVenueSession session = null; IVenueSession session = null;
String sessionId = null; String sessionId = null;
session = sessionManager.createTextOnlyVenue(venueName, subject); session = sessionManager.createTextOnlyVenue(venueName, subject);
@ -577,7 +577,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
if (sharedDisplay) { if (sharedDisplay) {
ISharedDisplaySession displaySession = (ISharedDisplaySession) session; ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
SharedDisplaySessionMgr.joinSession(displaySession, SharedDisplaySessionMgr.joinSession(displaySession,
ParticipantRole.PARTICIPANT); SharedDisplayRole.PARTICIPANT);
PlatformUI PlatformUI
.getWorkbench() .getWorkbench()

View file

@ -26,7 +26,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.ui.role.DataProviderEventController; import com.raytheon.uf.viz.collaboration.ui.role.DataProviderEventController;
import com.raytheon.uf.viz.collaboration.ui.role.IRoleEventController; import com.raytheon.uf.viz.collaboration.ui.role.IRoleEventController;
import com.raytheon.uf.viz.collaboration.ui.role.ParticipantEventController; import com.raytheon.uf.viz.collaboration.ui.role.ParticipantEventController;
@ -34,7 +34,8 @@ import com.raytheon.viz.ui.VizWorkbenchManager;
import com.raytheon.viz.ui.editor.AbstractEditor; import com.raytheon.viz.ui.editor.AbstractEditor;
/** /**
* TODO Add Description * Tracks all of the active sessions that are SharedDisplaySessions. Provides
* SessionContainers that contain the data related to those sessions.
* *
* <pre> * <pre>
* *
@ -63,7 +64,7 @@ public class SharedDisplaySessionMgr {
} }
protected static void joinSession(ISharedDisplaySession session, protected static void joinSession(ISharedDisplaySession session,
ParticipantRole initialRole) { SharedDisplayRole initialRole) {
SessionContainer container = new SessionContainer(); SessionContainer container = new SessionContainer();
container.setSessionId(session.getSessionId()); container.setSessionId(session.getSessionId());
container.setSession(session); container.setSession(session);

View file

@ -83,7 +83,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.IRosterGroup;
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools; import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
import com.raytheon.uf.viz.collaboration.comm.provider.session.SessionManager; import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager; import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
import com.raytheon.uf.viz.collaboration.data.CollaborationGroup; import com.raytheon.uf.viz.collaboration.data.CollaborationGroup;
import com.raytheon.uf.viz.collaboration.data.CollaborationNode; import com.raytheon.uf.viz.collaboration.data.CollaborationNode;
@ -438,7 +438,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
Object result = dialog.getReturnValue(); Object result = dialog.getReturnValue();
if (result != null) { if (result != null) {
char[] password = result.toString().toCharArray(); char[] password = result.toString().toCharArray();
SessionManager sessionManager = CollaborationDataManager CollaborationConnection sessionManager = CollaborationDataManager
.getInstance().getSessionManager(); .getInstance().getSessionManager();
try { try {
sessionManager.getAccountManager().changePassword(password); sessionManager.getAccountManager().changePassword(password);
@ -605,7 +605,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
private void createSession() { private void createSession() {
CollaborationDataManager manager = CollaborationDataManager CollaborationDataManager manager = CollaborationDataManager
.getInstance(); .getInstance();
SessionManager sessionManager = manager.getSessionManager(); CollaborationConnection sessionManager = manager.getSessionManager();
if (sessionManager == null) { if (sessionManager == null) {
System.err.println("Unable to get session manager"); System.err.println("Unable to get session manager");
return; return;
@ -917,7 +917,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
protected void populateTree() { protected void populateTree() {
CollaborationDataManager manager = CollaborationDataManager CollaborationDataManager manager = CollaborationDataManager
.getInstance(); .getInstance();
SessionManager sessionManager = manager.getSessionManager(); CollaborationConnection sessionManager = manager.getSessionManager();
topLevel.removeChildren(); topLevel.removeChildren();
if (sessionManager == null) { if (sessionManager == null) {
usersTreeViewer.getTree().setEnabled(false); usersTreeViewer.getTree().setEnabled(false);

View file

@ -55,7 +55,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; import com.raytheon.uf.viz.collaboration.comm.identity.IPresence;
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterEventSubscriber; import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterEventSubscriber;
import com.raytheon.uf.viz.collaboration.comm.provider.session.SessionManager; import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager; import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
import com.raytheon.uf.viz.collaboration.data.DataUser; import com.raytheon.uf.viz.collaboration.data.DataUser;
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils; import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
@ -110,7 +110,7 @@ public class LoginDialog extends CaveSWTDialog {
private IRosterEventSubscriber rosterEventSubscriber; private IRosterEventSubscriber rosterEventSubscriber;
private SessionManager sessionManager; private CollaborationConnection sessionManager;
public LoginDialog(Shell parentShell, public LoginDialog(Shell parentShell,
IRosterEventSubscriber rosterEventSubscriber) { IRosterEventSubscriber rosterEventSubscriber) {
@ -378,7 +378,7 @@ public class LoginDialog extends CaveSWTDialog {
// .getSelectionIndex()], messageTF // .getSelectionIndex()], messageTF
// .getText().trim()); // .getText().trim());
try { try {
sessionManager = new SessionManager(loginData sessionManager = new CollaborationConnection(loginData
.getAccount(), loginData.getPassword(), .getAccount(), loginData.getPassword(),
rosterEventSubscriber); rosterEventSubscriber);
DataUser dUser = CollaborationDataManager DataUser dUser = CollaborationDataManager
@ -495,7 +495,7 @@ public class LoginDialog extends CaveSWTDialog {
/** /**
* @return the sessionManager * @return the sessionManager
*/ */
public SessionManager getSessionManager() { public CollaborationConnection getSessionManager() {
return sessionManager; return sessionManager;
} }
} }

View file

@ -30,7 +30,7 @@ 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.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent; 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.event.ParticipantEventType;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand;
import com.raytheon.uf.viz.collaboration.data.SessionContainer; import com.raytheon.uf.viz.collaboration.data.SessionContainer;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
@ -106,7 +106,7 @@ public class DataProviderEventController extends AbstractRoleEventController {
@Subscribe @Subscribe
public void roleTransferred(TransferRoleCommand cmd) { public void roleTransferred(TransferRoleCommand cmd) {
if (cmd.getRole() == ParticipantRole.SESSION_LEADER) { if (cmd.getRole() == SharedDisplayRole.SESSION_LEADER) {
session.setCurrentSessionLeader(cmd.getUser()); session.setCurrentSessionLeader(cmd.getUser());
if (cmd.getUser().getFQName() if (cmd.getUser().getFQName()
.equals(session.getUserID().getFQName())) { .equals(session.getUserID().getFQName())) {

View file

@ -24,7 +24,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand; import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand;
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager; import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
@ -186,7 +186,7 @@ public class ParticipantEventController extends AbstractRoleEventController {
@Subscribe @Subscribe
public void roleTransferred(TransferRoleCommand cmd) { public void roleTransferred(TransferRoleCommand cmd) {
if (cmd.getRole() == ParticipantRole.SESSION_LEADER) { if (cmd.getRole() == SharedDisplayRole.SESSION_LEADER) {
session.setCurrentSessionLeader(cmd.getUser()); session.setCurrentSessionLeader(cmd.getUser());
if (cmd.getUser().getFQName() if (cmd.getUser().getFQName()
.equals(session.getUserID().getFQName())) { .equals(session.getUserID().getFQName())) {

View file

@ -41,7 +41,7 @@ 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.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession; import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; 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.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools; 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.TransferRoleCommand;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
@ -93,7 +93,7 @@ public class CollaborationSessionView extends SessionView {
if (menu == null || menu.isDisposed()) { if (menu == null || menu.isDisposed()) {
menu = new Menu(parent); menu = new Menu(parent);
} }
if (session.hasRole(ParticipantRole.SESSION_LEADER)) { if (session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
Action leaderAction = new Action("Session Leader") { Action leaderAction = new Action("Session Leader") {
public void run() { public void run() {
IStructuredSelection selection = (IStructuredSelection) usersTable IStructuredSelection selection = (IStructuredSelection) usersTable
@ -108,7 +108,7 @@ public class CollaborationSessionView extends SessionView {
leaderItem.fill(menu, -1); leaderItem.fill(menu, -1);
} }
if (session.hasRole(ParticipantRole.DATA_PROVIDER)) { if (session.hasRole(SharedDisplayRole.DATA_PROVIDER)) {
Action dataProviderAction = new Action("Data Provider") { Action dataProviderAction = new Action("Data Provider") {
public void run() { public void run() {
IStructuredSelection selection = (IStructuredSelection) usersTable IStructuredSelection selection = (IStructuredSelection) usersTable
@ -152,7 +152,7 @@ public class CollaborationSessionView extends SessionView {
UserId vp = new UserId(Tools.parseName(fqname), Tools.parseHost(fqname)); UserId vp = new UserId(Tools.parseName(fqname), Tools.parseHost(fqname));
trc.setUser(vp); trc.setUser(vp);
session.setCurrentSessionLeader(vp); session.setCurrentSessionLeader(vp);
trc.setRole(ParticipantRole.SESSION_LEADER); trc.setRole(SharedDisplayRole.SESSION_LEADER);
try { try {
session.sendObjectToVenue(trc); session.sendObjectToVenue(trc);
} catch (CollaborationException e) { } catch (CollaborationException e) {
@ -236,8 +236,8 @@ public class CollaborationSessionView extends SessionView {
@Override @Override
protected void fillContextMenu(IMenuManager manager) { protected void fillContextMenu(IMenuManager manager) {
super.fillContextMenu(manager); super.fillContextMenu(manager);
if (session.hasRole(ParticipantRole.DATA_PROVIDER) if (session.hasRole(SharedDisplayRole.DATA_PROVIDER)
|| session.hasRole(ParticipantRole.SESSION_LEADER)) { || session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
IStructuredSelection selection = (IStructuredSelection) usersTable IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection(); .getSelection();
CollaborationUser selectedUser = (CollaborationUser) selection CollaborationUser selectedUser = (CollaborationUser) selection

View file

@ -68,7 +68,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventTyp
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo; 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.roster.IRosterEntry;
import com.raytheon.uf.viz.collaboration.comm.provider.Presence; 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.session.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; 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.CollaborationDataManager;
import com.raytheon.uf.viz.collaboration.data.CollaborationUser; import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
@ -139,7 +139,7 @@ public class SessionView extends AbstractSessionView {
@Override @Override
public void run() { public void run() {
try { try {
SessionManager sessionManager = CollaborationDataManager CollaborationConnection sessionManager = CollaborationDataManager
.getInstance().getSessionManager(); .getInstance().getSessionManager();
ISession session = sessionManager.getPeerToPeerSession(); ISession session = sessionManager.getPeerToPeerSession();
PlatformUI PlatformUI

View file

@ -25,7 +25,7 @@ import java.util.List;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.data.CollaborationUser; import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils; import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
@ -62,12 +62,12 @@ public class SharedDisplayParticipantsLabelProvider extends
.getCurrentSessionLeader()); .getCurrentSessionLeader());
String dataProviderId = CollaborationUtils.makeUserId(sdSession String dataProviderId = CollaborationUtils.makeUserId(sdSession
.getCurrentDataProvider()); .getCurrentDataProvider());
List<ParticipantRole> roleList = new ArrayList<ParticipantRole>(); List<SharedDisplayRole> roleList = new ArrayList<SharedDisplayRole>();
if (userId.equals(sessionLeaderId)) { if (userId.equals(sessionLeaderId)) {
roleList.add(ParticipantRole.SESSION_LEADER); roleList.add(SharedDisplayRole.SESSION_LEADER);
} }
if (userId.equals(dataProviderId)) { if (userId.equals(dataProviderId)) {
roleList.add(ParticipantRole.DATA_PROVIDER); roleList.add(SharedDisplayRole.DATA_PROVIDER);
} }
if (roleList.size() > 0) { if (roleList.size() > 0) {
image = getModifier(roleList, user); image = getModifier(roleList, user);
@ -86,19 +86,19 @@ public class SharedDisplayParticipantsLabelProvider extends
* - * -
* @return image - modified with indicator(s) * @return image - modified with indicator(s)
*/ */
private Image getModifier(List<ParticipantRole> roles, private Image getModifier(List<SharedDisplayRole> roles,
CollaborationUser user) { CollaborationUser user) {
String key = user.getImageKey(); String key = user.getImageKey();
StringBuilder modKey = new StringBuilder(key); StringBuilder modKey = new StringBuilder(key);
int roleCnt = 0; int roleCnt = 0;
if (roles.contains(ParticipantRole.SESSION_LEADER)) { if (roles.contains(SharedDisplayRole.SESSION_LEADER)) {
++roleCnt; ++roleCnt;
modKey.append(":") modKey.append(":")
.append(ParticipantRole.SESSION_LEADER.toString()); .append(SharedDisplayRole.SESSION_LEADER.toString());
} }
if (roles.contains(ParticipantRole.DATA_PROVIDER)) { if (roles.contains(SharedDisplayRole.DATA_PROVIDER)) {
++roleCnt; ++roleCnt;
modKey.append(":").append(ParticipantRole.DATA_PROVIDER.toString()); modKey.append(":").append(SharedDisplayRole.DATA_PROVIDER.toString());
} }
Image image = imageMap.get(modKey.toString()); Image image = imageMap.get(modKey.toString());

View file

@ -19,7 +19,7 @@
**/ **/
package com.raytheon.uf.viz.collaboration.ui.telestrator; package com.raytheon.uf.viz.collaboration.ui.telestrator;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.core.rsc.AbstractResourceData; import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
import com.raytheon.uf.viz.core.rsc.IInputHandler; import com.raytheon.uf.viz.core.rsc.IInputHandler;
@ -95,7 +95,7 @@ public class CollaborationPathDrawingTool extends PathDrawingTool {
.isAllowDraw(); .isAllowDraw();
boolean isSessionLeader = SharedDisplaySessionMgr boolean isSessionLeader = SharedDisplaySessionMgr
.getSessionContainer(session).getSession() .getSessionContainer(session).getSession()
.hasRole(ParticipantRole.SESSION_LEADER); .hasRole(SharedDisplayRole.SESSION_LEADER);
if (allowDraw && !isSessionLeader) { if (allowDraw && !isSessionLeader) {
return false; return false;
} }
@ -114,7 +114,7 @@ public class CollaborationPathDrawingTool extends PathDrawingTool {
.isAllowDraw(); .isAllowDraw();
boolean isSessionLeader = SharedDisplaySessionMgr boolean isSessionLeader = SharedDisplaySessionMgr
.getSessionContainer(session).getSession() .getSessionContainer(session).getSession()
.hasRole(ParticipantRole.SESSION_LEADER); .hasRole(SharedDisplayRole.SESSION_LEADER);
if (allowDraw && !isSessionLeader) { if (allowDraw && !isSessionLeader) {
return false; return false;
} }
@ -133,7 +133,7 @@ public class CollaborationPathDrawingTool extends PathDrawingTool {
.isAllowDraw(); .isAllowDraw();
boolean isSessionLeader = SharedDisplaySessionMgr boolean isSessionLeader = SharedDisplaySessionMgr
.getSessionContainer(session).getSession() .getSessionContainer(session).getSession()
.hasRole(ParticipantRole.SESSION_LEADER); .hasRole(SharedDisplayRole.SESSION_LEADER);
if (allowDraw && !isSessionLeader) { if (allowDraw && !isSessionLeader) {
return false; return false;
} }

View file

@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolItem; import org.eclipse.swt.widgets.ToolItem;
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession; import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr; import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.collaboration.ui.Activator; import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent; import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent;
@ -122,7 +122,7 @@ public class CollaborationPathToolbar extends PathToolbar {
ISharedDisplaySession session = SharedDisplaySessionMgr ISharedDisplaySession session = SharedDisplaySessionMgr
.getSessionContainer(sessionId).getSession(); .getSessionContainer(sessionId).getSession();
if (session != null if (session != null
&& !session.hasRole(ParticipantRole.SESSION_LEADER) && !session.hasRole(SharedDisplayRole.SESSION_LEADER)
&& leaderOnly != null) { && leaderOnly != null) {
leaderOnly.setEnabled(false); leaderOnly.setEnabled(false);
} }

View file

@ -19,14 +19,10 @@
**/ **/
package com.raytheon.uf.viz.collaboration.comm.identity; package com.raytheon.uf.viz.collaboration.comm.identity;
import java.util.Collection;
import java.util.Map; import java.util.Map;
import com.raytheon.uf.viz.collaboration.comm.identity.listener.IMessageFilter;
import com.raytheon.uf.viz.collaboration.comm.identity.listener.IPresenceListener;
import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionResponder; import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionResponder;
/** /**
* TODO Add Description * TODO Add Description
* *
@ -35,8 +31,8 @@ import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionRespo
* *
* <ul> * <ul>
* EventBus subscription events. * EventBus subscription events.
* <li>ISubscriptionResponseEvent : This event is posted when a subscription request has * <li>ISubscriptionResponseEvent : This event is posted when a subscription
* been responded to.</li> * request has been responded to.</li>
* </ul> * </ul>
* *
* *
@ -90,11 +86,13 @@ public interface IAccountManager {
* @param attributes * @param attributes
* @throws CollaborationException * @throws CollaborationException
*/ */
void createAccount(String name, char [] password, Map<String, String> attributes) throws CollaborationException; void createAccount(String name, char[] password,
Map<String, String> attributes) throws CollaborationException;
/** /**
* Allows the user to change their account password. If the server does * Allows the user to change their account password. If the server does not
* not allow this operation an exception will be thrown. * allow this operation an exception will be thrown.
*
* @param password * @param password
* @throws CollaborationException * @throws CollaborationException
*/ */
@ -105,19 +103,23 @@ public interface IAccountManager {
* be thrown if the account deletion fails. If the account is currently * be thrown if the account deletion fails. If the account is currently
* connected, it and any associated objects will be closed followed by the * connected, it and any associated objects will be closed followed by the
* account deletion. * account deletion.
*
* @throws CollaborationException * @throws CollaborationException
*/ */
void deleteAccount() throws CollaborationException; void deleteAccount() throws CollaborationException;
/** /**
* Can an account be created on the server. * Can an account be created on the server.
*
* @return Can an account be created on the server? * @return Can an account be created on the server?
* @throws CollaborationException The query failed. * @throws CollaborationException
* The query failed.
*/ */
boolean canCreateAccount() throws CollaborationException; boolean canCreateAccount() throws CollaborationException;
/** /**
* Allow the user to send presence information to the transport provider. * Allow the user to send presence information to the transport provider.
*
* @param presence * @param presence
* @return Return status information. * @return Return status information.
* @throws CollaborationException * @throws CollaborationException

View file

@ -41,17 +41,22 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.IEventPublisher;
public interface IPeerToPeer extends ISession, IEventPublisher { public interface IPeerToPeer extends ISession, IEventPublisher {
/** /**
* Send a Text message. Note that the recipient of the message is * Send a Text message. Note that the recipient of the message is included
* included as an attribute of the message. * as an attribute of the message.
*
* @param message * @param message
*/ */
int sendPeerToPeer(IMessage message); void sendPeerToPeer(IMessage message) throws CollaborationException;
/** /**
* Send a Text message to a specific receiver. * Send a Text message to a specific receiver.
* @param to The intended receiver. *
* @param message The message to send. * @param to
* The intended receiver.
* @param message
* The message to send.
*/ */
int sendPeerToPeer(String to, String message); void sendPeerToPeer(String to, String message)
throws CollaborationException;
} }

View file

@ -20,7 +20,7 @@
package com.raytheon.uf.viz.collaboration.comm.identity; 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.IQualifiedID;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
/** /**
@ -121,7 +121,7 @@ public interface ISharedDisplaySession extends IVenueSession {
* @param role * @param role
* @return * @return
*/ */
public boolean hasRole(ParticipantRole role); public boolean hasRole(SharedDisplayRole role);
/** /**
* Gets the connection status of the session. * Gets the connection status of the session.

View file

@ -19,8 +19,6 @@
**/ **/
package com.raytheon.uf.viz.collaboration.comm.identity.info; package com.raytheon.uf.viz.collaboration.comm.identity.info;
import java.util.Collection;
/** /**
* TODO Add Description * TODO Add Description
* *
@ -48,6 +46,7 @@ public interface IVenueInfo {
/** /**
* Get a long name for venue * Get a long name for venue
*
* @return * @return
*/ */
String getVenueName(); String getVenueName();
@ -66,6 +65,7 @@ public interface IVenueInfo {
/** /**
* Get a count of the current number of room participants * Get a count of the current number of room participants
*
* @return Count of the current number of room participants * @return Count of the current number of room participants
*/ */
int getParticipantCount(); int getParticipantCount();

View file

@ -41,19 +41,11 @@ import java.util.Collection;
public interface IRosterGroup extends IRosterItem { public interface IRosterGroup extends IRosterItem {
/** /**
* Collection of entries belonging to this group. This method must * Collection of entries belonging to this group. This method must always
* always return a not null collection with zero or more entries. * return a not null collection with zero or more entries.
*
* @return Entries belonging to this group. * @return Entries belonging to this group.
*/ */
Collection<IRosterEntry> getEntries(); Collection<IRosterEntry> getEntries();
/**
* Collection of nested groups belonging to this group. This method must
* return a null reference if nested groups are not allowed. If nested
* groups are allowed the method must return a not null collection with
* zero or more entries.
* @return Groups belonging to this group.
*/
Collection<IRosterGroup> getGroups();
} }

View file

@ -19,7 +19,6 @@
**/ **/
package com.raytheon.uf.viz.collaboration.comm.identity.roster; package com.raytheon.uf.viz.collaboration.comm.identity.roster;
/** /**
* *
* *
@ -51,9 +50,4 @@ public interface IRosterItem {
*/ */
IRosterItem getParent(); IRosterItem getParent();
/**
* Get a reference to the roster containing this item.
* @return The containing roster.
*/
IRoster getRoster();
} }

View file

@ -40,10 +40,4 @@ public interface IVenueId extends IQualifiedID {
String getVenueName(); String getVenueName();
String getDomain();
} }

View file

@ -36,6 +36,6 @@ package com.raytheon.uf.viz.collaboration.comm.identity.user;
* @version 1.0 * @version 1.0
*/ */
public enum ParticipantRole { public enum SharedDisplayRole {
DATA_PROVIDER, SESSION_LEADER, PARTICIPANT; DATA_PROVIDER, SESSION_LEADER, PARTICIPANT;
} }

View file

@ -1,58 +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;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 8, 2012 jkorman Initial creation
*
* </pre>
*
* @author jkorman
* @version 1.0
*/
public abstract class Errors {
public static final int NO_ERROR = 0;
public static final int CANNOT_CONNECT = -50;
public static final int ALREADY_CONNECTED = -51;
public static final int BAD_NAME = -52;
// Error - An attempt to use a Venue that has been disposed.
public static final int VENUE_DISPOSED = -100;
// Error - Venue exists when attempting to create a new venue.
public static final int VENUE_EXISTS = -101;
// Error - Venue not found when attempting to join an existing venue.
public static final int VENUE_NOT_FOUND = -102;
}

View file

@ -21,7 +21,7 @@ package com.raytheon.uf.viz.collaboration.comm.provider;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
/** /**
@ -45,16 +45,16 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
public class TransferRoleCommand { public class TransferRoleCommand {
@DynamicSerializeElement @DynamicSerializeElement
private ParticipantRole role; private SharedDisplayRole role;
@DynamicSerializeElement @DynamicSerializeElement
private UserId user; private UserId user;
public ParticipantRole getRole() { public SharedDisplayRole getRole() {
return role; return role;
} }
public void setRole(ParticipantRole role) { public void setRole(SharedDisplayRole role) {
this.role = role; this.role = role;
} }

View file

@ -124,11 +124,6 @@ public class Roster extends RosterItem implements IRoster {
if (re == null) { if (re == null) {
// put in the internal entries first. // put in the internal entries first.
internalEntries.put(entry.getUser(), entry); internalEntries.put(entry.getUser(), entry);
for (IRosterGroup g : entry.getGroups()) {
RosterGroup rg = (RosterGroup) g;
rg.setRoster(this);
}
} }
} }

View file

@ -51,15 +51,12 @@ public class RosterGroup extends RosterItem implements IRosterGroup {
private Map<IQualifiedID, IRosterEntry> entries = null; private Map<IQualifiedID, IRosterEntry> entries = null;
private Map<IRosterGroup, IRosterGroup> groups = null;
/** /**
* *
*/ */
public RosterGroup(String name, IRosterItem parent, IRoster roster) { public RosterGroup(String name, IRosterItem parent, IRoster roster) {
super(name, parent, roster); super(name, parent, roster);
entries = new HashMap<IQualifiedID, IRosterEntry>(); entries = new HashMap<IQualifiedID, IRosterEntry>();
groups = new HashMap<IRosterGroup, IRosterGroup>();
} }
/** /**
@ -97,12 +94,4 @@ public class RosterGroup extends RosterItem implements IRosterGroup {
return entries.remove(entry.getUser()); return entries.remove(entry.getUser());
} }
/**
*
* @see com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup#getGroups()
*/
@Override
public Collection<IRosterGroup> getGroups() {
return groups.values();
}
} }

View file

@ -63,9 +63,6 @@ public class RosterItem implements IRosterItem {
// //
private IRosterItem parent = null; private IRosterItem parent = null;
//
private IRoster roster = null;
/** /**
* *
* @param name * @param name
@ -75,7 +72,6 @@ public class RosterItem implements IRosterItem {
public RosterItem(String name, IRosterItem parent, IRoster roster) { public RosterItem(String name, IRosterItem parent, IRoster roster) {
this.name = name; this.name = name;
this.parent = parent; this.parent = parent;
this.roster = roster;
} }
/** /**
@ -127,23 +123,6 @@ public class RosterItem implements IRosterItem {
return parent; return parent;
} }
/**
*
* @param roster
*/
public void setRoster(IRoster roster) {
this.roster = roster;
}
/**
*
* @see com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterItem#getRoster()
*/
@Override
public IRoster getRoster() {
return null;
}
/** /**
* *
* @see java.lang.Object#hashCode() * @see java.lang.Object#hashCode()

View file

@ -33,7 +33,7 @@ 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.IRosterEntry;
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager; import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager;
import com.raytheon.uf.viz.collaboration.comm.provider.Presence; 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.session.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter; import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
@ -56,19 +56,17 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
public class RosterManager implements IRosterManager { public class RosterManager implements IRosterManager {
private String owner;
private IRoster roster; private IRoster roster;
private org.eclipse.ecf.presence.roster.IRoster baseRoster; private org.eclipse.ecf.presence.roster.IRoster baseRoster;
private SessionManager sessionManager; private CollaborationConnection sessionManager;
/** /**
* *
* @param roster * @param roster
*/ */
public RosterManager(SessionManager manager) { public RosterManager(CollaborationConnection manager) {
sessionManager = manager; sessionManager = manager;
updateRoster(); updateRoster();
} }
@ -243,12 +241,8 @@ public class RosterManager implements IRosterManager {
* *
* @return * @return
*/ */
public SessionManager getSessionManager() { public CollaborationConnection getSessionManager() {
return sessionManager; return sessionManager;
} }
private void printRoster(IRoster roster) {
}
} }

View file

@ -35,7 +35,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IPresence;
import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionResponder; import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionResponder;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID; 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.Presence;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
/** /**
* TODO Add Description * TODO Add Description
@ -102,13 +101,14 @@ public class AccountManager implements IAccountManager {
private ISubscriptionResponder responder; private ISubscriptionResponder responder;
private SessionManager sessionManager = null; private CollaborationConnection sessionManager = null;
/** /**
* *
* @param adapter * @param adapter
*/ */
AccountManager(IPresenceContainerAdapter adapter, SessionManager manager) { AccountManager(IPresenceContainerAdapter adapter,
CollaborationConnection manager) {
sessionManager = manager; sessionManager = manager;
presenceAdapter = adapter; presenceAdapter = adapter;
presenceAdapter.getRosterManager().addRosterSubscriptionListener( presenceAdapter.getRosterManager().addRosterSubscriptionListener(
@ -246,7 +246,8 @@ public class AccountManager implements IAccountManager {
try { try {
manager.createAccount(name, new String(password), map); manager.createAccount(name, new String(password), map);
} catch (ECFException e) { } catch (ECFException e) {
throw new CollaborationException("Could not create account "); throw new CollaborationException(
"Could not create account ");
} }
} }
// all done so clear the password. // all done so clear the password.
@ -298,6 +299,4 @@ public class AccountManager implements IAccountManager {
} }
} }
} }

View file

@ -69,7 +69,7 @@ public abstract class BaseSession implements ISession {
private Namespace connectionNamespace = null; private Namespace connectionNamespace = null;
// The session manager that created this session. // The session manager that created this session.
private SessionManager sessionManager; private CollaborationConnection sessionManager;
/** /**
* *
@ -78,7 +78,7 @@ public abstract class BaseSession implements ISession {
* @param manager * @param manager
*/ */
protected BaseSession(IContainer container, EventBus externalBus, protected BaseSession(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException { CollaborationConnection manager) throws CollaborationException {
this(container, externalBus, manager, UUID.randomUUID().toString()); this(container, externalBus, manager, UUID.randomUUID().toString());
} }
@ -90,7 +90,7 @@ public abstract class BaseSession implements ISession {
* @param sessionId * @param sessionId
*/ */
protected BaseSession(IContainer container, EventBus externalBus, protected BaseSession(IContainer container, EventBus externalBus,
SessionManager manager, String sessionId) CollaborationConnection manager, String sessionId)
throws CollaborationException { throws CollaborationException {
// Set the session identifier. // Set the session identifier.
this.sessionId = sessionId; this.sessionId = sessionId;
@ -161,7 +161,7 @@ public abstract class BaseSession implements ISession {
* *
* @return * @return
*/ */
SessionManager getSessionManager() { CollaborationConnection getSessionManager() {
return sessionManager; return sessionManager;
} }

View file

@ -101,6 +101,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 24, 2012 jkorman Initial creation * Feb 24, 2012 jkorman Initial creation
* Apr 18, 2012 njensen Major cleanup
* *
* </pre> * </pre>
* *
@ -109,10 +110,10 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
* @see com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueInvitationEvent * @see com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueInvitationEvent
*/ */
public class SessionManager implements IEventPublisher { public class CollaborationConnection implements IEventPublisher {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SessionManager.class); .getHandler(CollaborationConnection.class);
private static final String PROVIDER = "ecf.xmpp.smack"; private static final String PROVIDER = "ecf.xmpp.smack";
@ -154,7 +155,7 @@ public class SessionManager implements IEventPublisher {
* @throws ContainerCreateException * @throws ContainerCreateException
* *
*/ */
public SessionManager(String account, String password) public CollaborationConnection(String account, String password)
throws CollaborationException { throws CollaborationException {
this(account, password, (IRosterEventSubscriber) null); this(account, password, (IRosterEventSubscriber) null);
} }
@ -170,7 +171,7 @@ public class SessionManager implements IEventPublisher {
* @throws ContainerCreateException * @throws ContainerCreateException
* *
*/ */
public SessionManager(String account, String password, public CollaborationConnection(String account, String password,
IPresence initialPresence) throws Exception { IPresence initialPresence) throws Exception {
this(account, password, (IRosterEventSubscriber) null); this(account, password, (IRosterEventSubscriber) null);
if (accountManager != null) { if (accountManager != null) {
@ -192,7 +193,7 @@ public class SessionManager implements IEventPublisher {
* A roster event subscriber. * A roster event subscriber.
* @throws CollaborationException * @throws CollaborationException
*/ */
public SessionManager(String account, String password, public CollaborationConnection(String account, String password,
IRosterEventSubscriber rosterEventSubscriber) IRosterEventSubscriber rosterEventSubscriber)
throws CollaborationException { throws CollaborationException {
eventBus = new EventBus(); eventBus = new EventBus();
@ -484,9 +485,9 @@ public class SessionManager implements IEventPublisher {
session.joinVenue(venueName); session.joinVenue(venueName);
sessions.put(session.getSessionId(), session); sessions.put(session.getSessionId(), session);
} }
} catch (Exception e) { } catch (Exception e) {
throw new CollaborationException(
"Error joining venue " + venueName, e);
} }
return session; return session;
} }
@ -506,9 +507,9 @@ public class SessionManager implements IEventPublisher {
session.createVenue(venueName, subject); session.createVenue(venueName, subject);
sessions.put(session.getSessionId(), session); sessions.put(session.getSessionId(), session);
} }
} catch (Exception e) { } catch (Exception e) {
throw new CollaborationException("Error creating venue "
+ venueName, e);
} }
return session; return session;
} }
@ -542,11 +543,7 @@ public class SessionManager implements IEventPublisher {
info.add(vi); info.add(vi);
} }
} }
} else {
// Could not create venueManager
} }
} else {
// not currently connected
} }
return info; return info;
@ -578,8 +575,6 @@ public class SessionManager implements IEventPublisher {
if (rosterManager != null) { if (rosterManager != null) {
((RosterManager) rosterManager).updateEntry(id, p); ((RosterManager) rosterManager).updateEntry(id, p);
} else {
// No rosterManager - nothing to do
} }
} }
}); });
@ -644,8 +639,7 @@ public class SessionManager implements IEventPublisher {
private void setupP2PComm(IPresenceContainerAdapter presenceAdapter) { private void setupP2PComm(IPresenceContainerAdapter presenceAdapter) {
if (isConnected() && (presenceAdapter != null)) { if (isConnected() && (presenceAdapter != null)) {
PeerToPeerCommHelper helper = new PeerToPeerCommHelper(this, PeerToPeerCommHelper helper = new PeerToPeerCommHelper(this);
presenceAdapter);
presenceAdapter.getChatManager().addMessageListener(helper); presenceAdapter.getChatManager().addMessageListener(helper);
} }
} }

View file

@ -34,7 +34,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.IMessage; import com.raytheon.uf.viz.collaboration.comm.identity.IMessage;
import com.raytheon.uf.viz.collaboration.comm.identity.IPeerToPeer; import com.raytheon.uf.viz.collaboration.comm.identity.IPeerToPeer;
import com.raytheon.uf.viz.collaboration.comm.identity.IPropertied.Property; import com.raytheon.uf.viz.collaboration.comm.identity.IPropertied.Property;
import com.raytheon.uf.viz.collaboration.comm.provider.Errors;
/** /**
* *
@ -48,6 +47,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Errors;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 21, 2012 jkorman Initial creation * Mar 21, 2012 jkorman Initial creation
* Apr 18, 2012 njensen Cleanup
* *
* </pre> * </pre>
* *
@ -66,19 +66,18 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
* @param manager * @param manager
*/ */
PeerToPeerChat(IContainer container, EventBus externalBus, PeerToPeerChat(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException { CollaborationConnection manager) throws CollaborationException {
super(container, externalBus, manager); super(container, externalBus, manager);
chatSender = getConnectionPresenceAdapter().getChatManager() chatSender = getConnectionPresenceAdapter().getChatManager()
.getChatMessageSender(); .getChatMessageSender();
} }
/** /**
* @throws CollaborationException
* *
*/ */
@Override @Override
public int sendPeerToPeer(IMessage message) { public void sendPeerToPeer(IMessage message) throws CollaborationException {
// Assume success
int status = Errors.NO_ERROR;
if (chatSender != null) { if (chatSender != null) {
ID toID = createID(message.getTo().getFQName()); ID toID = createID(message.getTo().getFQName());
String subject = message.getSubject(); String subject = message.getSubject();
@ -95,11 +94,11 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
chatSender.sendChatMessage(toID, null, IChatMessage.Type.CHAT, chatSender.sendChatMessage(toID, null, IChatMessage.Type.CHAT,
subject, body, props); subject, body, props);
} catch (ECFException e) { } catch (ECFException e) {
System.out.println("Error sending message"); throw new CollaborationException(
e.printStackTrace(); "Error sending message to peer "
+ message.getTo().getName(), e);
} }
} }
return status;
} }
/** /**
@ -109,20 +108,18 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
* The recipient of the message. * The recipient of the message.
* @param message * @param message
* The body of the message to send. * The body of the message to send.
* @throws CollaborationException
*/ */
@Override @Override
public int sendPeerToPeer(String to, String message) { public void sendPeerToPeer(String to, String message)
// Assume success throws CollaborationException {
int status = Errors.NO_ERROR;
ID toID = createID(to); ID toID = createID(to);
try { try {
chatSender.sendChatMessage(toID, message); chatSender.sendChatMessage(toID, message);
} catch (ECFException e) { } catch (ECFException e) {
System.out.println("Error sending message"); throw new CollaborationException("Error sending message to peer "
e.printStackTrace(); + to, e);
} }
return status;
} }
/** /**

View file

@ -23,7 +23,6 @@ import java.util.Map;
import org.eclipse.ecf.presence.IIMMessageEvent; import org.eclipse.ecf.presence.IIMMessageEvent;
import org.eclipse.ecf.presence.IIMMessageListener; import org.eclipse.ecf.presence.IIMMessageListener;
import org.eclipse.ecf.presence.IPresenceContainerAdapter;
import org.eclipse.ecf.presence.im.IChatMessage; import org.eclipse.ecf.presence.im.IChatMessage;
import org.eclipse.ecf.presence.im.IChatMessageEvent; import org.eclipse.ecf.presence.im.IChatMessageEvent;
@ -55,18 +54,14 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
public class PeerToPeerCommHelper implements IIMMessageListener { public class PeerToPeerCommHelper implements IIMMessageListener {
private SessionManager manager; private CollaborationConnection manager;
private IPresenceContainerAdapter presenceAdapter;
/** /**
* *
* @param manager * @param manager
* @param presenceAdapter * @param presenceAdapter
*/ */
PeerToPeerCommHelper(SessionManager manager, PeerToPeerCommHelper(CollaborationConnection manager) {
IPresenceContainerAdapter presenceAdapter) {
this.presenceAdapter = presenceAdapter;
this.manager = manager; this.manager = manager;
} }

View file

@ -25,13 +25,13 @@ import com.google.common.eventbus.EventBus;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException; 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.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite; import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole; import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage; 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.Tools;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId; import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
/** /**
* TODO Add Description * A session that shares editors.
* *
* <pre> * <pre>
* *
@ -55,12 +55,12 @@ public class SharedDisplaySession extends VenueSession implements
private UserId dataProvider = null; private UserId dataProvider = null;
public SharedDisplaySession(IContainer container, EventBus externalBus, public SharedDisplaySession(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException { CollaborationConnection manager) throws CollaborationException {
super(container, externalBus, manager); super(container, externalBus, manager);
} }
public SharedDisplaySession(IContainer container, EventBus externalBus, public SharedDisplaySession(IContainer container, EventBus externalBus,
SessionManager manager, String sessionId) CollaborationConnection manager, String sessionId)
throws CollaborationException { throws CollaborationException {
super(container, externalBus, manager, sessionId); super(container, externalBus, manager, sessionId);
} }
@ -115,15 +115,15 @@ public class SharedDisplaySession extends VenueSession implements
} }
/** /**
* @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#hasRole(com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole) * @see com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession#hasRole(com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole)
*/ */
@Override @Override
public boolean hasRole(ParticipantRole role) { public boolean hasRole(SharedDisplayRole role) {
boolean result = true; boolean result = true;
if (role.equals(ParticipantRole.DATA_PROVIDER) if (role.equals(SharedDisplayRole.DATA_PROVIDER)
&& !this.getUserID().equals(this.getCurrentDataProvider())) { && !this.getUserID().equals(this.getCurrentDataProvider())) {
result = false; result = false;
} else if (role.equals(ParticipantRole.SESSION_LEADER) } else if (role.equals(SharedDisplayRole.SESSION_LEADER)
&& !this.getUserID().equals(this.getCurrentSessionLeader())) { && !this.getUserID().equals(this.getCurrentSessionLeader())) {
result = false; result = false;
} }

View file

@ -84,6 +84,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 24, 2012 jkorman Initial creation * Feb 24, 2012 jkorman Initial creation
* Apr 17, 2012 njensen Major refactor
* *
* </pre> * </pre>
* *
@ -123,7 +124,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
* @param eventBus * @param eventBus
*/ */
protected VenueSession(IContainer container, EventBus externalBus, protected VenueSession(IContainer container, EventBus externalBus,
SessionManager manager, String sessionId) CollaborationConnection manager, String sessionId)
throws CollaborationException { throws CollaborationException {
super(container, externalBus, manager, sessionId); super(container, externalBus, manager, sessionId);
} }
@ -134,7 +135,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
* @param eventBus * @param eventBus
*/ */
protected VenueSession(IContainer container, EventBus externalBus, protected VenueSession(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException { CollaborationConnection manager) throws CollaborationException {
super(container, externalBus, manager); super(container, externalBus, manager);
} }
@ -441,7 +442,6 @@ public class VenueSession extends BaseSession implements IVenueSession {
ID from = message.getFromID(); ID from = message.getFromID();
String name = Tools.parseName(from.getName()); String name = Tools.parseName(from.getName());
String host = Tools.parseHost(from.getName());
String account = getSessionManager().getAccount(); String account = getSessionManager().getAccount();
String aName = Tools.parseName(account); String aName = Tools.parseName(account);

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 24, 2012 jkorman Initial creation * Feb 24, 2012 jkorman Initial creation
* Apr 18, 2012 njensen Major refactor
* *
* </pre> * </pre>
* *
@ -171,11 +172,19 @@ public class UserId implements IQualifiedID {
return sb.toString(); return sb.toString();
} }
/* public String getAlias() {
* (non-Javadoc) return alias;
* }
* @see java.lang.Object#hashCode()
*/ public void setAlias(String alias) {
this.alias = alias;
}
@Override
public String toString() {
return this.getFQName();
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
@ -187,18 +196,13 @@ public class UserId implements IQualifiedID {
return result; return result;
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj)
return true; return true;
if (obj == null) if (obj == null)
return false; return false;
if (getClass() != obj.getClass()) if (!(obj instanceof UserId))
return false; return false;
UserId other = (UserId) obj; UserId other = (UserId) obj;
if (host == null) { if (host == null) {
@ -219,17 +223,4 @@ public class UserId implements IQualifiedID {
return true; return true;
} }
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
@Override
public String toString() {
return this.getFQName();
}
} }

View file

@ -48,8 +48,6 @@ public class VenueId implements IVenueId {
private String name; private String name;
private String domain;
/** /**
* @see com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID#setHost(java.lang.String) * @see com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID#setHost(java.lang.String)
*/ */
@ -115,12 +113,4 @@ public class VenueId implements IVenueId {
return venueName; return venueName;
} }
/**
* @see com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueId#getDomain()
*/
@Override
public String getDomain() {
return null;
}
} }