Search in sources :

Example 1 with ECFConnection

use of org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection in project ecf by eclipse.

the class XMPPChatRoomManager method setConnection.

public void setConnection(Namespace connectNamespace, ID connectedID, ECFConnection connection) {
    this.connectNamespace = connectNamespace;
    this.connectedID = connectedID;
    this.ecfConnection = connection;
    if (connection != null) {
        // Setup invitation requestListener
        MultiUserChat.addInvitationListener(ecfConnection.getXMPPConnection(), new InvitationListener() {

            public void invitationReceived(Connection arg0, String arg1, String arg2, String arg3, String arg4, Message arg5) {
                fireInvitationReceived(createRoomIDFromName(arg1), createUserIDFromName(arg2), createUserIDFromName(arg5.getTo()), arg5.getSubject(), arg3);
            }
        });
    } else {
        disposeChatRooms();
    }
}
Also used : InvitationListener(org.jivesoftware.smackx.muc.InvitationListener) IChatRoomInvitationListener(org.eclipse.ecf.presence.chatroom.IChatRoomInvitationListener) Message(org.jivesoftware.smack.packet.Message) Connection(org.jivesoftware.smack.Connection) XMPPConnection(org.jivesoftware.smack.XMPPConnection) ECFConnection(org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection)

Example 2 with ECFConnection

use of org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection in project ecf by eclipse.

the class XMPPContainer method handleConnectResponse.

protected ID handleConnectResponse(ID originalTarget, Object serverData) throws Exception {
    if (originalTarget != null && !originalTarget.equals(getID())) {
        // First reset target resource to whatever the server says it is
        resetTargetResource(originalTarget, serverData);
        addNewRemoteMember(originalTarget, null);
        final ECFConnection conn = getECFConnection();
        accountManager.setConnection(conn.getXMPPConnection());
        chatRoomManager.setConnection(getConnectNamespace(), originalTarget, conn);
        searchManager.setConnection(getConnectNamespace(), originalTarget, conn);
        searchManager.setEnabled(!isGoogle(originalTarget));
        presenceHelper.setUser(new User(originalTarget));
        outgoingFileTransferContainerAdapter.setConnection(conn.getXMPPConnection());
        return originalTarget;
    } else
        throw new ConnectException(Messages.XMPPContainer_EXCEPTION_INVALID_RESPONSE_FROM_SERVER);
}
Also used : User(org.eclipse.ecf.core.user.User) MUCUser(org.jivesoftware.smackx.packet.MUCUser) ECFConnection(org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection) ConnectException(java.net.ConnectException) ContainerConnectException(org.eclipse.ecf.core.ContainerConnectException)

Example 3 with ECFConnection

use of org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection in project ecf by eclipse.

the class XMPPSContainer method createConnection.

protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
    boolean google = isGoogle(remoteSpace);
    CallbackHandler ch = data instanceof IConnectContext ? ((IConnectContext) data).getCallbackHandler() : null;
    return new ECFConnection(google, getConnectNamespace(), receiver, ch);
}
Also used : IConnectContext(org.eclipse.ecf.core.security.IConnectContext) CallbackHandler(org.eclipse.ecf.core.security.CallbackHandler) ECFConnection(org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection)

Aggregations

ECFConnection (org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection)3 ConnectException (java.net.ConnectException)1 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)1 CallbackHandler (org.eclipse.ecf.core.security.CallbackHandler)1 IConnectContext (org.eclipse.ecf.core.security.IConnectContext)1 User (org.eclipse.ecf.core.user.User)1 IChatRoomInvitationListener (org.eclipse.ecf.presence.chatroom.IChatRoomInvitationListener)1 Connection (org.jivesoftware.smack.Connection)1 XMPPConnection (org.jivesoftware.smack.XMPPConnection)1 Message (org.jivesoftware.smack.packet.Message)1 InvitationListener (org.jivesoftware.smackx.muc.InvitationListener)1 MUCUser (org.jivesoftware.smackx.packet.MUCUser)1