use of com.spotify.docker.client.exceptions.DockerException in project opennms by OpenNMS.
the class SyslogKafkaElasticsearch5OutageIT method getEs5Address.
protected InetSocketAddress getEs5Address() {
try {
// Fetch an up-to-date ContainerInfo for the ELASTICSEARCH_5 container
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(ContainerAlias.ELASTICSEARCH_5).id();
ContainerInfo info = docker.inspectContainer(id);
return testEnvironment.getServiceAddress(info, 9200, "tcp");
} catch (DockerException | InterruptedException e) {
LOG.error("Unexpected exception trying to fetch Elassticsearch port", e);
return null;
}
}
use of com.spotify.docker.client.exceptions.DockerException in project opennms by OpenNMS.
the class SyslogKafkaElasticsearchBufferingIT method stopContainer.
private void stopContainer(ContainerAlias alias) {
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(alias).id();
try {
LOG.info("Stopping container: {} -> {}", alias, id);
docker.stopContainer(id, 60);
LOG.info("Container stopped: {} -> {}", alias, id);
} catch (DockerException | InterruptedException e) {
LOG.warn("Unexpected exception while stopping container {}", id, e);
}
}
use of com.spotify.docker.client.exceptions.DockerException in project opennms by OpenNMS.
the class SyslogKafkaElasticsearchBufferingIT method startContainer.
private void startContainer(ContainerAlias alias) {
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(alias).id();
try {
LOG.info("Starting container: {} -> {}", alias, id);
docker.startContainer(id);
LOG.info("Container started: {} -> {}", alias, id);
} catch (DockerException | InterruptedException e) {
LOG.warn("Unexpected exception while starting container {}", id, e);
}
}
use of com.spotify.docker.client.exceptions.DockerException in project opennms by OpenNMS.
the class SyslogKafkaElasticsearchBufferingIT method getServiceAddress.
protected static InetSocketAddress getServiceAddress(AbstractTestEnvironment env, ContainerAlias alias, int port, String protocol) {
try {
// Fetch an up-to-date ContainerInfo for the ELASTICSEARCH_5 container
final DockerClient docker = env.getDockerClient();
final String id = env.getContainerInfo(alias).id();
ContainerInfo info = docker.inspectContainer(id);
return env.getServiceAddress(info, port, protocol);
} catch (DockerException | InterruptedException e) {
LOG.error("Unexpected exception trying to fetch Elassticsearch port", e);
return null;
}
}
Aggregations