Search in sources :

Example 1 with ISynchAsynchConnection

use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.

the class RssClientSOContainer method receiveFeed.

public RssFeed receiveFeed(String feedPath) throws IOException {
    RssFeed feed = null;
    final ISynchAsynchConnection connection = getConnection();
    synchronized (connection) {
        if (connection.isConnected()) {
            try {
                feed = FeedParser.parse((byte[]) connection.sendSynch(null, feedPath.getBytes()));
            } catch (final ParseException e) {
                throw new IOException(e.getMessage());
            }
        }
    }
    return feed;
}
Also used : RssFeed(org.eclipse.higgins.rsse.RssFeed) ISynchAsynchConnection(org.eclipse.ecf.provider.comm.ISynchAsynchConnection) ParseException(org.eclipse.higgins.rsse.parser.ParseException) IOException(java.io.IOException)

Example 2 with ISynchAsynchConnection

use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.

the class RssClientSOContainer method createConnection.

protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
    trace("createConnection:" + remoteSpace + ":" + data);
    // Object[] args = { new Integer(keepAlive) };
    final ISynchAsynchConnection conn = new HttpClient(receiver);
    return conn;
}
Also used : HttpClient(org.eclipse.ecf.internal.provider.rss.http.HttpClient) ISynchAsynchConnection(org.eclipse.ecf.provider.comm.ISynchAsynchConnection)

Example 3 with ISynchAsynchConnection

use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.

the class SSLClientSOContainer method createConnection.

/**
 * @param remoteSpace remote space
 * @param data data
 * @return ISynchAsynchConnection a non-<code>null</code> instance.
 * @throws ConnectionCreateException not thrown by this implementation.
 */
protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
    // $NON-NLS-1$ //$NON-NLS-2$
    debug("createClientConnection:" + remoteSpace + ":" + data);
    ISynchAsynchConnection conn = new SSLClient(receiver, keepAlive);
    return conn;
}
Also used : SSLClient(org.eclipse.ecf.provider.comm.tcp.SSLClient) ISynchAsynchConnection(org.eclipse.ecf.provider.comm.ISynchAsynchConnection)

Example 4 with ISynchAsynchConnection

use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.

the class TCPClientSOContainer method createConnection.

/**
 * @param remoteSpace remote space
 * @param data and data
 * @return ISynchAsynchConnection a non-<code>null</code> instance.
 * @throws ConnectionCreateException not thrown by this implementation.
 */
protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
    // $NON-NLS-1$ //$NON-NLS-2$
    debug("createClientConnection:" + remoteSpace + ":" + data);
    ISynchAsynchConnection conn = new Client(receiver, keepAlive);
    return conn;
}
Also used : ISynchAsynchConnection(org.eclipse.ecf.provider.comm.ISynchAsynchConnection) Client(org.eclipse.ecf.provider.comm.tcp.Client)

Example 5 with ISynchAsynchConnection

use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.

the class XMPPContainer method disconnect.

/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ecf.provider.generic.ClientSOContainer#disconnect()
	 */
public void disconnect() {
    final ID groupID = getConnectedID();
    fireContainerEvent(new ContainerDisconnectingEvent(this.getID(), groupID));
    synchronized (getConnectLock()) {
        // If we are currently connected
        if (isConnected()) {
            XmppPlugin.getDefault().unregisterService(this);
            final ISynchAsynchConnection conn = getConnection();
            synchronized (conn) {
                synchronized (getGroupMembershipLock()) {
                    handleLeave(groupID, conn);
                }
            }
        }
        this.connection = null;
        remoteServerID = null;
        accountManager.setConnection(null);
        chatRoomManager.setConnection(null, null, null);
        outgoingFileTransferContainerAdapter.setConnection(null);
        presenceHelper.disconnect();
        getSharedObjectManager().removeSharedObject(presenceHelperID);
    }
    // notify listeners
    fireContainerEvent(new ContainerDisconnectedEvent(this.getID(), groupID));
}
Also used : ISynchAsynchConnection(org.eclipse.ecf.provider.comm.ISynchAsynchConnection) XMPPID(org.eclipse.ecf.provider.xmpp.identity.XMPPID) ID(org.eclipse.ecf.core.identity.ID) ContainerDisconnectingEvent(org.eclipse.ecf.core.events.ContainerDisconnectingEvent) ContainerDisconnectedEvent(org.eclipse.ecf.core.events.ContainerDisconnectedEvent)

Aggregations

ISynchAsynchConnection (org.eclipse.ecf.provider.comm.ISynchAsynchConnection)5 IOException (java.io.IOException)1 ContainerDisconnectedEvent (org.eclipse.ecf.core.events.ContainerDisconnectedEvent)1 ContainerDisconnectingEvent (org.eclipse.ecf.core.events.ContainerDisconnectingEvent)1 ID (org.eclipse.ecf.core.identity.ID)1 HttpClient (org.eclipse.ecf.internal.provider.rss.http.HttpClient)1 Client (org.eclipse.ecf.provider.comm.tcp.Client)1 SSLClient (org.eclipse.ecf.provider.comm.tcp.SSLClient)1 XMPPID (org.eclipse.ecf.provider.xmpp.identity.XMPPID)1 RssFeed (org.eclipse.higgins.rsse.RssFeed)1 ParseException (org.eclipse.higgins.rsse.parser.ParseException)1