class PushNotificationSubscriptionRequestProcessingServiceImpl implements PushNotificationSubscriptionRequestProcessingService {

    @Nonnull
    @Override
    public PushNotificationRecipient processPushNotificationSubscriptionRequest(@Nonnull final Long requestId) {
        Assert.notNull(requestId, "Push notification subscription request id should not be null");
        LOGGER.debug("Processing push notification subscription request with id - {}", requestId);
        final PushNotificationSubscriptionRequest request = pushNotificationSubscriptionRequestService.getPushNotificationSubscriptionRequestById(requestId);
        // Assert push notification request state
        assertPushNotificationSubscriptionRequestState(request);
        // Update state
        updatePushNotificationSubscriptionRequestState(request.getId(), PushNotificationSubscriptionRequestState.PROCESSING);
        try {
            final PushNotificationSubscriptionProcessingParameters parameters = buildSubscriptionProcessingParameters(request);
            LOGGER.debug("Starting push notification subscription processing for request with id - {}, processing parameters - {}", request.getId(), parameters);
            final PushNotificationRecipient recipient = pushNotificationSubscriptionProcessingService.processPushNotificationSubscriptionChange(parameters);
            // Update recipient on request
            pushNotificationSubscriptionRequestService.updatePushNotificationSubscriptionRequestRecipient(request.getId(), recipient.getId());
            LOGGER.debug("Successfully created push notification recipient for subscription request with id - {} and processing parameters - {}. Recipient - {}", requestId, parameters, recipient);
            updatePushNotificationSubscriptionRequestState(request.getId(), PushNotificationSubscriptionRequestState.PROCESSED);
            return recipient;
        } catch (final Exception ex) {
            updatePushNotificationSubscriptionRequestState(request.getId(), PushNotificationSubscriptionRequestState.FAILED);
            final String message = "Error occurred while processing push notification subscription request with id - " + request.getId();
            LOGGER.error(message, ex);
            throw new ServicesRuntimeException(message, ex);
        }
    }

      PushNotificationSubscriptionRequestProcessingServiceImpl(@Value("${push.notification.provider:AMAZON_SNS}") final NotificationProviderType notificationProviderType);

}