use of com.blackducksoftware.integration.log.Slf4jIntLogger in project hub-docker-inspector by blackducksoftware.
the class ImageInspectorClient method createConnection.
private RestConnection createConnection(final String baseUrl, final int timeoutSeconds) throws MalformedURLException {
final UnauthenticatedRestConnectionBuilder connectionBuilder = new UnauthenticatedRestConnectionBuilder();
connectionBuilder.setBaseUrl(baseUrl);
connectionBuilder.setTimeout(timeoutSeconds);
final IntLogger intLogger = new Slf4jIntLogger(logger);
connectionBuilder.setLogger(intLogger);
connectionBuilder.setAlwaysTrustServerCertificate(false);
final RestConnection connection = connectionBuilder.build();
return connection;
}
use of com.blackducksoftware.integration.log.Slf4jIntLogger in project hub-detect by blackducksoftware.
the class HubServiceWrapper method init.
public void init() throws IntegrationException, DetectUserFriendlyException {
try {
slf4jIntLogger = new Slf4jIntLogger(logger);
hubServerConfig = createHubServerConfig(slf4jIntLogger);
hubServicesFactory = createHubServicesFactory(slf4jIntLogger, hubServerConfig);
} catch (IllegalStateException | EncryptionException e) {
throw new DetectUserFriendlyException(String.format("Not able to initialize Hub connection: %s", e.getMessage()), e, ExitCodeType.FAILURE_HUB_CONNECTIVITY);
}
final HubService hubService = createHubService();
final CurrentVersionView currentVersion = hubService.getResponse(ApiDiscovery.CURRENT_VERSION_LINK_RESPONSE);
logger.info(String.format("Successfully connected to Hub (version %s)!", currentVersion.version));
detectPhoneHomeManager.init(createPhoneHomeService());
detectPhoneHomeManager.startPhoneHome();
}
Aggregations