Search in sources :

Example 1 with IServer

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.");
        }
    }
}
Also used : IServer(pl.mn.communicator.IServer) GGException(pl.mn.communicator.GGException) LoginContext(pl.mn.communicator.LoginContext) GGConfiguration(pl.mn.communicator.GGConfiguration) TransportSession(net.sf.kraken.session.TransportSession) Session(pl.mn.communicator.Session) ISession(pl.mn.communicator.ISession)

Aggregations

TransportSession (net.sf.kraken.session.TransportSession)1 GGConfiguration (pl.mn.communicator.GGConfiguration)1 GGException (pl.mn.communicator.GGException)1 IServer (pl.mn.communicator.IServer)1 ISession (pl.mn.communicator.ISession)1 LoginContext (pl.mn.communicator.LoginContext)1 Session (pl.mn.communicator.Session)1