Class WebhookService
java.lang.Object
io.jans.ca.plugin.adminui.service.webhook.WebhookService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddWebhook(@Valid WebhookEntry webhook) The function adds a webhook entry to a database, assigns it a unique ID, and associates it with Aui features if provided.The function retrieves all AuiFeature objects from the entryManager and returns them as a List.getAllAuiFeaturesByWebhookId(String webhookId) The function retrieves a list of AuiFeatures that are associated with a specific webhookId.getAuiFeaturesByIds(Set<String> ids) The function `getAuiFeaturesByIds` retrieves a list of AuiFeature objects based on a list of IDs.intgetWebhookByIds(Set<String> ids) The function `getWebhookByIds` retrieves a list of `WebhookEntry` objects based on a list of webhook IDs.getWebhooksByFeatureId(String featureId) voidremoveWebhook(WebhookEntry webhook) The function removes a webhook entry and throws an exception if there is an error.io.jans.orm.model.PagedResult<WebhookEntry>searchWebhooks(io.jans.model.SearchRequest searchRequest) The function searches for webhook entries based on the provided search criteria and returns a paged result.triggerEnabledWebhooks(Set<String> webhookIds, List<ShortCodeRequest> shortCodes) The function triggers enabled webhooks by creating a thread pool, validating each webhook entry, and executing them concurrently.updateWebhook(WebhookEntry webhook) The function updates a webhook entry, validates the entry, and performs additional operations if necessary.voidvalidateWebhookEntry(WebhookEntry webhookEntry)
-
Field Details
-
AUI_FEATURE_ID
- See Also:
-
-
Constructor Details
-
WebhookService
public WebhookService()
-
-
Method Details
-
getAllAuiFeatures
The function retrieves all AuiFeature objects from the entryManager and returns them as a List.- Returns:
- The method is returning a List of AuiFeature objects.
- Throws:
ApplicationException
-
getAllAuiFeaturesByWebhookId
The function retrieves a list of AuiFeatures that are associated with a specific webhookId.- Parameters:
webhookId- The parameter "webhookId" is a String that represents the ID of a webhook.- Returns:
- The method is returning a list of AuiFeature objects that have a webhookId matching the provided webhookId parameter.
- Throws:
ApplicationException
-
searchWebhooks
public io.jans.orm.model.PagedResult<WebhookEntry> searchWebhooks(io.jans.model.SearchRequest searchRequest) throws ApplicationException The function searches for webhook entries based on the provided search criteria and returns a paged result.- Parameters:
searchRequest- The `searchRequest` parameter is an object of type `SearchRequest`. It contains information about the search criteria and pagination for the webhooks search.- Returns:
- The method is returning a PagedResult object containing a list of WebhookEntry objects.
- Throws:
ApplicationException
-
getWebhookByIds
The function `getWebhookByIds` retrieves a list of `WebhookEntry` objects based on a list of webhook IDs.- Parameters:
ids- A list of webhook IDs to search for.- Returns:
- The method is returning a List of WebhookEntry objects.
-
getWebhooksByFeatureId
-
getAuiFeaturesByIds
The function `getAuiFeaturesByIds` retrieves a list of AuiFeature objects based on a list of IDs.- Parameters:
ids- A list of String values representing the IDs of AuiFeatures to be retrieved.- Returns:
- The method is returning a List of AuiFeature objects.
-
addWebhook
The function adds a webhook entry to a database, assigns it a unique ID, and associates it with Aui features if provided.- Parameters:
webhook- The parameter "webhook" is an object of type WebhookEntry. It represents the webhook entry that needs to be added.- Returns:
- The method is returning a WebhookEntry object.
- Throws:
ApplicationException
-
removeWebhook
The function removes a webhook entry and throws an exception if there is an error.- Parameters:
webhook- The parameter "webhook" is of type WebhookEntry. It represents the webhook entry that needs to be removed.- Throws:
ApplicationException
-
updateWebhook
The function updates a webhook entry, validates the entry, and performs additional operations if necessary.- Parameters:
webhook- The parameter "webhook" is an object of type WebhookEntry. It represents the webhook entry that needs to be updated.- Returns:
- The method is returning a WebhookEntry object.
- Throws:
ApplicationException
-
validateWebhookEntry
- Throws:
ApplicationException
-
triggerEnabledWebhooks
public List<GenericResponse> triggerEnabledWebhooks(Set<String> webhookIds, List<ShortCodeRequest> shortCodes) throws ApplicationException The function triggers enabled webhooks by creating a thread pool, validating each webhook entry, and executing them concurrently.- Parameters:
webhookIds- A set of webhook IDs.- Returns:
- The method is returning a List of Strings.
- Throws:
ApplicationException
-
getRecordMaxCount
public int getRecordMaxCount()
-