@Override public void destroy(final RuntimeId runtimeId) { final Optional<OpenShiftProvider> _openshiftProvider = runtimeRegistry.getProvider(runtimeId.getProviderId(), OpenShiftProvider.class); if (!_openshiftProvider.isPresent()) { return; } OpenShiftProvider openshiftProvider = _openshiftProvider.get(); try { LOG.info("Destroying runtime: " + runtimeId.getId()); openshift.getOpenShiftClient(openshiftProvider).destroy(runtimeId.getId()); LOG.info("Destroyed runtime: " + runtimeId.getId()); } catch (OpenShiftClientException ex) { throw new RuntimeOperationException("Error Destroying runtime: " + runtimeId.getId(), ex); } runtimeRegistry.deregisterRuntime(runtimeId); } }
@Override public void restart(RuntimeId runtimeId) throws RuntimeOperationException { OpenShiftRuntime runtime = (OpenShiftRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Restarting runtime: " + runtimeId.getId()); openshift.getOpenShiftClient(runtime.getProviderId()).restart(runtime.getId()); refresh(runtimeId); LOG.info("Restarted runtime: " + runtimeId.getId()); } catch (OpenShiftClientException ex) { LOG.error("Error Restarting runtime: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Restarting runtime: " + runtimeId.getId(), ex); } }
@Override public void stop(RuntimeId runtimeId) throws RuntimeOperationException { OpenShiftRuntime runtime = (OpenShiftRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Stopping runtime: " + runtimeId.getId()); openshift.getOpenShiftClient(runtime.getProviderId()).stop(runtime.getId()); refresh(runtimeId); LOG.info("Stopped runtime: " + runtimeId.getId()); } catch (OpenShiftClientException ex) { LOG.error("Error Stopping runtime: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Stopping runtime: " + runtimeId.getId(), ex); } }
@Override public void start(RuntimeId runtimeId) throws RuntimeOperationException { OpenShiftRuntime runtime = (OpenShiftRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Starting runtime: " + runtimeId.getId()); openshift.getOpenShiftClient(runtime.getProviderId()).start(runtime.getId()); refresh(runtimeId); LOG.info("Started runtime: " + runtimeId.getId()); } catch (OpenShiftClientException ex) { LOG.error("Error Starting runtime: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Starting runtime: " + runtimeId.getId(), ex); } }
@Override public void pause(RuntimeId runtimeId) throws RuntimeOperationException { OpenShiftRuntime runtime = (OpenShiftRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Pausing runtime: " + runtimeId.getId()); openshift.getOpenShiftClient(runtime.getProviderId()).pause(runtime.getId()); refresh(runtimeId); LOG.info("Paused runtime: " + runtimeId.getId()); } catch (OpenShiftClientException ex) { LOG.error("Error Pausing runtime: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Pausing runtime: " + runtimeId.getId(), ex); } }
@Override public void start(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Starting container: " + runtimeId.getId()); docker.getDockerClient(runtime.getProviderId()).startContainer(runtime.getId()); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Starting container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Starting container: " + runtimeId.getId(), ex); } }
@Override public void start(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Starting container: " + runtimeId.getId()); docker.getDockerClient(runtime.getProviderId()).startContainer(runtime.getId()); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Starting container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Starting container: " + runtimeId.getId(), ex); } }
@Override public void stop(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Stopping container: " + runtimeId.getId()); docker.getDockerClient(runtime.getProviderId()).stopContainer(runtime.getId(), 1); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Stopping container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Stopping container: " + runtimeId.getId(), ex); } }
@Override public void stop(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { LOG.info("Stopping container: " + runtimeId.getId()); docker.getDockerClient(runtime.getProviderId()).stopContainer(runtime.getId(), 1); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Stopping container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Stopping container: " + runtimeId.getId(), ex); } }
@Override public void restart(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { docker.getDockerClient(runtime.getProviderId()).restartContainer(runtime.getId()); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Restarting container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Restarting container: " + runtimeId.getId(), ex); } }
@Override public void restart(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { docker.getDockerClient(runtime.getProviderId()).restartContainer(runtime.getId()); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Restarting container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Restarting container: " + runtimeId.getId(), ex); } }
@Override public void pause(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { docker.getDockerClient(runtime.getProviderId()).pauseContainer(runtime.getId()); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Pausing container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Pausing container: " + runtimeId.getId(), ex); } } }
@Override public void pause(RuntimeId runtimeId) throws RuntimeOperationException { DockerRuntime runtime = (DockerRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { docker.getDockerClient(runtime.getProviderId()).pauseContainer(runtime.getId()); refresh(runtimeId); } catch (DockerException | InterruptedException ex) { LOG.error("Error Pausing container: " + runtimeId.getId(), ex); throw new RuntimeOperationException("Error Pausing container: " + runtimeId.getId(), ex); } } }
@Override public void restart(RuntimeId runtimeId) { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { wildfly.getWildflyClient(runtime.getProviderId()).restart(runtime.getId()); refresh(runtimeId); } catch (WildflyClientException ex) { throw new RuntimeOperationException("Error Restarting container: " + runtimeId.getId() + "\n\t There as a problem with restarting your application, please check into the Wildfly Logs for more information.", ex); } }
@Override public void start(RuntimeId runtimeId) throws RuntimeOperationException { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); int result = wildfly.getWildflyClient(runtime.getProviderId()).start(runtime.getId()); if (result != 200) { throw new RuntimeOperationException("Error Starting container: " + runtimeId.getId() + " \n\t There as a problem with starting your application, please check into the Wildfly Logs for more information."); } refresh(runtimeId); }
@Override public void stop(RuntimeId runtimeId) throws RuntimeOperationException { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { wildfly.getWildflyClient(runtime.getProviderId()).stop(runtime.getId()); refresh(runtimeId); } catch (WildflyClientException ex) { throw new RuntimeOperationException("Error Stopping container: " + runtimeId.getId() + "\n\t There as a problem with stopping your application, please check into the Wildfly Logs for more information.", ex); } }
@Override public void stop(RuntimeId runtimeId) throws RuntimeOperationException { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { wildfly.getWildflyClient(runtime.getProviderId()).stop(runtime.getId()); refresh(runtimeId); } catch (WildflyClientException ex) { throw new RuntimeOperationException("Error Stopping container: " + runtimeId.getId() + "\n\t There as a problem with stopping your application, please check into the Wildfly Logs for more information.", ex); } }
@Override public void restart(RuntimeId runtimeId) { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { wildfly.getWildflyClient(runtime.getProviderId()).restart(runtime.getId()); refresh(runtimeId); } catch (WildflyClientException ex) { throw new RuntimeOperationException("Error Restarting container: " + runtimeId.getId() + "\n\t There as a problem with restarting your application, please check into the Wildfly Logs for more information.", ex); } }
@Override public void start(RuntimeId runtimeId) throws RuntimeOperationException { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); int result = wildfly.getWildflyClient(runtime.getProviderId()).start(runtime.getId()); if (result != 200) { throw new RuntimeOperationException("Error Starting container: " + runtimeId.getId() + " \n\t There as a problem with starting your application, please check into the Wildfly Logs for more information."); } refresh(runtimeId); }
@Override public void pause(RuntimeId runtimeId) throws RuntimeOperationException { WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId()); try { wildfly.getWildflyClient(runtime.getProviderId()).stop(runtime.getId()); refresh(runtimeId); } catch (WildflyClientException ex) { throw new RuntimeOperationException("Error Pausing container: " + runtimeId.getId() + "\n\t There as a problem with stopping your application, please check into the Wildfly Logs for more information.", ex); } } }