String clientId = info.getClientId();
if (clientId == null) {
throw new InvalidClientIDException("No clientID specified for connection disconnect request");
}
synchronized (clientIdSet) {
ConnectionContext oldValue = clientIdSet.get(clientId);
// we may be removing the duplicate connection, not the first
// connection to be created
// so lets check that their connection IDs are the same
if (oldValue == context) {
if (isEqual(oldValue.getConnectionId(), info.getConnectionId())) {
clientIdSet.remove(clientId);
}
}
}
connections.remove(context.getConnection());