Search in sources :

Example 6 with IntegrationException

use of com.synopsys.integration.exception.IntegrationException in project hub-alert by blackducksoftware.

the class JobConfigActions method testWithoutChecks.

@Override
protected ValidationActionResponse testWithoutChecks(JobFieldModel resource) {
    ValidationResponseModel responseModel;
    String jobIdString = resource.getJobId();
    UUID jobId = Optional.ofNullable(jobIdString).filter(StringUtils::isNotBlank).map(UUID::fromString).orElse(null);
    try {
        Collection<FieldModel> otherJobModels = new LinkedList<>();
        FieldModel channelFieldModel = getChannelFieldModelAndPopulateOtherJobModels(resource, otherJobModels);
        if (null != channelFieldModel) {
            String channelDescriptorName = channelFieldModel.getDescriptorName();
            Map<String, ConfigurationFieldModel> fields = createFieldsMap(channelFieldModel, otherJobModels);
            // The custom message fields are not written to the database or defined fields in the database.  Need to manually add them.
            // TODO Create a mechanism to create the field accessor with a combination of fields in the database and fields that are not.
            Optional<ConfigurationFieldModel> topicField = convertFieldToConfigurationField(channelFieldModel, FieldModelTestAction.KEY_CUSTOM_TOPIC);
            Optional<ConfigurationFieldModel> messageField = convertFieldToConfigurationField(channelFieldModel, FieldModelTestAction.KEY_CUSTOM_MESSAGE);
            topicField.ifPresent(model -> fields.put(FieldModelTestAction.KEY_CUSTOM_TOPIC, model));
            messageField.ifPresent(model -> fields.put(FieldModelTestAction.KEY_CUSTOM_MESSAGE, model));
            MessageResult providerTestResult = testProviderConfig(new FieldUtility(fields), jobIdString, channelFieldModel);
            if (providerTestResult.hasErrors()) {
                responseModel = ValidationResponseModel.fromStatusCollection(providerTestResult.getStatusMessage(), providerTestResult.getFieldStatuses());
                return new ValidationActionResponse(HttpStatus.OK, responseModel);
            }
            List<BlackDuckProjectDetailsModel> projectFilterDetails = Optional.ofNullable(resource.getConfiguredProviderProjects()).orElse(List.of()).stream().map(jobProject -> new BlackDuckProjectDetailsModel(jobProject.getName(), jobProject.getHref())).collect(Collectors.toList());
            DistributionJobModel testJobModel = distributionJobModelExtractor.convertToJobModel(jobId, fields, DateUtils.createCurrentDateTimestamp(), null, projectFilterDetails);
            DistributionChannelTestAction distributionChannelTestAction = channelTestActionMap.findRequiredAction(channelDescriptorName);
            MessageResult testActionResult = distributionChannelTestAction.testConfig(testJobModel, testJobModel.getName(), topicField.flatMap(ConfigurationFieldModel::getFieldValue).orElse(null), messageField.flatMap(ConfigurationFieldModel::getFieldValue).orElse(null));
            List<AlertFieldStatus> resultFieldStatuses = testActionResult.getFieldStatuses();
            List<AlertFieldStatus> allStatuses = Stream.concat(resultFieldStatuses.stream(), providerTestResult.fieldWarnings().stream()).collect(Collectors.toList());
            responseModel = ValidationResponseModel.fromStatusCollection(testActionResult.getStatusMessage(), allStatuses);
            return new ValidationActionResponse(HttpStatus.OK, responseModel);
        }
        responseModel = ValidationResponseModel.generalError("No field model of type channel was was sent to test.");
        return new ValidationActionResponse(HttpStatus.BAD_REQUEST, responseModel);
    } catch (IntegrationRestException e) {
        logger.error(e.getMessage(), e);
        return ValidationActionResponse.createResponseFromIntegrationRestException(e);
    } catch (AlertFieldException e) {
        logger.error("Test Error with field Errors", e);
        responseModel = ValidationResponseModel.fromStatusCollection(e.getMessage(), e.getFieldErrors());
        return new ValidationActionResponse(HttpStatus.OK, responseModel);
    } catch (IntegrationException e) {
        // TODO this is not necessarily a PKIX
        responseModel = pkixErrorResponseFactory.createSSLExceptionResponse(e).orElse(ValidationResponseModel.generalError(e.getMessage()));
        return new ValidationActionResponse(HttpStatus.OK, responseModel);
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
        responseModel = pkixErrorResponseFactory.createSSLExceptionResponse(e).orElse(ValidationResponseModel.generalError(e.getMessage()));
        return new ValidationActionResponse(HttpStatus.OK, responseModel);
    }
}
Also used : DistributionJobModel(com.synopsys.integration.alert.common.persistence.model.job.DistributionJobModel) IntegrationException(com.synopsys.integration.exception.IntegrationException) DistributionChannelTestAction(com.synopsys.integration.alert.common.channel.DistributionChannelTestAction) AlertFieldStatus(com.synopsys.integration.alert.common.descriptor.config.field.errors.AlertFieldStatus) ConfigurationFieldModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationFieldModel) DataStructureUtils(com.synopsys.integration.alert.common.util.DataStructureUtils) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) StringUtils(org.apache.commons.lang3.StringUtils) ConfigurationFieldModelConverter(com.synopsys.integration.alert.common.persistence.util.ConfigurationFieldModelConverter) AbstractJobResourceActions(com.synopsys.integration.alert.common.action.api.AbstractJobResourceActions) JobAccessor(com.synopsys.integration.alert.common.persistence.accessor.JobAccessor) ProviderProjectExistencePopulator(com.synopsys.integration.alert.api.provider.ProviderProjectExistencePopulator) ActionResponse(com.synopsys.integration.alert.common.action.ActionResponse) ValidationResponseModel(com.synopsys.integration.alert.common.rest.model.ValidationResponseModel) DescriptorKey(com.synopsys.integration.alert.descriptor.api.model.DescriptorKey) BlackDuckProjectDetailsModel(com.synopsys.integration.alert.common.persistence.model.job.BlackDuckProjectDetailsModel) Map(java.util.Map) ListUtils(org.apache.commons.collections4.ListUtils) DateUtils(com.synopsys.integration.alert.common.util.DateUtils) DistributionJobRequestModel(com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel) JobPagedModel(com.synopsys.integration.alert.common.rest.model.JobPagedModel) Collection(java.util.Collection) Set(java.util.Set) JobProviderProjectFieldModel(com.synopsys.integration.alert.common.rest.model.JobProviderProjectFieldModel) UUID(java.util.UUID) AlertPagedModel(com.synopsys.integration.alert.common.rest.model.AlertPagedModel) Collectors(java.util.stream.Collectors) FieldUtility(com.synopsys.integration.alert.common.persistence.accessor.FieldUtility) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) OffsetDateTime(java.time.OffsetDateTime) Stream(java.util.stream.Stream) FieldModelProcessor(com.synopsys.integration.alert.common.rest.FieldModelProcessor) Optional(java.util.Optional) JobFieldStatuses(com.synopsys.integration.alert.common.rest.model.JobFieldStatuses) Descriptor(com.synopsys.integration.alert.common.descriptor.Descriptor) AlertFieldException(com.synopsys.integration.alert.common.exception.AlertFieldException) MessageResult(com.synopsys.integration.alert.common.message.model.MessageResult) ValidationActionResponse(com.synopsys.integration.alert.common.action.ValidationActionResponse) DescriptorAccessor(com.synopsys.integration.alert.common.persistence.accessor.DescriptorAccessor) ConfigurationModelConfigurationAccessor(com.synopsys.integration.alert.common.persistence.accessor.ConfigurationModelConfigurationAccessor) HashMap(java.util.HashMap) PKIXErrorResponseFactory(com.synopsys.integration.alert.component.certificates.web.PKIXErrorResponseFactory) DescriptorMap(com.synopsys.integration.alert.common.descriptor.DescriptorMap) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) DescriptorActionMap(com.synopsys.integration.alert.common.descriptor.action.DescriptorActionMap) PermissionKey(com.synopsys.integration.alert.common.persistence.model.PermissionKey) DescriptorType(com.synopsys.integration.alert.common.enumeration.DescriptorType) LinkedList(java.util.LinkedList) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) JobIdsRequestModel(com.synopsys.integration.alert.common.rest.model.JobIdsRequestModel) JobFieldModel(com.synopsys.integration.alert.common.rest.model.JobFieldModel) AuthorizationManager(com.synopsys.integration.alert.common.security.authorization.AuthorizationManager) Logger(org.slf4j.Logger) ChannelDescriptor(com.synopsys.integration.alert.common.descriptor.ChannelDescriptor) ConfigContextEnum(com.synopsys.integration.alert.common.enumeration.ConfigContextEnum) AlertException(com.synopsys.integration.alert.api.common.model.exception.AlertException) ConfigurationModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationModel) HttpStatus(org.springframework.http.HttpStatus) Component(org.springframework.stereotype.Component) IntegrationRestException(com.synopsys.integration.rest.exception.IntegrationRestException) DescriptorProcessor(com.synopsys.integration.alert.common.descriptor.DescriptorProcessor) GlobalConfigExistsValidator(com.synopsys.integration.alert.common.descriptor.config.GlobalConfigExistsValidator) FieldModelTestAction(com.synopsys.integration.alert.common.action.FieldModelTestAction) FieldValueModel(com.synopsys.integration.alert.common.rest.model.FieldValueModel) DistributionChannelTestAction(com.synopsys.integration.alert.common.channel.DistributionChannelTestAction) IntegrationRestException(com.synopsys.integration.rest.exception.IntegrationRestException) IntegrationException(com.synopsys.integration.exception.IntegrationException) AlertFieldStatus(com.synopsys.integration.alert.common.descriptor.config.field.errors.AlertFieldStatus) AlertFieldException(com.synopsys.integration.alert.common.exception.AlertFieldException) MessageResult(com.synopsys.integration.alert.common.message.model.MessageResult) LinkedList(java.util.LinkedList) IntegrationException(com.synopsys.integration.exception.IntegrationException) AlertFieldException(com.synopsys.integration.alert.common.exception.AlertFieldException) AlertException(com.synopsys.integration.alert.api.common.model.exception.AlertException) IntegrationRestException(com.synopsys.integration.rest.exception.IntegrationRestException) DistributionJobModel(com.synopsys.integration.alert.common.persistence.model.job.DistributionJobModel) ValidationResponseModel(com.synopsys.integration.alert.common.rest.model.ValidationResponseModel) ConfigurationFieldModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationFieldModel) BlackDuckProjectDetailsModel(com.synopsys.integration.alert.common.persistence.model.job.BlackDuckProjectDetailsModel) ValidationActionResponse(com.synopsys.integration.alert.common.action.ValidationActionResponse) StringUtils(org.apache.commons.lang3.StringUtils) UUID(java.util.UUID) ConfigurationFieldModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationFieldModel) JobProviderProjectFieldModel(com.synopsys.integration.alert.common.rest.model.JobProviderProjectFieldModel) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) JobFieldModel(com.synopsys.integration.alert.common.rest.model.JobFieldModel) FieldUtility(com.synopsys.integration.alert.common.persistence.accessor.FieldUtility)

Example 7 with IntegrationException

use of com.synopsys.integration.exception.IntegrationException in project hub-alert by blackducksoftware.

the class ConfigActions method testWithoutChecks.

@Override
protected ValidationActionResponse testWithoutChecks(FieldModel resource) {
    Optional<FieldModelTestAction> testActionOptional = descriptorProcessor.retrieveTestAction(resource);
    ValidationResponseModel responseModel;
    if (testActionOptional.isPresent()) {
        try {
            FieldModel upToDateFieldModel = fieldModelProcessor.createCustomMessageFieldModel(resource);
            FieldUtility fieldUtility = modelConverter.convertToFieldAccessor(upToDateFieldModel);
            FieldModelTestAction fieldModelTestAction = testActionOptional.get();
            // TODO return the message from the result of testAction.testConfig(...)
            fieldModelTestAction.testConfig(upToDateFieldModel.getId(), upToDateFieldModel, fieldUtility);
            responseModel = ValidationResponseModel.success("Successfully sent test message.");
            return new ValidationActionResponse(HttpStatus.OK, responseModel);
        } catch (IntegrationRestException e) {
            logger.error(e.getMessage(), e);
            return ValidationActionResponse.createResponseFromIntegrationRestException(e);
        } catch (AlertFieldException e) {
            logger.error("Test Error with field Errors", e);
            responseModel = ValidationResponseModel.fromStatusCollection(e.getMessage(), e.getFieldErrors());
            return new ValidationActionResponse(HttpStatus.OK, responseModel);
        } catch (IntegrationException e) {
            // FIXME there are definitely other possibilities than this
            responseModel = pkixErrorResponseFactory.createSSLExceptionResponse(e).orElse(ValidationResponseModel.generalError(e.getMessage()));
            return new ValidationActionResponse(HttpStatus.OK, responseModel);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            responseModel = pkixErrorResponseFactory.createSSLExceptionResponse(e).orElse(ValidationResponseModel.generalError(e.getMessage()));
            return new ValidationActionResponse(HttpStatus.OK, responseModel);
        }
    }
    String descriptorName = resource.getDescriptorName();
    responseModel = ValidationResponseModel.generalError("Test functionality not implemented for " + descriptorName);
    return new ValidationActionResponse(HttpStatus.NOT_IMPLEMENTED, responseModel);
}
Also used : ValidationResponseModel(com.synopsys.integration.alert.common.rest.model.ValidationResponseModel) FieldModelTestAction(com.synopsys.integration.alert.common.action.FieldModelTestAction) IntegrationRestException(com.synopsys.integration.rest.exception.IntegrationRestException) IntegrationException(com.synopsys.integration.exception.IntegrationException) ValidationActionResponse(com.synopsys.integration.alert.common.action.ValidationActionResponse) AlertFieldException(com.synopsys.integration.alert.common.exception.AlertFieldException) ConfigurationFieldModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationFieldModel) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) MultiFieldModel(com.synopsys.integration.alert.common.rest.model.MultiFieldModel) FieldUtility(com.synopsys.integration.alert.common.persistence.accessor.FieldUtility) AlertFieldException(com.synopsys.integration.alert.common.exception.AlertFieldException) IntegrationException(com.synopsys.integration.exception.IntegrationException) AlertException(com.synopsys.integration.alert.api.common.model.exception.AlertException) IntegrationRestException(com.synopsys.integration.rest.exception.IntegrationRestException)

Example 8 with IntegrationException

use of com.synopsys.integration.exception.IntegrationException in project hub-alert by blackducksoftware.

the class PolicyNotificationFilterCustomFunctionAction method createPagedActionResponse.

@Override
public ActionResponse<NotificationFilterModelOptions> createPagedActionResponse(FieldModel fieldModel, HttpServletContentWrapper servletContentWrapper, int pageNumber, int pageSize, String searchTerm) throws IntegrationException {
    Optional<FieldValueModel> fieldValueModel = fieldModel.getFieldValueModel(ProviderDescriptor.KEY_NOTIFICATION_TYPES);
    Collection<String> selectedNotificationTypes = fieldValueModel.map(FieldValueModel::getValues).orElse(List.of());
    int totalPages = 1;
    List<NotificationFilterModel> options = List.of();
    if (isJobFilterableByPolicy(selectedNotificationTypes)) {
        try {
            Optional<BlackDuckServicesFactory> blackDuckServicesFactory = createBlackDuckServicesFactory(fieldModel);
            if (blackDuckServicesFactory.isPresent()) {
                BlackDuckPageResponse<PolicyRuleView> policyRulesPage = retrievePolicyRules(blackDuckServicesFactory.get(), pageNumber, pageSize, searchTerm);
                totalPages = (policyRulesPage.getTotalCount() + (pageSize - 1)) / pageSize;
                options = convertToNotificationFilterModel(policyRulesPage.getItems());
            }
        } catch (IntegrationException e) {
            logger.errorAndDebug("There was an issue communicating with Black Duck. " + e.getMessage(), e);
            throw new AlertException("Unable to communicate with Black Duck.", e);
        }
    }
    NotificationFilterModelOptions notificationFilterModelOptions = new NotificationFilterModelOptions(totalPages, pageNumber, pageSize, options);
    return new ActionResponse<>(HttpStatus.OK, notificationFilterModelOptions);
}
Also used : IntegrationException(com.synopsys.integration.exception.IntegrationException) PolicyRuleView(com.synopsys.integration.blackduck.api.generated.view.PolicyRuleView) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory) ActionResponse(com.synopsys.integration.alert.common.action.ActionResponse) FieldValueModel(com.synopsys.integration.alert.common.rest.model.FieldValueModel) AlertException(com.synopsys.integration.alert.api.common.model.exception.AlertException)

Example 9 with IntegrationException

use of com.synopsys.integration.exception.IntegrationException in project hub-alert by blackducksoftware.

the class BlackDuckProviderDataAccessor method getProjectVersionNamesByHref.

@Override
public AlertPagedModel<String> getProjectVersionNamesByHref(Long providerConfigId, String projectHref, int pageNumber) {
    Optional<ConfigurationModel> providerConfigOptional = configurationModelConfigurationAccessor.getConfigurationById(providerConfigId);
    if (providerConfigOptional.isPresent()) {
        try {
            BlackDuckServicesFactory blackDuckServicesFactory = createBlackDuckServicesFactory(providerConfigOptional.get());
            BlackDuckApiClient blackDuckApiClient = blackDuckServicesFactory.getBlackDuckApiClient();
            ProjectView foundProject = blackDuckApiClient.getResponse(new HttpUrl(projectHref), ProjectView.class);
            BlackDuckPageDefinition blackDuckPageDefinition = new BlackDuckPageDefinition(BlackDuckRequestBuilder.DEFAULT_LIMIT, pageNumber * BlackDuckRequestBuilder.DEFAULT_LIMIT);
            BlackDuckMultipleRequest<ProjectVersionView> projectVersionSpec = new BlackDuckRequestBuilder().commonGet().setBlackDuckPageDefinition(blackDuckPageDefinition).buildBlackDuckRequest(foundProject.metaVersionsLink());
            BlackDuckPageResponse<ProjectVersionView> pageResponse = blackDuckApiClient.getPageResponse(projectVersionSpec);
            return new AlertPagedModel<>(pageResponse.getTotalCount(), pageNumber, BlackDuckRequestBuilder.DEFAULT_LIMIT, pageResponse.getItems()).transformContent(ProjectVersionView::getVersionName);
        } catch (IntegrationException e) {
            logger.errorAndDebug(createProjectNotFoundString(providerConfigId, e.getMessage()), e);
        }
    }
    return AlertPagedModel.empty(pageNumber, BlackDuckRequestBuilder.DEFAULT_LIMIT);
}
Also used : BlackDuckPageDefinition(com.synopsys.integration.blackduck.http.BlackDuckPageDefinition) ConfigurationModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationModel) IntegrationException(com.synopsys.integration.exception.IntegrationException) BlackDuckApiClient(com.synopsys.integration.blackduck.service.BlackDuckApiClient) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory) HttpUrl(com.synopsys.integration.rest.HttpUrl) ProjectVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView) BlackDuckRequestBuilder(com.synopsys.integration.blackduck.http.BlackDuckRequestBuilder) ProjectView(com.synopsys.integration.blackduck.api.generated.view.ProjectView)

Example 10 with IntegrationException

use of com.synopsys.integration.exception.IntegrationException in project hub-alert by blackducksoftware.

the class BlackDuckDistributionFieldModelTestAction method testConfig.

@Override
public MessageResult testConfig(String configId, FieldModel fieldModel, FieldUtility registeredFieldValues) throws IntegrationException {
    ArrayList<AlertFieldStatus> fieldStatuses = new ArrayList<>();
    Optional<Long> optionalProviderConfigId = registeredFieldValues.getLong(ProviderDescriptor.KEY_PROVIDER_CONFIG_ID);
    if (optionalProviderConfigId.isPresent()) {
        Long providerConfigId = optionalProviderConfigId.get();
        boolean filterByProjects = registeredFieldValues.getBoolean(ProviderDescriptor.KEY_FILTER_BY_PROJECT).orElse(false);
        if (filterByProjects) {
            Collection<String> configuredProjects = registeredFieldValues.getAllStrings(ProviderDescriptor.KEY_CONFIGURED_PROJECT);
            validateSelectedProjectExists(providerConfigId, configuredProjects).ifPresent(fieldStatuses::add);
            Optional<String> optionalProjectNamePattern = registeredFieldValues.getString(ProviderDescriptor.KEY_PROJECT_NAME_PATTERN);
            optionalProjectNamePattern.flatMap(projectNamePattern -> validatePatternMatchesProject(providerConfigId, projectNamePattern)).ifPresent(fieldStatuses::add);
            registeredFieldValues.getString(ProviderDescriptor.KEY_PROJECT_VERSION_NAME_PATTERN).flatMap(projectVersionNamePattern -> validatePatternMatchesProjectVersion(providerConfigId, projectVersionNamePattern, optionalProjectNamePattern.orElse(null), configuredProjects)).ifPresent(fieldStatuses::add);
        }
        BlackDuckProperties blackDuckProperties = null;
        Optional<ConfigurationModel> providerConfigurationOptional = configurationModelConfigurationAccessor.getConfigurationById(providerConfigId);
        if (providerConfigurationOptional.isPresent()) {
            ConfigurationModel providerConfiguration = providerConfigurationOptional.get();
            StatefulProvider statefulProvider = blackDuckProvider.createStatefulProvider(providerConfiguration);
            blackDuckProperties = (BlackDuckProperties) statefulProvider.getProperties();
        }
        if (null != blackDuckProperties) {
            BlackDuckApiTokenValidator blackDuckAPITokenValidator = new BlackDuckApiTokenValidator(blackDuckProperties);
            if (!blackDuckAPITokenValidator.isApiTokenValid()) {
                fieldStatuses.add(AlertFieldStatus.error(ProviderDescriptor.KEY_PROVIDER_CONFIG_ID, "User permission failed, cannot read notifications from Black Duck."));
            }
        }
    } else {
        fieldStatuses.add(AlertFieldStatus.error(ProviderDescriptor.KEY_PROVIDER_CONFIG_ID, "A provider configuration is required"));
    }
    if (MessageResult.hasFieldStatusBySeverity(fieldStatuses, FieldStatusSeverity.ERROR)) {
        return new MessageResult("There were errors with the BlackDuck provider fields", fieldStatuses);
    }
    return new MessageResult("Successfully tested BlackDuck provider fields", fieldStatuses);
}
Also used : BlackDuckProvider(com.synopsys.integration.alert.provider.blackduck.BlackDuckProvider) FieldStatusSeverity(com.synopsys.integration.alert.common.descriptor.config.field.errors.FieldStatusSeverity) MessageResult(com.synopsys.integration.alert.common.message.model.MessageResult) ProviderDataAccessor(com.synopsys.integration.alert.common.persistence.accessor.ProviderDataAccessor) IntegrationException(com.synopsys.integration.exception.IntegrationException) AlertFieldStatus(com.synopsys.integration.alert.common.descriptor.config.field.errors.AlertFieldStatus) ConfigurationModelConfigurationAccessor(com.synopsys.integration.alert.common.persistence.accessor.ConfigurationModelConfigurationAccessor) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) Function(java.util.function.Function) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) Nullable(org.springframework.lang.Nullable) ProviderDescriptor(com.synopsys.integration.alert.api.provider.ProviderDescriptor) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) BlackDuckApiTokenValidator(com.synopsys.integration.alert.provider.blackduck.validator.BlackDuckApiTokenValidator) Logger(org.slf4j.Logger) Predicate(java.util.function.Predicate) Collection(java.util.Collection) Set(java.util.Set) AlertPagedModel(com.synopsys.integration.alert.common.rest.model.AlertPagedModel) Collectors(java.util.stream.Collectors) StatefulProvider(com.synopsys.integration.alert.api.provider.state.StatefulProvider) ConfigurationModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationModel) BlackDuckProperties(com.synopsys.integration.alert.provider.blackduck.BlackDuckProperties) FieldUtility(com.synopsys.integration.alert.common.persistence.accessor.FieldUtility) ProviderProject(com.synopsys.integration.alert.common.persistence.model.ProviderProject) List(java.util.List) Component(org.springframework.stereotype.Component) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) FieldModelTestAction(com.synopsys.integration.alert.common.action.FieldModelTestAction) ConfigurationModel(com.synopsys.integration.alert.common.persistence.model.ConfigurationModel) BlackDuckProperties(com.synopsys.integration.alert.provider.blackduck.BlackDuckProperties) ArrayList(java.util.ArrayList) AlertFieldStatus(com.synopsys.integration.alert.common.descriptor.config.field.errors.AlertFieldStatus) MessageResult(com.synopsys.integration.alert.common.message.model.MessageResult) StatefulProvider(com.synopsys.integration.alert.api.provider.state.StatefulProvider) BlackDuckApiTokenValidator(com.synopsys.integration.alert.provider.blackduck.validator.BlackDuckApiTokenValidator)

Aggregations

IntegrationException (com.synopsys.integration.exception.IntegrationException)53 HttpUrl (com.synopsys.integration.rest.HttpUrl)19 AlertException (com.synopsys.integration.alert.api.common.model.exception.AlertException)14 BlackDuckApiClient (com.synopsys.integration.blackduck.service.BlackDuckApiClient)13 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)12 ProjectView (com.synopsys.integration.blackduck.api.generated.view.ProjectView)11 ConfigurationModel (com.synopsys.integration.alert.common.persistence.model.ConfigurationModel)10 UserView (com.synopsys.integration.blackduck.api.generated.view.UserView)9 ArrayList (java.util.ArrayList)9 ProviderProject (com.synopsys.integration.alert.common.persistence.model.ProviderProject)8 Slf4jIntLogger (com.synopsys.integration.log.Slf4jIntLogger)8 Set (java.util.Set)8 Test (org.junit.jupiter.api.Test)8 FieldModel (com.synopsys.integration.alert.common.rest.model.FieldModel)7 ProjectVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView)7 List (java.util.List)7 Optional (java.util.Optional)7 AlertFieldException (com.synopsys.integration.alert.common.exception.AlertFieldException)6 ConfigurationModelConfigurationAccessor (com.synopsys.integration.alert.common.persistence.accessor.ConfigurationModelConfigurationAccessor)6 AlertPagedModel (com.synopsys.integration.alert.common.rest.model.AlertPagedModel)6