Search in sources :

Example 1 with NotificationParamsBuilder

use of io.gravitee.rest.api.service.notification.NotificationParamsBuilder in project gravitee-management-rest-api by gravitee-io.

the class ApiServiceImpl method updateWorkflowReview.

private ApiEntity updateWorkflowReview(final String apiId, final String userId, final ApiHook hook, final WorkflowState workflowState, final String workflowMessage) {
    Workflow workflow = workflowService.create(WorkflowReferenceType.API, apiId, REVIEW, userId, workflowState, workflowMessage);
    final ApiEntity apiEntity = findById(apiId);
    apiEntity.setWorkflowState(workflowState);
    final UserEntity user = userService.findById(userId);
    notifierService.trigger(hook, apiId, new NotificationParamsBuilder().api(apiEntity).user(user).build());
    // Find all reviewers of the API and send them a notification email
    if (hook.equals(ApiHook.ASK_FOR_REVIEW)) {
        List<String> reviewersEmail = findAllReviewersEmail(apiId);
        this.emailService.sendAsyncEmailNotification(new EmailNotificationBuilder().params(new NotificationParamsBuilder().api(apiEntity).user(user).build()).to(reviewersEmail.toArray(new String[reviewersEmail.size()])).template(EmailNotificationBuilder.EmailTemplate.API_ASK_FOR_REVIEW).build(), GraviteeContext.getCurrentContext());
    }
    Map<Audit.AuditProperties, String> properties = new HashMap<>();
    properties.put(Audit.AuditProperties.USER, userId);
    properties.put(Audit.AuditProperties.API, apiId);
    Workflow.AuditEvent evtType = null;
    switch(workflowState) {
        case REQUEST_FOR_CHANGES:
            evtType = API_REVIEW_REJECTED;
            break;
        case REVIEW_OK:
            evtType = API_REVIEW_ACCEPTED;
            break;
        default:
            evtType = API_REVIEW_ASKED;
            break;
    }
    auditService.createApiAuditLog(apiId, properties, evtType, new Date(), null, workflow);
    return apiEntity;
}
Also used : AuditEvent(io.gravitee.repository.management.model.Workflow.AuditEvent) UuidString(io.gravitee.rest.api.service.common.UuidString) EmailNotificationBuilder(io.gravitee.rest.api.service.builder.EmailNotificationBuilder) NotificationParamsBuilder(io.gravitee.rest.api.service.notification.NotificationParamsBuilder)

Example 2 with NotificationParamsBuilder

use of io.gravitee.rest.api.service.notification.NotificationParamsBuilder in project gravitee-management-rest-api by gravitee-io.

the class ApiKeyServiceImpl method setExpiration.

private void setExpiration(Date expirationDate, ApiKey key) throws TechnicalException {
    final Date now = new Date();
    if (now.after(expirationDate)) {
        expirationDate = now;
    }
    key.setUpdatedAt(now);
    if (!key.isRevoked()) {
        // the expired date must be <= than the subscription end date
        SubscriptionEntity subscription = subscriptionService.findById(key.getSubscription());
        if (subscription.getEndingAt() != null && (expirationDate == null || subscription.getEndingAt().compareTo(expirationDate) < 0)) {
            expirationDate = subscription.getEndingAt();
        }
        ApiKey oldkey = new ApiKey(key);
        key.setExpireAt(expirationDate);
        key.setDaysToExpirationOnLastNotification(null);
        apiKeyRepository.update(key);
        // notify
        final ApplicationEntity application = applicationService.findById(key.getApplication());
        final PlanEntity plan = planService.findById(key.getPlan());
        final ApiModelEntity api = apiService.findByIdForTemplates(plan.getApi());
        final PrimaryOwnerEntity owner = application.getPrimaryOwner();
        NotificationParamsBuilder paramsBuilder = new NotificationParamsBuilder();
        paramsBuilder.api(api).application(application).apikey(key).plan(plan).owner(owner);
        if (key.getExpireAt() != null && now.before(key.getExpireAt())) {
            paramsBuilder.expirationDate(key.getExpireAt());
        }
        final Map<String, Object> params = paramsBuilder.build();
        notifierService.trigger(ApiHook.APIKEY_EXPIRED, api.getId(), params);
        // Audit
        Map<Audit.AuditProperties, String> properties = new LinkedHashMap<>();
        properties.put(API_KEY, key.getKey());
        properties.put(API, api.getId());
        properties.put(APPLICATION, application.getId());
        auditService.createApiAuditLog(plan.getApi(), properties, APIKEY_EXPIRED, key.getUpdatedAt(), oldkey, key);
    } else {
        apiKeyRepository.update(key);
    }
}
Also used : ApiKey(io.gravitee.repository.management.model.ApiKey) NotificationParamsBuilder(io.gravitee.rest.api.service.notification.NotificationParamsBuilder) AuditProperties(io.gravitee.repository.management.model.Audit.AuditProperties)

Example 3 with NotificationParamsBuilder

use of io.gravitee.rest.api.service.notification.NotificationParamsBuilder in project gravitee-management-rest-api by gravitee-io.

the class SubscriptionServiceImpl method pause.

@Override
public SubscriptionEntity pause(String subscriptionId) {
    try {
        logger.debug("Pause subscription {}", subscriptionId);
        Optional<Subscription> optSubscription = subscriptionRepository.findById(subscriptionId);
        if (!optSubscription.isPresent()) {
            throw new SubscriptionNotFoundException(subscriptionId);
        }
        Subscription subscription = optSubscription.get();
        if (subscription.getStatus() == Subscription.Status.ACCEPTED) {
            Subscription previousSubscription = new Subscription(subscription);
            final Date now = new Date();
            subscription.setUpdatedAt(now);
            subscription.setPausedAt(now);
            subscription.setStatus(Subscription.Status.PAUSED);
            subscription = subscriptionRepository.update(subscription);
            // Send an email to subscriber
            final ApplicationEntity application = applicationService.findById(subscription.getApplication());
            final PlanEntity plan = planService.findById(subscription.getPlan());
            String apiId = plan.getApi();
            final ApiModelEntity api = apiService.findByIdForTemplates(apiId);
            final PrimaryOwnerEntity owner = application.getPrimaryOwner();
            final Map<String, Object> params = new NotificationParamsBuilder().owner(owner).api(api).plan(plan).application(application).build();
            notifierService.trigger(ApiHook.SUBSCRIPTION_PAUSED, apiId, params);
            notifierService.trigger(ApplicationHook.SUBSCRIPTION_PAUSED, application.getId(), params);
            createAudit(apiId, subscription.getApplication(), SUBSCRIPTION_PAUSED, subscription.getUpdatedAt(), previousSubscription, subscription);
            // API Keys are automatically paused
            List<ApiKeyEntity> apiKeys = apiKeyService.findBySubscription(subscription.getId());
            for (ApiKeyEntity apiKey : apiKeys) {
                Date expireAt = apiKey.getExpireAt();
                if (!apiKey.isRevoked() && (expireAt == null || expireAt.equals(now) || expireAt.after(now))) {
                    apiKey.setPaused(true);
                    apiKey.setUpdatedAt(now);
                    apiKeyService.update(apiKey);
                }
            }
            return convert(subscription);
        }
        throw new SubscriptionNotPausableException(subscription);
    } catch (TechnicalException ex) {
        logger.error("An error occurs while trying to pause subscription {}", subscriptionId, ex);
        throw new TechnicalManagementException(String.format("An error occurs while trying to pause subscription %s", subscriptionId), ex);
    }
}
Also used : TechnicalException(io.gravitee.repository.exceptions.TechnicalException) UuidString(io.gravitee.rest.api.service.common.UuidString) NotificationParamsBuilder(io.gravitee.rest.api.service.notification.NotificationParamsBuilder) Subscription(io.gravitee.repository.management.model.Subscription)

Example 4 with NotificationParamsBuilder

use of io.gravitee.rest.api.service.notification.NotificationParamsBuilder in project gravitee-management-rest-api by gravitee-io.

the class SubscriptionServiceImpl method close.

@Override
public SubscriptionEntity close(String subscriptionId) {
    try {
        logger.debug("Close subscription {}", subscriptionId);
        Optional<Subscription> optSubscription = subscriptionRepository.findById(subscriptionId);
        if (!optSubscription.isPresent()) {
            throw new SubscriptionNotFoundException(subscriptionId);
        }
        Subscription subscription = optSubscription.get();
        switch(subscription.getStatus()) {
            case ACCEPTED:
            case PAUSED:
                Subscription previousSubscription = new Subscription(subscription);
                final Date now = new Date();
                subscription.setUpdatedAt(now);
                subscription.setStatus(Subscription.Status.CLOSED);
                subscription.setClosedAt(new Date());
                subscription = subscriptionRepository.update(subscription);
                // Send an email to subscriber
                final ApplicationEntity application = applicationService.findById(subscription.getApplication());
                final PlanEntity plan = planService.findById(subscription.getPlan());
                String apiId = plan.getApi();
                final ApiModelEntity api = apiService.findByIdForTemplates(apiId);
                final PrimaryOwnerEntity owner = application.getPrimaryOwner();
                final Map<String, Object> params = new NotificationParamsBuilder().owner(owner).api(api).plan(plan).application(application).build();
                notifierService.trigger(ApiHook.SUBSCRIPTION_CLOSED, apiId, params);
                notifierService.trigger(ApplicationHook.SUBSCRIPTION_CLOSED, application.getId(), params);
                createAudit(apiId, subscription.getApplication(), SUBSCRIPTION_CLOSED, subscription.getUpdatedAt(), previousSubscription, subscription);
                // API Keys are automatically revoked
                List<ApiKeyEntity> apiKeys = apiKeyService.findBySubscription(subscription.getId());
                for (ApiKeyEntity apiKey : apiKeys) {
                    Date expireAt = apiKey.getExpireAt();
                    if (!apiKey.isRevoked()) {
                        apiKey.setExpireAt(now);
                        apiKey.setRevokedAt(now);
                        apiKey.setRevoked(true);
                        apiKeyService.revoke(apiKey.getKey(), false);
                    }
                }
                return convert(subscription);
            case PENDING:
                ProcessSubscriptionEntity processSubscriptionEntity = new ProcessSubscriptionEntity();
                processSubscriptionEntity.setId(subscription.getId());
                processSubscriptionEntity.setAccepted(false);
                processSubscriptionEntity.setReason("Subscription has been closed.");
                return this.process(processSubscriptionEntity, getAuthenticatedUsername());
            default:
                throw new SubscriptionNotClosableException(subscription);
        }
    } catch (TechnicalException ex) {
        logger.error("An error occurs while trying to close subscription {}", subscriptionId, ex);
        throw new TechnicalManagementException(String.format("An error occurs while trying to close subscription %s", subscriptionId), ex);
    }
}
Also used : TechnicalException(io.gravitee.repository.exceptions.TechnicalException) UuidString(io.gravitee.rest.api.service.common.UuidString) NotificationParamsBuilder(io.gravitee.rest.api.service.notification.NotificationParamsBuilder) Subscription(io.gravitee.repository.management.model.Subscription)

Example 5 with NotificationParamsBuilder

use of io.gravitee.rest.api.service.notification.NotificationParamsBuilder in project gravitee-management-rest-api by gravitee-io.

the class ApiServiceImpl method update.

@Override
public ApiEntity update(String apiId, UpdateApiEntity updateApiEntity, boolean checkPlans) {
    try {
        LOGGER.debug("Update API {}", apiId);
        Optional<Api> optApiToUpdate = apiRepository.findById(apiId);
        if (!optApiToUpdate.isPresent()) {
            throw new ApiNotFoundException(apiId);
        }
        // check if entrypoints are unique
        final Collection<VirtualHost> sanitizedVirtualHosts = virtualHostService.sanitizeAndValidate(updateApiEntity.getProxy().getVirtualHosts(), apiId);
        updateApiEntity.getProxy().setVirtualHosts(new ArrayList<>(sanitizedVirtualHosts));
        // check endpoints presence
        checkEndpointsExists(updateApiEntity);
        // check endpoints name
        checkEndpointsName(updateApiEntity);
        // check HC inheritance
        checkHealthcheckInheritance(updateApiEntity);
        // validate HC cron schedule
        validateHealtcheckSchedule(updateApiEntity);
        // check CORS Allow-origin format
        checkAllowOriginFormat(updateApiEntity);
        addLoggingMaxDuration(updateApiEntity.getProxy().getLogging());
        // check if there is regex errors in plaintext fields
        validateRegexfields(updateApiEntity);
        // check policy configurations.
        checkPolicyConfigurations(updateApiEntity);
        final ApiEntity apiToCheck = convert(optApiToUpdate.get());
        // if user changes sharding tags, then check if he is allowed to do it
        checkShardingTags(updateApiEntity, apiToCheck);
        // if lifecycle state not provided, set the saved one
        if (updateApiEntity.getLifecycleState() == null) {
            updateApiEntity.setLifecycleState(apiToCheck.getLifecycleState());
        }
        // check lifecycle state
        checkLifecycleState(updateApiEntity, apiToCheck);
        Set<String> groups = updateApiEntity.getGroups();
        if (groups != null && !groups.isEmpty()) {
            // check the existence of groups
            checkGroupExistence(groups);
            // remove PO group if exists
            groups = removePOGroups(groups, apiId);
            updateApiEntity.setGroups(groups);
        }
        // add a default path, if version is v1
        if (Objects.equals(updateApiEntity.getGraviteeDefinitionVersion(), DefinitionVersion.V1.getLabel()) && (updateApiEntity.getPaths() == null || updateApiEntity.getPaths().isEmpty())) {
            updateApiEntity.setPaths(singletonMap("/", new ArrayList<>()));
        }
        if (updateApiEntity.getPlans() == null) {
            updateApiEntity.setPlans(new ArrayList<>());
        } else if (checkPlans) {
            List<Plan> existingPlans = apiToCheck.getPlans();
            Map<String, String> planStatuses = new HashMap<>();
            if (existingPlans != null && !existingPlans.isEmpty()) {
                planStatuses.putAll(existingPlans.stream().collect(toMap(Plan::getId, Plan::getStatus)));
            }
            updateApiEntity.getPlans().forEach(planToUpdate -> {
                if (!planStatuses.containsKey(planToUpdate.getId()) || (planStatuses.containsKey(planToUpdate.getId()) && planStatuses.get(planToUpdate.getId()).equalsIgnoreCase(PlanStatus.CLOSED.name()) && !planStatuses.get(planToUpdate.getId()).equalsIgnoreCase(planToUpdate.getStatus()))) {
                    throw new InvalidDataException("Invalid status for plan '" + planToUpdate.getName() + "'");
                }
            });
        }
        Api apiToUpdate = optApiToUpdate.get();
        if (io.gravitee.rest.api.model.api.ApiLifecycleState.DEPRECATED.equals(updateApiEntity.getLifecycleState())) {
            planService.findByApi(apiId).forEach(plan -> {
                if (PlanStatus.PUBLISHED.equals(plan.getStatus()) || PlanStatus.STAGING.equals(plan.getStatus())) {
                    planService.deprecate(plan.getId(), true);
                    updateApiEntity.getPlans().stream().filter(p -> p.getId().equals(plan.getId())).forEach(p -> p.setStatus(PlanStatus.DEPRECATED.name()));
                }
            });
        }
        Api api = convert(apiId, updateApiEntity, apiToUpdate.getDefinition());
        if (api != null) {
            api.setId(apiId.trim());
            api.setUpdatedAt(new Date());
            // Copy fields from existing values
            api.setEnvironmentId(apiToUpdate.getEnvironmentId());
            api.setDeployedAt(apiToUpdate.getDeployedAt());
            api.setCreatedAt(apiToUpdate.getCreatedAt());
            api.setLifecycleState(apiToUpdate.getLifecycleState());
            // If no new picture and the current picture url is not the default one, keep the current picture
            if (updateApiEntity.getPicture() == null && updateApiEntity.getPictureUrl() != null && updateApiEntity.getPictureUrl().indexOf("?hash") > 0) {
                api.setPicture(apiToUpdate.getPicture());
            }
            if (updateApiEntity.getBackground() == null && updateApiEntity.getBackgroundUrl() != null && updateApiEntity.getBackgroundUrl().indexOf("?hash") > 0) {
                api.setBackground(apiToUpdate.getBackground());
            }
            if (updateApiEntity.getGroups() == null) {
                api.setGroups(apiToUpdate.getGroups());
            }
            if (updateApiEntity.getLabels() == null && apiToUpdate.getLabels() != null) {
                api.setLabels(new ArrayList<>(new HashSet<>(apiToUpdate.getLabels())));
            }
            if (updateApiEntity.getCategories() == null) {
                api.setCategories(apiToUpdate.getCategories());
            }
            if (ApiLifecycleState.DEPRECATED.equals(api.getApiLifecycleState())) {
                notifierService.trigger(ApiHook.API_DEPRECATED, apiId, new NotificationParamsBuilder().api(apiToCheck).user(userService.findById(getAuthenticatedUsername())).build());
            }
            Api updatedApi = apiRepository.update(api);
            // Audit
            auditService.createApiAuditLog(updatedApi.getId(), Collections.emptyMap(), API_UPDATED, updatedApi.getUpdatedAt(), apiToUpdate, updatedApi);
            if (parameterService.findAsBoolean(Key.LOGGING_AUDIT_TRAIL_ENABLED, ParameterReferenceType.ENVIRONMENT)) {
                // Audit API logging if option is enabled
                auditApiLogging(apiToUpdate, updatedApi);
            }
            ApiEntity apiEntity = convert(singletonList(updatedApi)).iterator().next();
            ApiEntity apiWithMetadata = fetchMetadataForApi(apiEntity);
            searchEngineService.index(apiWithMetadata, false);
            return apiEntity;
        } else {
            LOGGER.error("Unable to update API {} because of previous error.", apiId);
            throw new TechnicalManagementException("Unable to update API " + apiId);
        }
    } catch (TechnicalException ex) {
        LOGGER.error("An error occurs while trying to update API {}", apiId, ex);
        throw new TechnicalManagementException("An error occurs while trying to update API " + apiId, ex);
    }
}
Also used : ApiHook(io.gravitee.rest.api.service.notification.ApiHook) EndpointDiscoveryService(io.gravitee.definition.model.services.discovery.EndpointDiscoveryService) Optional.of(java.util.Optional.of) Page(io.gravitee.common.data.domain.Page) Sortable(io.gravitee.rest.api.model.common.Sortable) HookScope(io.gravitee.rest.api.service.notification.HookScope) Autowired(org.springframework.beans.factory.annotation.Autowired) RoleScope(io.gravitee.rest.api.model.permissions.RoleScope) StringUtils(org.apache.commons.lang3.StringUtils) ApiCriteria(io.gravitee.repository.management.api.search.ApiCriteria) Matcher(java.util.regex.Matcher) AuditEvent(io.gravitee.repository.management.model.Api.AuditEvent) PageQuery(io.gravitee.rest.api.model.documentation.PageQuery) JsonNode(com.fasterxml.jackson.databind.JsonNode) EntrypointReferenceType(io.gravitee.rest.api.model.EntrypointReferenceType) ApplicationListItem(io.gravitee.rest.api.model.application.ApplicationListItem) RolePermissionAction(io.gravitee.rest.api.model.permissions.RolePermissionAction) IOUtils(org.apache.commons.io.IOUtils) Stream(java.util.stream.Stream) CollectionUtils(org.springframework.util.CollectionUtils) HealthCheckService(io.gravitee.definition.model.services.healthcheck.HealthCheckService) DatatypeConverter(javax.xml.bind.DatatypeConverter) java.util(java.util) GraviteeContext(io.gravitee.rest.api.service.common.GraviteeContext) Value(org.springframework.beans.factory.annotation.Value) Strings(com.google.common.base.Strings) ApiPrimaryOwnerMode(io.gravitee.rest.api.model.settings.ApiPrimaryOwnerMode) DRAFT(io.gravitee.rest.api.model.WorkflowState.DRAFT) NotificationTemplateService(io.gravitee.rest.api.service.notification.NotificationTemplateService) DefaultMetadataUpgrader(io.gravitee.rest.api.service.impl.upgrade.DefaultMetadataUpgrader) SWAGGER(io.gravitee.rest.api.model.PageType.SWAGGER) HttpEndpoint(io.gravitee.definition.model.endpoint.HttpEndpoint) MembershipMemberType(io.gravitee.rest.api.model.MembershipMemberType) PUBLIC(io.gravitee.repository.management.model.Visibility.PUBLIC) PageableImpl(io.gravitee.rest.api.model.common.PageableImpl) Query(io.gravitee.rest.api.service.search.query.Query) UuidString(io.gravitee.rest.api.service.common.UuidString) IOException(java.io.IOException) io.gravitee.definition.model(io.gravitee.definition.model) io.gravitee.rest.api.model.api(io.gravitee.rest.api.model.api) CronTrigger(org.springframework.scheduling.support.CronTrigger) MembershipReferenceType(io.gravitee.rest.api.model.MembershipReferenceType) GenericNotificationConfigEntity(io.gravitee.rest.api.model.notification.GenericNotificationConfigEntity) io.gravitee.repository.management.model(io.gravitee.repository.management.model) StringReader(java.io.StringReader) io.gravitee.rest.api.service.exceptions(io.gravitee.rest.api.service.exceptions) SearchResult(io.gravitee.rest.api.service.impl.search.SearchResult) REVIEW(io.gravitee.rest.api.model.WorkflowType.REVIEW) Plan(io.gravitee.definition.model.Plan) API(io.gravitee.rest.api.model.WorkflowReferenceType.API) Properties(io.gravitee.definition.model.Properties) URL(java.net.URL) TechnicalException(io.gravitee.repository.exceptions.TechnicalException) LoggerFactory(org.slf4j.LoggerFactory) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) ApiRepository(io.gravitee.repository.management.api.ApiRepository) Lifecycle(io.gravitee.common.component.Lifecycle) PatternSyntaxException(java.util.regex.PatternSyntaxException) ApiQualityRuleRepository(io.gravitee.repository.management.api.ApiQualityRuleRepository) Predicate(java.util.function.Predicate) ApiLifecycleState(io.gravitee.repository.management.model.ApiLifecycleState) MetadataFormat(io.gravitee.rest.api.model.MetadataFormat) Collectors(java.util.stream.Collectors) ApiFieldExclusionFilter(io.gravitee.repository.management.api.search.ApiFieldExclusionFilter) Key(io.gravitee.rest.api.model.parameters.Key) Api(io.gravitee.repository.management.model.Api) NotificationParamsBuilder(io.gravitee.rest.api.service.notification.NotificationParamsBuilder) EmailNotificationBuilder(io.gravitee.rest.api.service.builder.EmailNotificationBuilder) APIV1toAPIV2Converter(io.gravitee.rest.api.service.migration.APIV1toAPIV2Converter) SubscriptionQuery(io.gravitee.rest.api.model.subscription.SubscriptionQuery) Pattern(java.util.regex.Pattern) ApiHeaderEntity(io.gravitee.rest.api.model.api.header.ApiHeaderEntity) NotNull(org.jetbrains.annotations.NotNull) SystemRole(io.gravitee.rest.api.model.permissions.SystemRole) SearchEngineService(io.gravitee.rest.api.service.search.SearchEngineService) io.gravitee.rest.api.service(io.gravitee.rest.api.service) TagReferenceType(io.gravitee.rest.api.model.TagReferenceType) Pageable(io.gravitee.rest.api.model.common.Pageable) ImportConfiguration(io.gravitee.rest.api.service.spring.ImportConfiguration) ApiPermission(io.gravitee.rest.api.model.permissions.ApiPermission) Visibility(io.gravitee.repository.management.model.Visibility) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) EventType(io.gravitee.rest.api.model.EventType) io.gravitee.rest.api.model(io.gravitee.rest.api.model) Comparator.comparing(java.util.Comparator.comparing) PUBLISH_API(io.gravitee.rest.api.model.EventType.PUBLISH_API) ApiSynchronizationProcessor(io.gravitee.rest.api.service.processor.ApiSynchronizationProcessor) Step(io.gravitee.definition.model.flow.Step) AlertReferenceType(io.gravitee.rest.api.model.alert.AlertReferenceType) Logger(org.slf4j.Logger) ParameterReferenceType(io.gravitee.rest.api.model.parameters.ParameterReferenceType) MalformedURLException(java.net.MalformedURLException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) FileInputStream(java.io.FileInputStream) AlertTriggerEntity(io.gravitee.rest.api.model.alert.AlertTriggerEntity) Component(org.springframework.stereotype.Component) INLINE(io.gravitee.rest.api.model.ImportSwaggerDescriptorEntity.Type.INLINE) StringUtils.isBlank(org.apache.commons.lang3.StringUtils.isBlank) AuditEvent(io.gravitee.repository.management.model.Workflow.AuditEvent) QueryBuilder(io.gravitee.rest.api.service.search.query.QueryBuilder) Collections(java.util.Collections) TechnicalException(io.gravitee.repository.exceptions.TechnicalException) UuidString(io.gravitee.rest.api.service.common.UuidString) NotificationParamsBuilder(io.gravitee.rest.api.service.notification.NotificationParamsBuilder) Api(io.gravitee.repository.management.model.Api)

Aggregations

NotificationParamsBuilder (io.gravitee.rest.api.service.notification.NotificationParamsBuilder)16 TechnicalException (io.gravitee.repository.exceptions.TechnicalException)12 UuidString (io.gravitee.rest.api.service.common.UuidString)10 Subscription (io.gravitee.repository.management.model.Subscription)6 ApiKey (io.gravitee.repository.management.model.ApiKey)3 AuditProperties (io.gravitee.repository.management.model.Audit.AuditProperties)3 EmailNotificationBuilder (io.gravitee.rest.api.service.builder.EmailNotificationBuilder)3 Page (io.gravitee.common.data.domain.Page)2 Rating (io.gravitee.repository.management.model.Rating)2 io.gravitee.rest.api.model (io.gravitee.rest.api.model)2 ApiEntity (io.gravitee.rest.api.model.api.ApiEntity)2 ApplicationListItem (io.gravitee.rest.api.model.application.ApplicationListItem)2 Pageable (io.gravitee.rest.api.model.common.Pageable)2 Key (io.gravitee.rest.api.model.parameters.Key)2 ParameterReferenceType (io.gravitee.rest.api.model.parameters.ParameterReferenceType)2 SubscriptionQuery (io.gravitee.rest.api.model.subscription.SubscriptionQuery)2 io.gravitee.rest.api.service (io.gravitee.rest.api.service)2 GraviteeContext (io.gravitee.rest.api.service.common.GraviteeContext)2 io.gravitee.rest.api.service.exceptions (io.gravitee.rest.api.service.exceptions)2 ApiRatingUnavailableException (io.gravitee.rest.api.service.exceptions.ApiRatingUnavailableException)2