use of com.openshift.restclient.ISSLCertificateCallback in project jbosstools-openshift by jbosstools.
the class VagrantPoller method checkOpenShiftHealth.
protected boolean checkOpenShiftHealth(String url, int timeout) throws OpenShiftNotReadyPollingException {
ISSLCertificateCallback sslCallback = new LazySSLCertificateCallback();
IClient client = new ClientBuilder(url).sslCertificateCallback(sslCallback).withConnectTimeout(timeout, TimeUnit.MILLISECONDS).build();
Exception e = null;
try {
if ("ok".equals(client.getServerReadyStatus()))
return true;
} catch (OpenShiftException ex) {
e = ex;
}
String msg = NLS.bind("The CDK VM is up and running, but OpenShift is unreachable at url {0}. " + "The VM may not have been registered successfully. Please check your console output for more information", url);
throw new OpenShiftNotReadyPollingException(CDKCoreActivator.statusFactory().errorStatus(CDKCoreActivator.PLUGIN_ID, msg, e, OpenShiftNotReadyPollingException.OPENSHIFT_UNREACHABLE_CODE));
}
use of com.openshift.restclient.ISSLCertificateCallback in project jbosstools-openshift by jbosstools.
the class MinishiftPoller method checkOpenShiftHealth.
protected boolean checkOpenShiftHealth(String url, int timeout) throws OpenShiftNotReadyPollingException {
ISSLCertificateCallback sslCallback = new LazySSLCertificateCallback();
IClient client = new ClientBuilder(url).sslCertificateCallback(sslCallback).withConnectTimeout(timeout, TimeUnit.MILLISECONDS).build();
Exception e = null;
try {
String v = client.getServerReadyStatus();
if ("ok".equals(v))
return true;
} catch (OpenShiftException ex) {
e = ex;
}
String msg = NLS.bind("The CDK VM is up and running, but OpenShift is unreachable at url {0}. " + "The VM may not have been registered successfully. Please check your console output for more information", url);
throw new OpenShiftNotReadyPollingException(CDKCoreActivator.statusFactory().errorStatus(CDKCoreActivator.PLUGIN_ID, msg, e, OpenShiftNotReadyPollingException.OPENSHIFT_UNREACHABLE_CODE));
}
Aggregations