use of org.jboss.tools.jmx.jolokia.JolokiaConnectionWrapper in project jbosstools-openshift by jbosstools.
the class OpenshiftJMXConnectionProvider method createConnection.
@Override
protected IConnectionWrapper createConnection(IServer server) {
IConnection openshiftCon = OpenShiftServerUtils.getConnection(server);
String url = computeJolokiaURL(server);
if (url != null) {
JolokiaConnectionWrapper cw = new JolokiaConnectionWrapper() {
@Override
public IConnectionProvider getProvider() {
return ExtensionManager.getProvider(PROVIDER_ID);
}
};
cw.setId(server.getName());
cw.setUrl(url);
cw.setType("POST");
cw.setIgnoreSSLErrors(true);
Map<String, String> headers = new HashMap<>();
headers.put(AUTHORIZATION_HEADER_KEY, AUTHORIZATION_HEADER_VALUE_PREFIX + ((Connection) openshiftCon).getToken());
cw.setHeaders(headers);
return cw;
} else {
return null;
}
}
Aggregations