con.sendControlMessage(pkt);
if (status != Status.OK) {
IMQService s = (IMQService)con.getService();
Agent agent = Globals.getAgent();
if (agent != null) {
agent.notifyConnectionReject(s.getName(),
username,
con.remoteHostString());
}
con.closeConnection(true,
GoodbyeReason.CON_FATAL_ERROR,
Globals.getBrokerResources().getKString(
BrokerResources.M_AUTH_FAIL_CLOSE));
} else {
Agent agent = Globals.getAgent();
if (agent != null) {
agent.registerConnection(con.getConnectionUID().longValue());
agent.notifyConnectionOpen(con.getConnectionUID().longValue());
}
}
return true;
}