Merge "Issue #2903 added connection tests to session close methods" into development

Former-commit-id: 81b95799744bd155cc0df1147bb8a5372ea2fee4
This commit is contained in:
Nate Jensen 2014-04-22 12:53:08 -05:00 committed by Gerrit Code Review
commit 4a04662972
2 changed files with 22 additions and 14 deletions

View file

@ -98,6 +98,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Mar 31, 2014 2899 mpduff Improve error messages.
* Apr 15, 2014 2822 bclement added check for other participants being subscribed to topic
* Apr 21, 2014 2822 bclement removed use of resources in topicSubscribers, added skipCache
* Apr 22, 2014 2903 bclement added connection test to closePubSub() method
*
* </pre>
*
@ -511,21 +512,24 @@ public class SharedDisplaySession extends VenueSession implements
closePubSub();
}
/**
* clean up pub sub subscription and objects
*/
private void closePubSub() {
try {
if (pubsubMgr == null || topic == null || !topicExists()) {
return;
}
Subscription sub = findSubscription(getAccount());
if (sub == null) {
return;
}
topic.unsubscribe(sub.getJid(), sub.getId());
topic.removeItemDeleteListener(this);
topic.removeItemEventListener(this);
if (hasRole(SharedDisplayRole.SESSION_LEADER)) {
cleanUpHttpStorage(topic.getId());
pubsubMgr.deleteNode(topic.getId());
if (conn != null && conn.isConnected() && pubsubMgr != null
&& topic != null && topicExists()) {
Subscription sub = findSubscription(getAccount());
if (sub == null) {
return;
}
topic.unsubscribe(sub.getJid(), sub.getId());
topic.removeItemDeleteListener(this);
topic.removeItemEventListener(this);
if (hasRole(SharedDisplayRole.SESSION_LEADER)) {
cleanUpHttpStorage(topic.getId());
pubsubMgr.deleteNode(topic.getId());
}
}
topic = null;
pubsubMgr = null;

View file

@ -109,6 +109,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Apr 11, 2014 2903 bclement made constructor public b/c connection code moved packages
* Apr 16, 2014 3020 bclement added check for invited rooms in roomExistsOnServer()
* Apr 21, 2014 2822 bclement added hasMultipleHandles()
* Apr 22, 2014 2903 bclement added connection test to close method
*
*
* </pre>
@ -192,7 +193,10 @@ public class VenueSession extends BaseSession implements IVenueSession {
muc.removeParticipantListener(participantListener);
participantListener = null;
}
muc.leave();
CollaborationConnection conn = getConnection();
if (conn != null && conn.isConnected()) {
muc.leave();
}
muc = null;
}