public Status processNegotiation(Object element) throws Exception {
Status status = Status.INCOMPLETE;
try {
if (element instanceof StartTls) {
StartTls startTls = (StartTls) element;
if (startTls.isMandatory() && !isSecure) {
throw new Exception("The server requires TLS, but you disabled it.");
}
if (isSecure) {
xmppSession.send(new StartTls());
} else {
status = Status.IGNORE;
}
} else if (element instanceof Proceed) {
status = Status.SUCCESS;