use of org.jboss.tools.openshift.core.LazySSLCertificateCallback 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 org.jboss.tools.openshift.core.LazySSLCertificateCallback 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));
}
use of org.jboss.tools.openshift.core.LazySSLCertificateCallback in project jbosstools-openshift by jbosstools.
the class ConnectionFactory method create.
@Override
public Connection create(String url) {
if (StringUtils.isEmpty(url)) {
return null;
}
try {
LazySSLCertificateCallback sslCertCallback = new LazySSLCertificateCallback();
IClient client = new ClientBuilder(url).sslCertificateCallback(sslCertCallback).withMaxRequests(ConnectionProperties.MAX_REQUESTS).withMaxRequestsPerHost(ConnectionProperties.MAX_REQUESTS).build();
return new Connection(client, new LazyCredentialsPrompter());
} catch (OpenShiftException e) {
OpenShiftCoreActivator.pluginLog().logInfo(NLS.bind("Could not create OpenShift connection: Malformed url {0}", url), e);
return null;
}
}
Aggregations