use of com.blackducksoftware.integration.hub.service.HubServicesFactory in project hub-docker-inspector by blackducksoftware.
the class HubClient method phoneHomeHubConnection.
private void phoneHomeHubConnection(final String dockerEngineVersion) throws IOException, EncryptionException {
final RestConnection restConnection = createRestConnection();
final HubServicesFactory hubServicesFactory = new HubServicesFactory(restConnection);
final PhoneHomeService phoner = hubServicesFactory.createPhoneHomeService();
final PhoneHomeRequestBodyBuilder phoneHomeRequestBodyBuilder = phoner.createInitialPhoneHomeRequestBodyBuilder(THIRD_PARTY_NAME_DOCKER, dockerEngineVersion, programVersion.getProgramVersion());
phoneHomeRequestBodyBuilder.setBlackDuckName(BlackDuckName.HUB);
if (!StringUtils.isBlank(config.getCallerName())) {
phoneHomeRequestBodyBuilder.addToMetaDataMap(PHONE_HOME_METADATA_NAME_CALLER_NAME, config.getCallerName());
}
if (!StringUtils.isBlank(config.getCallerVersion())) {
phoneHomeRequestBodyBuilder.addToMetaDataMap(PHONE_HOME_METADATA_NAME_CALLER_VERSION, config.getCallerVersion());
}
final PhoneHomeRequestBody phoneHomeRequestBody = phoneHomeRequestBodyBuilder.buildObject();
phoner.phoneHome(phoneHomeRequestBody);
logger.trace("Attempt to phone home completed");
}
Aggregations