Search in sources :

Example 1 with DockerOpenConnectionException

use of org.eclipse.linuxtools.docker.core.DockerOpenConnectionException in project linuxtools by eclipse.

the class DockerConnection method open.

@Override
public void open(boolean registerContainerRefreshManager) throws DockerException {
    // to the same Docker daemon
    synchronized (this) {
        if (this.client == null) {
            try {
                setClient(dockerClientFactory.getClient(this.connectionSettings));
                if (registerContainerRefreshManager) {
                    // Add the container refresh manager to watch the
                    // containers
                    // list
                    DockerContainerRefreshManager dcrm = DockerContainerRefreshManager.getInstance();
                    addContainerListener(dcrm);
                }
            } catch (DockerCertificateException e) {
                setState(EnumDockerConnectionState.CLOSED);
                throw new DockerOpenConnectionException(NLS.bind(Messages.Open_Connection_Failure, this.name, this.getUri()), e);
            }
        }
        // then try to ping the Docker daemon to verify the connection
        ping();
    }
}
Also used : DockerCertificateException(com.spotify.docker.client.exceptions.DockerCertificateException) DockerOpenConnectionException(org.eclipse.linuxtools.docker.core.DockerOpenConnectionException)

Aggregations

DockerCertificateException (com.spotify.docker.client.exceptions.DockerCertificateException)1 DockerOpenConnectionException (org.eclipse.linuxtools.docker.core.DockerOpenConnectionException)1