if (multiplexerManager.getClientSession(connectionManagerName, streamID) == null) {
// Client or Connection manager requested to close the session
// Do nothing since it has already been removed and closed
}
else {
ConnectionMultiplexerSession multiplexerSession =
multiplexerManager.getMultiplexerSession(connectionManagerName,streamID);
if (multiplexerSession != null) {
// Server requested to close the client session so let the connection manager
// know that he has to finish the client session
IQ closeRequest = new IQ(IQ.Type.set);
closeRequest.setFrom(serverName);
closeRequest.setTo(connectionManagerName);
Element child = closeRequest.setChildElement("session",
"http://jabber.org/protocol/connectionmanager");
child.addAttribute("id", streamID);
child.addElement("close");
multiplexerSession.process(closeRequest);
}
}
}