Issue #232 - Corrected problem using participant identifiers
Former-commit-id:b89a89def3
[formerlyb89a89def3
[formerly 5b102692838b42ffab97186742338494df78b978]] Former-commit-id:96cd7bea11
Former-commit-id:46a646f7f7
This commit is contained in:
parent
76adccc98e
commit
0ce49560c3
5 changed files with 46 additions and 11 deletions
|
@ -75,7 +75,7 @@ public class DataProviderEventController extends AbstractRoleEventController {
|
||||||
.getInstance().getActiveEditor();
|
.getInstance().getActiveEditor();
|
||||||
SharedEditor se = EditorSetup.extractSharedEditor(editor);
|
SharedEditor se = EditorSetup.extractSharedEditor(editor);
|
||||||
try {
|
try {
|
||||||
session.sendInitData(event.getParticipant(), se);
|
session.sendInitData(event.getParticipant().getQualifiedId(), se);
|
||||||
} catch (CollaborationException e) {
|
} catch (CollaborationException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error sending initialization data to new participant "
|
"Error sending initialization data to new participant "
|
||||||
|
|
|
@ -73,7 +73,7 @@ public interface ISharedDisplaySession extends IEventPublisher {
|
||||||
* @param participant
|
* @param participant
|
||||||
* @param initData
|
* @param initData
|
||||||
*/
|
*/
|
||||||
void sendInitData(IChatID participant, IInitData initData)
|
void sendInitData(IQualifiedID participant, IInitData initData)
|
||||||
throws CollaborationException;
|
throws CollaborationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,7 +95,7 @@ public interface ISharedDisplaySession extends IEventPublisher {
|
||||||
*/
|
*/
|
||||||
void sendEvent(IDisplayEvent event) throws CollaborationException;
|
void sendEvent(IDisplayEvent event) throws CollaborationException;
|
||||||
|
|
||||||
void sendEvent(IChatID participant, IDisplayEvent event)
|
void sendEvent(IQualifiedID participant, IDisplayEvent event)
|
||||||
throws CollaborationException;
|
throws CollaborationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,5 +39,11 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IPropertied;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface IVenueParticipant extends IChatID, IPropertied {
|
public interface IVenueParticipant extends IChatID, IPropertied {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the identifier as a qualified field. Removes the "domain"
|
||||||
|
* conference from the host string if found.
|
||||||
|
* @return The qualified id.
|
||||||
|
*/
|
||||||
|
IQualifiedID getQualifiedId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -345,16 +345,19 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void sendInitData(
|
public void sendInitData(
|
||||||
com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID participant,
|
com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID participant,
|
||||||
IInitData initData) throws CollaborationException {
|
IInitData initData) throws CollaborationException {
|
||||||
|
|
||||||
PeerToPeerChat session = getP2PSession();
|
PeerToPeerChat session = getP2PSession();
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
String message = Tools.marshallData(initData);
|
String message = Tools.marshallData(initData);
|
||||||
IMessage msg = new CollaborationMessage(participant, message);
|
if (message != null) {
|
||||||
msg.setProperty(Tools.PROP_SESSION_ID, this.getSessionId());
|
|
||||||
session.sendPeerToPeer(msg);
|
TextMessage msg = new TextMessage(participant, message);
|
||||||
|
msg.setProperty(Tools.PROP_SESSION_ID, getSessionId());
|
||||||
|
|
||||||
|
session.sendPeerToPeer(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +406,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void sendEvent(
|
public void sendEvent(
|
||||||
com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID participant,
|
com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID participant,
|
||||||
IDisplayEvent event) throws CollaborationException {
|
IDisplayEvent event) throws CollaborationException {
|
||||||
|
|
||||||
PeerToPeerChat session = null;
|
PeerToPeerChat session = null;
|
||||||
|
@ -411,7 +414,10 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
String message = Tools.marshallData(event);
|
String message = Tools.marshallData(event);
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
session.sendPeerToPeer(participant.getFQName(), message);
|
|
||||||
|
TextMessage msg = new TextMessage(participant, message);
|
||||||
|
msg.setProperty(Tools.PROP_SESSION_ID, getSessionId());
|
||||||
|
session.sendPeerToPeer(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant;
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,6 +45,8 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant;
|
||||||
|
|
||||||
public class VenueParticipant implements IVenueParticipant {
|
public class VenueParticipant implements IVenueParticipant {
|
||||||
|
|
||||||
|
private static String CONF_ID = "conference.";
|
||||||
|
|
||||||
private Map<String, String> properties;
|
private Map<String, String> properties;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -187,4 +190,24 @@ public class VenueParticipant implements IVenueParticipant {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the identifier as a qualified field. Removes the "domain"
|
||||||
|
* conference from the host string if found.
|
||||||
|
* @return The qualified id.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IQualifiedID getQualifiedId() {
|
||||||
|
String hostName = host;
|
||||||
|
if(hostName != null) {
|
||||||
|
if(hostName.startsWith(CONF_ID)) {
|
||||||
|
hostName = hostName.substring(CONF_ID.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UserId id = new UserId(getName(), hostName);
|
||||||
|
id.setResource(resource);
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue