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.IRosterGroup;
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.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.session.CollaborationConnection;
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;
@ -99,7 +99,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
/**
* The connection to the server.
*/
private SessionManager sessionManager;
private CollaborationConnection sessionManager;
String loginId;
@ -284,7 +284,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
*
* @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.
if (isConnected() == false) {
VizApp.runSync(new Runnable() {
@ -492,7 +492,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
*/
public String createCollaborationSession(String venue, String subject)
throws CollaborationException {
SessionManager sessionManager = getSessionManager();
CollaborationConnection sessionManager = getSessionManager();
IVenueSession session = null;
String sessionId = null;
// try {
@ -505,7 +505,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
sessionsMap.put(sessionId, session);
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)
throws CollaborationException {
SessionManager sessionManager = getSessionManager();
CollaborationConnection sessionManager = getSessionManager();
IVenueSession session = null;
String sessionId = null;
session = sessionManager.createTextOnlyVenue(venueName, subject);
@ -577,7 +577,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
if (sharedDisplay) {
ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
SharedDisplaySessionMgr.joinSession(displaySession,
ParticipantRole.PARTICIPANT);
SharedDisplayRole.PARTICIPANT);
PlatformUI
.getWorkbench()

View file

@ -26,7 +26,7 @@ import java.util.Map;
import java.util.Set;
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.IRoleEventController;
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;
/**
* TODO Add Description
* Tracks all of the active sessions that are SharedDisplaySessions. Provides
* SessionContainers that contain the data related to those sessions.
*
* <pre>
*
@ -63,7 +64,7 @@ public class SharedDisplaySessionMgr {
}
protected static void joinSession(ISharedDisplaySession session,
ParticipantRole initialRole) {
SharedDisplayRole initialRole) {
SessionContainer container = new SessionContainer();
container.setSessionId(session.getSessionId());
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.IRosterManager;
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.CollaborationGroup;
import com.raytheon.uf.viz.collaboration.data.CollaborationNode;
@ -438,7 +438,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
Object result = dialog.getReturnValue();
if (result != null) {
char[] password = result.toString().toCharArray();
SessionManager sessionManager = CollaborationDataManager
CollaborationConnection sessionManager = CollaborationDataManager
.getInstance().getSessionManager();
try {
sessionManager.getAccountManager().changePassword(password);
@ -605,7 +605,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
private void createSession() {
CollaborationDataManager manager = CollaborationDataManager
.getInstance();
SessionManager sessionManager = manager.getSessionManager();
CollaborationConnection sessionManager = manager.getSessionManager();
if (sessionManager == null) {
System.err.println("Unable to get session manager");
return;
@ -917,7 +917,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
protected void populateTree() {
CollaborationDataManager manager = CollaborationDataManager
.getInstance();
SessionManager sessionManager = manager.getSessionManager();
CollaborationConnection sessionManager = manager.getSessionManager();
topLevel.removeChildren();
if (sessionManager == null) {
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.viz.collaboration.comm.identity.IPresence;
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.DataUser;
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
@ -110,7 +110,7 @@ public class LoginDialog extends CaveSWTDialog {
private IRosterEventSubscriber rosterEventSubscriber;
private SessionManager sessionManager;
private CollaborationConnection sessionManager;
public LoginDialog(Shell parentShell,
IRosterEventSubscriber rosterEventSubscriber) {
@ -378,7 +378,7 @@ public class LoginDialog extends CaveSWTDialog {
// .getSelectionIndex()], messageTF
// .getText().trim());
try {
sessionManager = new SessionManager(loginData
sessionManager = new CollaborationConnection(loginData
.getAccount(), loginData.getPassword(),
rosterEventSubscriber);
DataUser dUser = CollaborationDataManager
@ -495,7 +495,7 @@ public class LoginDialog extends CaveSWTDialog {
/**
* @return the sessionManager
*/
public SessionManager getSessionManager() {
public CollaborationConnection getSessionManager() {
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.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.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand;
import com.raytheon.uf.viz.collaboration.data.SessionContainer;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
@ -106,7 +106,7 @@ public class DataProviderEventController extends AbstractRoleEventController {
@Subscribe
public void roleTransferred(TransferRoleCommand cmd) {
if (cmd.getRole() == ParticipantRole.SESSION_LEADER) {
if (cmd.getRole() == SharedDisplayRole.SESSION_LEADER) {
session.setCurrentSessionLeader(cmd.getUser());
if (cmd.getUser().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.Priority;
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.data.CollaborationDataManager;
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
@ -186,7 +186,7 @@ public class ParticipantEventController extends AbstractRoleEventController {
@Subscribe
public void roleTransferred(TransferRoleCommand cmd) {
if (cmd.getRole() == ParticipantRole.SESSION_LEADER) {
if (cmd.getRole() == SharedDisplayRole.SESSION_LEADER) {
session.setCurrentSessionLeader(cmd.getUser());
if (cmd.getUser().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.IVenueSession;
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.TransferRoleCommand;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
@ -93,7 +93,7 @@ public class CollaborationSessionView extends SessionView {
if (menu == null || menu.isDisposed()) {
menu = new Menu(parent);
}
if (session.hasRole(ParticipantRole.SESSION_LEADER)) {
if (session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
Action leaderAction = new Action("Session Leader") {
public void run() {
IStructuredSelection selection = (IStructuredSelection) usersTable
@ -108,7 +108,7 @@ public class CollaborationSessionView extends SessionView {
leaderItem.fill(menu, -1);
}
if (session.hasRole(ParticipantRole.DATA_PROVIDER)) {
if (session.hasRole(SharedDisplayRole.DATA_PROVIDER)) {
Action dataProviderAction = new Action("Data Provider") {
public void run() {
IStructuredSelection selection = (IStructuredSelection) usersTable
@ -152,7 +152,7 @@ public class CollaborationSessionView extends SessionView {
UserId vp = new UserId(Tools.parseName(fqname), Tools.parseHost(fqname));
trc.setUser(vp);
session.setCurrentSessionLeader(vp);
trc.setRole(ParticipantRole.SESSION_LEADER);
trc.setRole(SharedDisplayRole.SESSION_LEADER);
try {
session.sendObjectToVenue(trc);
} catch (CollaborationException e) {
@ -236,8 +236,8 @@ public class CollaborationSessionView extends SessionView {
@Override
protected void fillContextMenu(IMenuManager manager) {
super.fillContextMenu(manager);
if (session.hasRole(ParticipantRole.DATA_PROVIDER)
|| session.hasRole(ParticipantRole.SESSION_LEADER)) {
if (session.hasRole(SharedDisplayRole.DATA_PROVIDER)
|| session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
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.roster.IRosterEntry;
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.data.CollaborationDataManager;
import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
@ -139,7 +139,7 @@ public class SessionView extends AbstractSessionView {
@Override
public void run() {
try {
SessionManager sessionManager = CollaborationDataManager
CollaborationConnection sessionManager = CollaborationDataManager
.getInstance().getSessionManager();
ISession session = sessionManager.getPeerToPeerSession();
PlatformUI

View file

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

View file

@ -19,7 +19,7 @@
**/
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.core.rsc.AbstractResourceData;
import com.raytheon.uf.viz.core.rsc.IInputHandler;
@ -95,7 +95,7 @@ public class CollaborationPathDrawingTool extends PathDrawingTool {
.isAllowDraw();
boolean isSessionLeader = SharedDisplaySessionMgr
.getSessionContainer(session).getSession()
.hasRole(ParticipantRole.SESSION_LEADER);
.hasRole(SharedDisplayRole.SESSION_LEADER);
if (allowDraw && !isSessionLeader) {
return false;
}
@ -114,7 +114,7 @@ public class CollaborationPathDrawingTool extends PathDrawingTool {
.isAllowDraw();
boolean isSessionLeader = SharedDisplaySessionMgr
.getSessionContainer(session).getSession()
.hasRole(ParticipantRole.SESSION_LEADER);
.hasRole(SharedDisplayRole.SESSION_LEADER);
if (allowDraw && !isSessionLeader) {
return false;
}
@ -133,7 +133,7 @@ public class CollaborationPathDrawingTool extends PathDrawingTool {
.isAllowDraw();
boolean isSessionLeader = SharedDisplaySessionMgr
.getSessionContainer(session).getSession()
.hasRole(ParticipantRole.SESSION_LEADER);
.hasRole(SharedDisplayRole.SESSION_LEADER);
if (allowDraw && !isSessionLeader) {
return false;
}

View file

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

View file

@ -19,14 +19,10 @@
**/
package com.raytheon.uf.viz.collaboration.comm.identity;
import java.util.Collection;
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;
/**
* TODO Add Description
*
@ -35,8 +31,8 @@ import com.raytheon.uf.viz.collaboration.comm.identity.roster.ISubscriptionRespo
*
* <ul>
* EventBus subscription events.
* <li>ISubscriptionResponseEvent : This event is posted when a subscription request has
* been responded to.</li>
* <li>ISubscriptionResponseEvent : This event is posted when a subscription
* request has been responded to.</li>
* </ul>
*
*
@ -73,16 +69,16 @@ public interface IAccountManager {
boolean getAutoSubscriptionMode();
/**
*
*
* @param responder
*/
void setSubscriptionRequestResponder(ISubscriptionResponder responder);
/**
* Removes the current subscription request responder.
*/
void removeSubscriptionRequestResponder();
/**
*
* @param name
@ -90,34 +86,40 @@ public interface IAccountManager {
* @param attributes
* @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
* not allow this operation an exception will be thrown.
* Allows the user to change their account password. If the server does not
* allow this operation an exception will be thrown.
*
* @param password
* @throws CollaborationException
*/
void changePassword(char [] password) throws CollaborationException;
void changePassword(char[] password) throws CollaborationException;
/**
* Allows the user to delete this account on the server. An exception will
* 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
* account deletion.
*
* @throws CollaborationException
*/
void deleteAccount() throws CollaborationException;
/**
* 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;
/**
* Allow the user to send presence information to the transport provider.
*
* @param presence
* @return Return status information.
* @throws CollaborationException

View file

@ -25,33 +25,38 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.IEventPublisher;
* TODO Add Description
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 21, 2012 jkorman Initial creation
*
*
* </pre>
*
*
* @author jkorman
* @version 1.0
* @version 1.0
*/
public interface IPeerToPeer extends ISession, IEventPublisher {
/**
* Send a Text message. Note that the recipient of the message is
* included as an attribute of the message.
* Send a Text message. Note that the recipient of the message is included
* as an attribute of the message.
*
* @param message
*/
int sendPeerToPeer(IMessage message);
void sendPeerToPeer(IMessage message) throws CollaborationException;
/**
* 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;
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;
/**
@ -121,7 +121,7 @@ public interface ISharedDisplaySession extends IVenueSession {
* @param role
* @return
*/
public boolean hasRole(ParticipantRole role);
public boolean hasRole(SharedDisplayRole role);
/**
* Gets the connection status of the session.

View file

@ -19,73 +19,73 @@
**/
package com.raytheon.uf.viz.collaboration.comm.identity.info;
import java.util.Collection;
/**
* TODO Add Description
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 1, 2012 jkorman Initial creation
*
*
* </pre>
*
*
* @author jkorman
* @version 1.0
* @version 1.0
*/
public interface IVenueInfo {
/**
*
* @return
*/
String getVenueDescription();
/**
* Get a long name for venue
*
* @return
*/
String getVenueName();
/**
*
* @return
*/
String getVenueSubject();
/**
*
* @return
*/
String getVenueID();
/**
* Get a count of the current number of room participants
* @return 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
*/
int getParticipantCount();
/**
*
* @return
*/
boolean isModerated();
/**
*
* @return
*/
boolean isPersistent();
/**
*
* @return
*/
boolean requiresPassword();
}

View file

@ -25,35 +25,27 @@ import java.util.Collection;
* TODO Add Description
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 27, 2012 jkorman Initial creation
*
*
* </pre>
*
*
* @author jkorman
* @version 1.0
* @version 1.0
*/
public interface IRosterGroup extends IRosterItem {
/**
* Collection of entries belonging to this group. This method must
* always return a not null collection with zero or more entries.
* Collection of entries belonging to this group. This method must always
* return a not null collection with zero or more entries.
*
* @return Entries belonging to this group.
*/
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();
Collection<IRosterEntry> getEntries();
}

View file

@ -19,22 +19,21 @@
**/
package com.raytheon.uf.viz.collaboration.comm.identity.roster;
/**
*
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 27, 2012 jkorman Initial creation
*
*
* </pre>
*
*
* @author jkorman
* @version 1.0
* @version 1.0
*/
public interface IRosterItem {
@ -44,16 +43,11 @@ public interface IRosterItem {
* @return
*/
String getName();
/**
*
* @return
*/
IRosterItem getParent();
/**
* Get a reference to the roster containing this item.
* @return The containing roster.
*/
IRoster getRoster();
}

View file

@ -23,27 +23,21 @@ package com.raytheon.uf.viz.collaboration.comm.identity.user;
* TODO Add Description
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 jkorman Initial creation
*
*
* </pre>
*
*
* @author jkorman
* @version 1.0
* @version 1.0
*/
public interface IVenueId extends IQualifiedID {
String getVenueName();
String getDomain();
}

View file

@ -36,6 +36,6 @@ package com.raytheon.uf.viz.collaboration.comm.identity.user;
* @version 1.0
*/
public enum ParticipantRole {
public enum SharedDisplayRole {
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.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;
/**
@ -45,16 +45,16 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
public class TransferRoleCommand {
@DynamicSerializeElement
private ParticipantRole role;
private SharedDisplayRole role;
@DynamicSerializeElement
private UserId user;
public ParticipantRole getRole() {
public SharedDisplayRole getRole() {
return role;
}
public void setRole(ParticipantRole role) {
public void setRole(SharedDisplayRole role) {
this.role = role;
}

View file

@ -124,11 +124,6 @@ public class Roster extends RosterItem implements IRoster {
if (re == null) {
// put in the internal entries first.
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<IRosterGroup, IRosterGroup> groups = null;
/**
*
*/
public RosterGroup(String name, IRosterItem parent, IRoster roster) {
super(name, parent, roster);
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());
}
/**
*
* @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 IRoster roster = null;
/**
*
* @param name
@ -75,7 +72,6 @@ public class RosterItem implements IRosterItem {
public RosterItem(String name, IRosterItem parent, IRoster roster) {
this.name = name;
this.parent = parent;
this.roster = roster;
}
/**
@ -127,23 +123,6 @@ public class RosterItem implements IRosterItem {
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()

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.IRosterManager;
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.UserId;
@ -56,19 +56,17 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
public class RosterManager implements IRosterManager {
private String owner;
private IRoster roster;
private org.eclipse.ecf.presence.roster.IRoster baseRoster;
private SessionManager sessionManager;
private CollaborationConnection sessionManager;
/**
*
* @param roster
*/
public RosterManager(SessionManager manager) {
public RosterManager(CollaborationConnection manager) {
sessionManager = manager;
updateRoster();
}
@ -243,12 +241,8 @@ public class RosterManager implements IRosterManager {
*
* @return
*/
public SessionManager getSessionManager() {
public CollaborationConnection getSessionManager() {
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.user.IQualifiedID;
import com.raytheon.uf.viz.collaboration.comm.provider.Presence;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
/**
* TODO Add Description
@ -102,13 +101,14 @@ public class AccountManager implements IAccountManager {
private ISubscriptionResponder responder;
private SessionManager sessionManager = null;
private CollaborationConnection sessionManager = null;
/**
*
* @param adapter
*/
AccountManager(IPresenceContainerAdapter adapter, SessionManager manager) {
AccountManager(IPresenceContainerAdapter adapter,
CollaborationConnection manager) {
sessionManager = manager;
presenceAdapter = adapter;
presenceAdapter.getRosterManager().addRosterSubscriptionListener(
@ -246,7 +246,8 @@ public class AccountManager implements IAccountManager {
try {
manager.createAccount(name, new String(password), map);
} catch (ECFException e) {
throw new CollaborationException("Could not create account ");
throw new CollaborationException(
"Could not create account ");
}
}
// all done so clear the password.
@ -297,7 +298,5 @@ public class AccountManager implements IAccountManager {
throw new CollaborationException("Could not send presence");
}
}
}

View file

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

View file

@ -101,6 +101,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 24, 2012 jkorman Initial creation
* Apr 18, 2012 njensen Major cleanup
*
* </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
*/
public class SessionManager implements IEventPublisher {
public class CollaborationConnection implements IEventPublisher {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SessionManager.class);
.getHandler(CollaborationConnection.class);
private static final String PROVIDER = "ecf.xmpp.smack";
@ -154,7 +155,7 @@ public class SessionManager implements IEventPublisher {
* @throws ContainerCreateException
*
*/
public SessionManager(String account, String password)
public CollaborationConnection(String account, String password)
throws CollaborationException {
this(account, password, (IRosterEventSubscriber) null);
}
@ -170,7 +171,7 @@ public class SessionManager implements IEventPublisher {
* @throws ContainerCreateException
*
*/
public SessionManager(String account, String password,
public CollaborationConnection(String account, String password,
IPresence initialPresence) throws Exception {
this(account, password, (IRosterEventSubscriber) null);
if (accountManager != null) {
@ -192,7 +193,7 @@ public class SessionManager implements IEventPublisher {
* A roster event subscriber.
* @throws CollaborationException
*/
public SessionManager(String account, String password,
public CollaborationConnection(String account, String password,
IRosterEventSubscriber rosterEventSubscriber)
throws CollaborationException {
eventBus = new EventBus();
@ -484,9 +485,9 @@ public class SessionManager implements IEventPublisher {
session.joinVenue(venueName);
sessions.put(session.getSessionId(), session);
}
} catch (Exception e) {
throw new CollaborationException(
"Error joining venue " + venueName, e);
}
return session;
}
@ -506,9 +507,9 @@ public class SessionManager implements IEventPublisher {
session.createVenue(venueName, subject);
sessions.put(session.getSessionId(), session);
}
} catch (Exception e) {
throw new CollaborationException("Error creating venue "
+ venueName, e);
}
return session;
}
@ -542,11 +543,7 @@ public class SessionManager implements IEventPublisher {
info.add(vi);
}
}
} else {
// Could not create venueManager
}
} else {
// not currently connected
}
return info;
@ -578,8 +575,6 @@ public class SessionManager implements IEventPublisher {
if (rosterManager != null) {
((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) {
if (isConnected() && (presenceAdapter != null)) {
PeerToPeerCommHelper helper = new PeerToPeerCommHelper(this,
presenceAdapter);
PeerToPeerCommHelper helper = new PeerToPeerCommHelper(this);
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.IPeerToPeer;
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
* ------------ ---------- ----------- --------------------------
* Mar 21, 2012 jkorman Initial creation
* Apr 18, 2012 njensen Cleanup
*
* </pre>
*
@ -66,19 +66,18 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
* @param manager
*/
PeerToPeerChat(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException {
CollaborationConnection manager) throws CollaborationException {
super(container, externalBus, manager);
chatSender = getConnectionPresenceAdapter().getChatManager()
.getChatMessageSender();
}
/**
* @throws CollaborationException
*
*/
@Override
public int sendPeerToPeer(IMessage message) {
// Assume success
int status = Errors.NO_ERROR;
public void sendPeerToPeer(IMessage message) throws CollaborationException {
if (chatSender != null) {
ID toID = createID(message.getTo().getFQName());
String subject = message.getSubject();
@ -95,11 +94,11 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
chatSender.sendChatMessage(toID, null, IChatMessage.Type.CHAT,
subject, body, props);
} catch (ECFException e) {
System.out.println("Error sending message");
e.printStackTrace();
throw new CollaborationException(
"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.
* @param message
* The body of the message to send.
* @throws CollaborationException
*/
@Override
public int sendPeerToPeer(String to, String message) {
// Assume success
int status = Errors.NO_ERROR;
public void sendPeerToPeer(String to, String message)
throws CollaborationException {
ID toID = createID(to);
try {
chatSender.sendChatMessage(toID, message);
} catch (ECFException e) {
System.out.println("Error sending message");
e.printStackTrace();
throw new CollaborationException("Error sending message to peer "
+ 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.IIMMessageListener;
import org.eclipse.ecf.presence.IPresenceContainerAdapter;
import org.eclipse.ecf.presence.im.IChatMessage;
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 {
private SessionManager manager;
private IPresenceContainerAdapter presenceAdapter;
private CollaborationConnection manager;
/**
*
* @param manager
* @param presenceAdapter
*/
PeerToPeerCommHelper(SessionManager manager,
IPresenceContainerAdapter presenceAdapter) {
this.presenceAdapter = presenceAdapter;
PeerToPeerCommHelper(CollaborationConnection 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.ISharedDisplaySession;
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.Tools;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
/**
* TODO Add Description
* A session that shares editors.
*
* <pre>
*
@ -55,12 +55,12 @@ public class SharedDisplaySession extends VenueSession implements
private UserId dataProvider = null;
public SharedDisplaySession(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException {
CollaborationConnection manager) throws CollaborationException {
super(container, externalBus, manager);
}
public SharedDisplaySession(IContainer container, EventBus externalBus,
SessionManager manager, String sessionId)
CollaborationConnection manager, String sessionId)
throws CollaborationException {
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
public boolean hasRole(ParticipantRole role) {
public boolean hasRole(SharedDisplayRole role) {
boolean result = true;
if (role.equals(ParticipantRole.DATA_PROVIDER)
if (role.equals(SharedDisplayRole.DATA_PROVIDER)
&& !this.getUserID().equals(this.getCurrentDataProvider())) {
result = false;
} else if (role.equals(ParticipantRole.SESSION_LEADER)
} else if (role.equals(SharedDisplayRole.SESSION_LEADER)
&& !this.getUserID().equals(this.getCurrentSessionLeader())) {
result = false;
}

View file

@ -84,6 +84,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 24, 2012 jkorman Initial creation
* Apr 17, 2012 njensen Major refactor
*
* </pre>
*
@ -123,7 +124,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
* @param eventBus
*/
protected VenueSession(IContainer container, EventBus externalBus,
SessionManager manager, String sessionId)
CollaborationConnection manager, String sessionId)
throws CollaborationException {
super(container, externalBus, manager, sessionId);
}
@ -134,7 +135,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
* @param eventBus
*/
protected VenueSession(IContainer container, EventBus externalBus,
SessionManager manager) throws CollaborationException {
CollaborationConnection manager) throws CollaborationException {
super(container, externalBus, manager);
}
@ -441,7 +442,6 @@ public class VenueSession extends BaseSession implements IVenueSession {
ID from = message.getFromID();
String name = Tools.parseName(from.getName());
String host = Tools.parseHost(from.getName());
String account = getSessionManager().getAccount();
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
* ------------ ---------- ----------- --------------------------
* Feb 24, 2012 jkorman Initial creation
* Apr 18, 2012 njensen Major refactor
*
* </pre>
*
@ -171,11 +172,19 @@ public class UserId implements IQualifiedID {
return sb.toString();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
@Override
public String toString() {
return this.getFQName();
}
@Override
public int hashCode() {
final int prime = 31;
@ -187,18 +196,13 @@ public class UserId implements IQualifiedID {
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
if (!(obj instanceof UserId))
return false;
UserId other = (UserId) obj;
if (host == null) {
@ -219,17 +223,4 @@ 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();
}
}

View file

@ -25,31 +25,29 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueId;
* TODO Add Description
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 jkorman Initial creation
*
*
* </pre>
*
*
* @author jkorman
* @version 1.0
* @version 1.0
*/
public class VenueId implements IVenueId {
private String host;
private String resource;
private String venueName;
private String name;
private String domain;
/**
* @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;
}
/**
* @see com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueId#getDomain()
*/
@Override
public String getDomain() {
return null;
}
}