Issue #427 more cleanup
Change-Id: Id2ad63a51e9a891801d2422547f855cd769a83d3 Former-commit-id: 258df7c2187c1ebcecf1abf905ec2cc4e60464e0
This commit is contained in:
parent
29f24e3ec5
commit
c33cf2538c
6 changed files with 35 additions and 106 deletions
|
@ -503,8 +503,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
|
||||||
sessionId = session.getSessionId();
|
sessionId = session.getSessionId();
|
||||||
// TODO throw an exception if unable to make connection?
|
// TODO throw an exception if unable to make connection?
|
||||||
if (session.isConnected()) {
|
if (session.isConnected()) {
|
||||||
ISharedDisplaySession displaySession = session
|
ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
|
||||||
.spawnSharedDisplaySession();
|
|
||||||
sessionsMap.put(sessionId, session);
|
sessionsMap.put(sessionId, session);
|
||||||
SharedDisplaySessionMgr.joinSession(displaySession,
|
SharedDisplaySessionMgr.joinSession(displaySession,
|
||||||
ParticipantRole.DATA_PROVIDER);
|
ParticipantRole.DATA_PROVIDER);
|
||||||
|
@ -577,8 +576,7 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
|
||||||
String sessionId = session.getSessionId();
|
String sessionId = session.getSessionId();
|
||||||
sessionsMap.put(sessionId, session);
|
sessionsMap.put(sessionId, session);
|
||||||
if (sharedDisplay) {
|
if (sharedDisplay) {
|
||||||
ISharedDisplaySession displaySession = session
|
ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
|
||||||
.spawnSharedDisplaySession();
|
|
||||||
SharedDisplaySessionMgr.joinSession(displaySession,
|
SharedDisplaySessionMgr.joinSession(displaySession,
|
||||||
ParticipantRole.PARTICIPANT);
|
ParticipantRole.PARTICIPANT);
|
||||||
|
|
||||||
|
@ -785,13 +783,12 @@ public class CollaborationDataManager implements IRosterEventSubscriber {
|
||||||
try {
|
try {
|
||||||
session = getSessionManager().joinCollaborationVenue(venueName);
|
session = getSessionManager().joinCollaborationVenue(venueName);
|
||||||
result = session.getSessionId();
|
result = session.getSessionId();
|
||||||
ISharedDisplaySession displaySession = session
|
ISharedDisplaySession displaySession = (ISharedDisplaySession) session;
|
||||||
.spawnSharedDisplaySession();
|
|
||||||
sessionsMap.put(result, session);
|
sessionsMap.put(result, session);
|
||||||
ParticipantEventController pec = new ParticipantEventController(
|
ParticipantEventController pec = new ParticipantEventController(
|
||||||
displaySession);
|
displaySession);
|
||||||
pec.startup();
|
pec.startup();
|
||||||
// TODO this is broken and should be removed
|
// TODO this method is broken and should be removed
|
||||||
} catch (CollaborationException e) {
|
} catch (CollaborationException e) {
|
||||||
// TODO Auto-generated catch block. Please revise as
|
// TODO Auto-generated catch block. Please revise as
|
||||||
// appropriate.
|
// appropriate.
|
||||||
|
|
|
@ -218,7 +218,7 @@ public class CollaborationSessionView extends SessionView {
|
||||||
String message = getComposedMessage();
|
String message = getComposedMessage();
|
||||||
if (message.length() > 0) {
|
if (message.length() > 0) {
|
||||||
try {
|
try {
|
||||||
((IVenueSession) session).sendTextMessage(message);
|
((IVenueSession) session).sendChatMessage(message);
|
||||||
} catch (CollaborationException e) {
|
} catch (CollaborationException e) {
|
||||||
// TODO Auto-generated catch block. Please revise as
|
// TODO Auto-generated catch block. Please revise as
|
||||||
// appropriate.
|
// appropriate.
|
||||||
|
|
|
@ -415,7 +415,7 @@ public class SessionView extends AbstractSessionView {
|
||||||
String message = getComposedMessage();
|
String message = getComposedMessage();
|
||||||
if (message.length() > 0) {
|
if (message.length() > 0) {
|
||||||
try {
|
try {
|
||||||
session.sendTextMessage(message);
|
session.sendChatMessage(message);
|
||||||
} catch (CollaborationException e) {
|
} catch (CollaborationException e) {
|
||||||
// TODO Auto-generated catch block. Please revise as
|
// TODO Auto-generated catch block. Please revise as
|
||||||
// appropriate.
|
// appropriate.
|
||||||
|
|
|
@ -89,22 +89,35 @@ public interface ISharedDisplaySession extends IEventPublisher {
|
||||||
throws CollaborationException;
|
throws CollaborationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns the current Data Provider for the session
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public IVenueParticipant getCurrentDataProvider();
|
public IVenueParticipant getCurrentDataProvider();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns the current Session Leader for the session
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public IVenueParticipant getCurrentSessionLeader();
|
public IVenueParticipant getCurrentSessionLeader();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the current Data Provider for the session
|
||||||
|
*
|
||||||
|
* @param participant
|
||||||
|
*/
|
||||||
public void setCurrentDataProvider(IVenueParticipant participant);
|
public void setCurrentDataProvider(IVenueParticipant participant);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the current Session Leader for the session
|
||||||
|
*
|
||||||
|
* @param participant
|
||||||
|
*/
|
||||||
public void setCurrentSessionLeader(IVenueParticipant participant);
|
public void setCurrentSessionLeader(IVenueParticipant participant);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Checks if the currently logged in user has the role on this session
|
||||||
*
|
*
|
||||||
* @param role
|
* @param role
|
||||||
* @return
|
* @return
|
||||||
|
|
|
@ -57,28 +57,20 @@ import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||||
|
|
||||||
public interface IVenueSession extends ISession, IEventPublisher {
|
public interface IVenueSession extends ISession, IEventPublisher {
|
||||||
|
|
||||||
/**
|
|
||||||
* Return this session as an ISharedDisplaySession if it is supported. If
|
|
||||||
* the interface is not supported the method must return a null reference.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
ISharedDisplaySession spawnSharedDisplaySession();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns information about a venue.
|
* Returns information about a venue.
|
||||||
*
|
*
|
||||||
* @return Information about a venue
|
* @return Information about a venue
|
||||||
*/
|
*/
|
||||||
IVenue getVenue();
|
public IVenue getVenue();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a Collaboration message.
|
* Send a chat message.
|
||||||
*
|
*
|
||||||
* @param message
|
* @param message
|
||||||
* The message to send.
|
* The message to send.
|
||||||
*/
|
*/
|
||||||
void sendTextMessage(String message) throws CollaborationException;
|
public void sendChatMessage(String message) throws CollaborationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an invitation from this venue to another user.
|
* Send an invitation from this venue to another user.
|
||||||
|
@ -89,11 +81,11 @@ public interface IVenueSession extends ISession, IEventPublisher {
|
||||||
* The intended subject of the venue conversation.
|
* The intended subject of the venue conversation.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int sendInvitation(String id, String body)
|
public void sendInvitation(String id, String body)
|
||||||
throws CollaborationException;
|
throws CollaborationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an invitation from this venue to one or more users.
|
* Send an invitation from this venue to a list of users.
|
||||||
*
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* A list of target users for this invitation.
|
* A list of target users for this invitation.
|
||||||
|
@ -101,7 +93,7 @@ public interface IVenueSession extends ISession, IEventPublisher {
|
||||||
* Any text that the user may wish to include.
|
* Any text that the user may wish to include.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int sendInvitation(List<String> ids, String body)
|
public void sendInvitation(List<String> ids, String body)
|
||||||
throws CollaborationException;
|
throws CollaborationException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.eclipse.ecf.core.user.IUser;
|
||||||
import org.eclipse.ecf.core.util.ECFException;
|
import org.eclipse.ecf.core.util.ECFException;
|
||||||
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.IPresenceSender;
|
|
||||||
import org.eclipse.ecf.presence.chatroom.IChatRoomContainer;
|
import org.eclipse.ecf.presence.chatroom.IChatRoomContainer;
|
||||||
import org.eclipse.ecf.presence.chatroom.IChatRoomInfo;
|
import org.eclipse.ecf.presence.chatroom.IChatRoomInfo;
|
||||||
import org.eclipse.ecf.presence.chatroom.IChatRoomInvitationSender;
|
import org.eclipse.ecf.presence.chatroom.IChatRoomInvitationSender;
|
||||||
|
@ -51,8 +50,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEv
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType;
|
import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterManager;
|
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IChatID;
|
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant;
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.IVenueParticipant;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole;
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.ParticipantRole;
|
||||||
|
@ -155,17 +152,6 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
return userID;
|
return userID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return this session as an ISharedDisplaySession if it is supported. If
|
|
||||||
* the interface is not supported the method must return a null reference.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ISharedDisplaySession spawnSharedDisplaySession() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close this session. Closing clears all listeners and disposes of the
|
* Close this session. Closing clears all listeners and disposes of the
|
||||||
* container. No errors for attempting to close an already closed session.
|
* container. No errors for attempting to close an already closed session.
|
||||||
|
@ -248,16 +234,13 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
* The intended subject of the venue conversation.
|
* The intended subject of the venue conversation.
|
||||||
* @param body
|
* @param body
|
||||||
* Any text that the user may wish to include.
|
* Any text that the user may wish to include.
|
||||||
* @return
|
|
||||||
* @throws CollaborationException
|
* @throws CollaborationException
|
||||||
* @see com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#sendInvitation(java.lang.String,
|
* @see com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#sendInvitation(java.lang.String,
|
||||||
* java.lang.String, java.lang.String, java.lang.String)
|
* java.lang.String, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int sendInvitation(String id, String body)
|
public void sendInvitation(String id, String body)
|
||||||
throws CollaborationException {
|
throws CollaborationException {
|
||||||
// Assume success
|
|
||||||
int status = Errors.NO_ERROR;
|
|
||||||
IChatRoomInvitationSender sender = getConnectionPresenceAdapter()
|
IChatRoomInvitationSender sender = getConnectionPresenceAdapter()
|
||||||
.getChatRoomManager().getInvitationSender();
|
.getChatRoomManager().getInvitationSender();
|
||||||
if (sender != null) {
|
if (sender != null) {
|
||||||
|
@ -277,10 +260,10 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
try {
|
try {
|
||||||
sender.sendInvitation(roomId, userId, subject, msgBody);
|
sender.sendInvitation(roomId, userId, subject, msgBody);
|
||||||
} catch (ECFException e) {
|
} catch (ECFException e) {
|
||||||
|
// TODO fix
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -294,23 +277,17 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
* The intended subject of the venue conversation.
|
* The intended subject of the venue conversation.
|
||||||
* @param body
|
* @param body
|
||||||
* Any text that the user may wish to include.
|
* Any text that the user may wish to include.
|
||||||
* @return
|
|
||||||
* @see com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#sendInvitation(java.lang.String,
|
* @see com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#sendInvitation(java.lang.String,
|
||||||
* java.lang.String, java.lang.String, java.lang.String)
|
* java.lang.String, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int sendInvitation(List<String> ids, String body)
|
public void sendInvitation(List<String> ids, String body)
|
||||||
throws CollaborationException {
|
throws CollaborationException {
|
||||||
// Assume success
|
|
||||||
int status = Errors.NO_ERROR;
|
|
||||||
if (ids != null) {
|
if (ids != null) {
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
sendInvitation(id, body);
|
sendInvitation(id, body);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
status = -1;
|
|
||||||
}
|
}
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -331,7 +308,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
String message = Tools.marshallData(obj);
|
String message = Tools.marshallData(obj);
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
sendTextMessage(message);
|
sendMessageToVenue(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,13 +374,12 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
// ISharedDisplaySession
|
// ISharedDisplaySession
|
||||||
// ***************************
|
// ***************************
|
||||||
|
|
||||||
/**
|
public void sendChatMessage(String message) throws CollaborationException {
|
||||||
* @param message
|
this.sendMessageToVenue(message);
|
||||||
* A message to send.
|
}
|
||||||
* @see com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#sendTextMessage(java.lang.String)
|
|
||||||
*/
|
protected void sendMessageToVenue(String message)
|
||||||
@Override
|
throws CollaborationException {
|
||||||
public void sendTextMessage(String message) throws CollaborationException {
|
|
||||||
// Assume success
|
// Assume success
|
||||||
if ((venueContainer != null) && (message != null)) {
|
if ((venueContainer != null) && (message != null)) {
|
||||||
IChatRoomMessageSender sender = venueContainer
|
IChatRoomMessageSender sender = venueContainer
|
||||||
|
@ -498,58 +474,9 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
errorStatus = Errors.BAD_NAME;
|
errorStatus = Errors.BAD_NAME;
|
||||||
}
|
}
|
||||||
// TODO :
|
|
||||||
// sendSubscription(subject);
|
|
||||||
return errorStatus;
|
return errorStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendSubscription(final String name) {
|
|
||||||
|
|
||||||
Runnable r = new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
System.out.println("Sending subscribe message.");
|
|
||||||
|
|
||||||
boolean remove = "remove".equals(name);
|
|
||||||
|
|
||||||
String[] groups = { "group2", };
|
|
||||||
|
|
||||||
// String [] groups = new String [];
|
|
||||||
|
|
||||||
IRosterManager r = getSessionManager().getRosterManager();
|
|
||||||
if (remove) {
|
|
||||||
IChatID id = new RosterId("pkorman",
|
|
||||||
"awipscm.omaha.us.ray.com", null);
|
|
||||||
r.sendRosterRemove(id);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
r.sendRosterAdd("pkorman@awipscm.omaha.us.ray.com",
|
|
||||||
"Paul", groups);
|
|
||||||
}
|
|
||||||
if ("subscribe".equals(name)) {
|
|
||||||
IPresenceSender sender = getConnectionPresenceAdapter()
|
|
||||||
.getRosterManager().getPresenceSender();
|
|
||||||
org.eclipse.ecf.presence.IPresence presence = new org.eclipse.ecf.presence.Presence(
|
|
||||||
org.eclipse.ecf.presence.IPresence.Type.SUBSCRIBE);
|
|
||||||
|
|
||||||
sender.sendPresenceUpdate(
|
|
||||||
createID("pkorman@awipscm.omaha.us.ray.com"),
|
|
||||||
presence);
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Subscribe message sent.");
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Thread t = new Thread(r);
|
|
||||||
t.start();
|
|
||||||
System.out.println("The subscribe test has started.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
|
|
Loading…
Add table
Reference in a new issue