Issue #440 username/password logging fixes, synchronize all times collaboratorShapes are manipulated
Former-commit-id:f1ea85ea44
[formerlyf1ea85ea44
[formerly 9255532085a1d43955345092d567e04222bbb06d]] Former-commit-id:096b526e7a
Former-commit-id:9c36b710dc
This commit is contained in:
parent
660334e023
commit
8022bb6e79
5 changed files with 124 additions and 37 deletions
|
@ -23,17 +23,17 @@ package com.raytheon.uf.viz.collaboration.comm.identity;
|
|||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 8, 2012 jkorman Initial creation
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class CollaborationException extends Exception {
|
||||
|
@ -44,16 +44,16 @@ public class CollaborationException extends Exception {
|
|||
*
|
||||
*/
|
||||
public CollaborationException() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param message
|
||||
*/
|
||||
public CollaborationException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
|
@ -62,12 +62,12 @@ public class CollaborationException extends Exception {
|
|||
public CollaborationException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param cause
|
||||
*/
|
||||
public CollaborationException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.comm.identity;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 15, 2012 mnash Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class UsernamePasswordException extends CollaborationException {
|
||||
|
||||
private static final long serialVersionUID = 3124620509180835631L;
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* @param cause
|
||||
*/
|
||||
public UsernamePasswordException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -28,8 +28,6 @@ import org.eclipse.ecf.core.ContainerConnectException;
|
|||
import org.eclipse.ecf.core.ContainerCreateException;
|
||||
import org.eclipse.ecf.core.ContainerFactory;
|
||||
import org.eclipse.ecf.core.IContainer;
|
||||
import org.eclipse.ecf.core.IContainerListener;
|
||||
import org.eclipse.ecf.core.events.IContainerEvent;
|
||||
import org.eclipse.ecf.core.identity.ID;
|
||||
import org.eclipse.ecf.core.identity.IDCreateException;
|
||||
import org.eclipse.ecf.core.identity.IDFactory;
|
||||
|
@ -58,6 +56,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IAccountManager;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
|
||||
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.UsernamePasswordException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IEventPublisher;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueInvitationEvent;
|
||||
|
@ -167,16 +166,6 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
container = ContainerFactory.getDefault().createContainer(PROVIDER);
|
||||
|
||||
if (container != null) {
|
||||
container.addListener(new IContainerListener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(IContainerEvent event) {
|
||||
// TODO?
|
||||
System.out.println("ContainerEvent.Type = "
|
||||
+ event.getClass().getName());
|
||||
}
|
||||
});
|
||||
|
||||
// add the listeners before we connect so we don't potentially
|
||||
// miss something
|
||||
presenceAdapter = Tools.getPresenceContainerAdapter(container,
|
||||
|
@ -195,7 +184,7 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
connectToContainer();
|
||||
} catch (ContainerConnectException e) {
|
||||
closeInternals();
|
||||
throw new CollaborationException(
|
||||
throw new UsernamePasswordException(
|
||||
"Login failed. Invalid username or password", e);
|
||||
}
|
||||
ID id = container.getConnectedID();
|
||||
|
@ -204,6 +193,7 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
String host = Tools.parseHost(id.getName());
|
||||
String resource = Tools.parseResource(id.getName());
|
||||
user = new UserId(name, host, resource);
|
||||
user.setId(id);
|
||||
}
|
||||
|
||||
setupAccountManager();
|
||||
|
@ -513,10 +503,13 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
|
||||
UserId id = IDConverter.convertFrom(fromId);
|
||||
if (rosterManager != null) {
|
||||
IRosterEntry entry = contactsMgr.getUsersMap().get(
|
||||
id);
|
||||
((RosterEntry) entry).setPresence(presence);
|
||||
eventBus.post(entry);
|
||||
if (contactsMgr != null
|
||||
&& contactsMgr.getUsersMap() != null) {
|
||||
IRosterEntry entry = contactsMgr.getUsersMap()
|
||||
.get(id);
|
||||
((RosterEntry) entry).setPresence(presence);
|
||||
eventBus.post(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -49,6 +49,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.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.UsernamePasswordException;
|
||||
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.Activator;
|
||||
|
@ -373,9 +374,25 @@ public class LoginDialog extends CaveSWTDialog {
|
|||
};
|
||||
});
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to create connection",
|
||||
e);
|
||||
if (e instanceof UsernamePasswordException) {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
public void run() {
|
||||
MessageBox messageBox = new MessageBox(
|
||||
getShell(),
|
||||
SWT.ERROR);
|
||||
messageBox
|
||||
.setText("Login Error");
|
||||
messageBox
|
||||
.setMessage("Wrong username/password entered");
|
||||
messageBox.open();
|
||||
};
|
||||
});
|
||||
} else {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"Unable to create connection",
|
||||
e);
|
||||
}
|
||||
}
|
||||
return Status.OK_STATUS;
|
||||
};
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Collection;
|
|||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
|
@ -220,8 +221,12 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
while (itr.hasNext()) {
|
||||
lastElement = itr.next();
|
||||
}
|
||||
deletedCollaboratorShapes.put(userName, lastElement);
|
||||
collaboratorShapes.get(userName).remove(lastElement);
|
||||
synchronized (deletedCollaboratorShapes) {
|
||||
deletedCollaboratorShapes.put(userName, lastElement);
|
||||
}
|
||||
synchronized (collaboratorShapes) {
|
||||
collaboratorShapes.get(userName).remove(lastElement);
|
||||
}
|
||||
break;
|
||||
case REDO:
|
||||
userName = event.getUserName();
|
||||
|
@ -234,8 +239,12 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
while (itr.hasNext()) {
|
||||
lastElement = itr.next();
|
||||
}
|
||||
collaboratorShapes.put(userName, lastElement);
|
||||
deletedCollaboratorShapes.get(userName).remove(lastElement);
|
||||
synchronized (collaboratorShapes) {
|
||||
collaboratorShapes.put(userName, lastElement);
|
||||
}
|
||||
synchronized (deletedCollaboratorShapes) {
|
||||
deletedCollaboratorShapes.get(userName).remove(lastElement);
|
||||
}
|
||||
break;
|
||||
case CLEAR:
|
||||
resetTemp();
|
||||
|
@ -300,8 +309,9 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
containers.put(userName, cont);
|
||||
}
|
||||
}
|
||||
collaboratorShapes.clear();
|
||||
collaboratorShapes.putAll(containers);
|
||||
}
|
||||
collaboratorShapes = containers;
|
||||
break;
|
||||
}
|
||||
issueRefresh();
|
||||
|
@ -320,7 +330,9 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
for (ShapeContainer shape : map.get(cont)) {
|
||||
shape.getShape().dispose();
|
||||
}
|
||||
collaboratorShapes.removeAll(cont);
|
||||
synchronized (collaboratorShapes) {
|
||||
collaboratorShapes.removeAll(cont);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,7 +340,9 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
// for (ShapeContainer cont : collaboratorShapes.get(userName)) {
|
||||
// cont.getShape().dispose();
|
||||
// }
|
||||
collaboratorShapes.removeAll(userName);
|
||||
synchronized (collaboratorShapes) {
|
||||
collaboratorShapes.removeAll(userName);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -529,4 +543,16 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
// deletedCollaboratorShapes.clear();
|
||||
// }
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.drawing.DrawingLayer#project(org.opengis.referencing
|
||||
* .crs.CoordinateReferenceSystem)
|
||||
*/
|
||||
@Override
|
||||
public void project(CoordinateReferenceSystem crs) throws VizException {
|
||||
super.project(crs);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue