Search in sources :

Example 1 with PhoneHomeService

use of com.blackducksoftware.integration.hub.service.PhoneHomeService in project hub-alert by blackducksoftware.

the class DailyItemReader method phoneHome.

private PhoneHomeResponse phoneHome() {
    final String productVersion = globalProperties.getProductVersion();
    if (!GlobalProperties.PRODUCT_VERSION_UNKNOWN.equals(productVersion)) {
        final HubServicesFactory hubServicesFactory = globalProperties.createHubServicesFactoryAndLogErrors(logger);
        final PhoneHomeService phoneHomeService = hubServicesFactory.createPhoneHomeService();
        final PhoneHomeRequestBodyBuilder phoneHomeRequestBodyBuilder = phoneHomeService.createInitialPhoneHomeRequestBodyBuilder(ThirdPartyName.ALERT, productVersion, productVersion);
        final PhoneHomeRequestBody phoneHomeRequestBody = phoneHomeRequestBodyBuilder.build();
        return phoneHomeService.startPhoneHome(phoneHomeRequestBody);
    } else {
        return null;
    }
}
Also used : PhoneHomeRequestBody(com.blackducksoftware.integration.phonehome.PhoneHomeRequestBody) PhoneHomeRequestBodyBuilder(com.blackducksoftware.integration.phonehome.PhoneHomeRequestBodyBuilder) HubServicesFactory(com.blackducksoftware.integration.hub.service.HubServicesFactory) PhoneHomeService(com.blackducksoftware.integration.hub.service.PhoneHomeService)

Aggregations

HubServicesFactory (com.blackducksoftware.integration.hub.service.HubServicesFactory)1 PhoneHomeService (com.blackducksoftware.integration.hub.service.PhoneHomeService)1 PhoneHomeRequestBody (com.blackducksoftware.integration.phonehome.PhoneHomeRequestBody)1 PhoneHomeRequestBodyBuilder (com.blackducksoftware.integration.phonehome.PhoneHomeRequestBodyBuilder)1