use of pl.mn.communicator.IServer in project Openfire by igniterealtime.
the class GaduGaduSession method logIn.
/**
* @see net.sf.kraken.session.TransportSession#logIn(net.sf.kraken.type.PresenceType, String)
*/
@Override
public void logIn(PresenceType presenceType, String verboseStatus) {
setPendingPresenceAndStatus(presenceType, verboseStatus);
if (!isLoggedIn()) {
loginContext = new LoginContext(idNumber, registration.getPassword());
listener = new GaduGaduListener(this);
iSession = new Session(new GGConfiguration());
iSession.getConnectionService().addConnectionListener(listener);
iSession.getLoginService().addLoginListener(listener);
iSession.getMessageService().addMessageListener(listener);
iSession.getContactListService().addContactListListener(listener);
iSession.getPresenceService().addUserListener(listener);
try {
IServer iServer = iSession.getConnectionService().lookupServer(idNumber);
iSession.getConnectionService().connect(iServer);
} catch (GGException e) {
Log.debug("GaduGadu: Unable to establish connection:", e);
setFailureStatus(ConnectionFailureReason.CAN_NOT_CONNECT);
sessionDisconnected("Unable to establish connection.");
}
}
}
Aggregations