case DISCONNECTED:
throw new Exception("received DISCONNECTED");
}
}
else if (e.getMessage() instanceof XMLElement) {
final XMLElement element = (XMLElement) e.getMessage();
switch (status) {
case AUTHENTICATE:
if (!"handshake".equals(element.getTagName()))
throw new Exception("expected handshake");
status = Status.READY;
System.out.println("logged in");
ctx.getPipeline().get(XMPPStreamHandler.class).loggedIn();