Package com.atlassian.bamboo.webhook
Class DefaultWebhookResponseService
java.lang.Object
com.atlassian.bamboo.webhook.DefaultWebhookResponseService
- All Implemented Interfaces:
WebhookResponseService
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Long
countWebhookResponsesByDeploymentResultId
(Long deploymentResultId) Count all webhook responses in deployment result.@NotNull List<WebhookResponse>
findWebhookResponsesForDeploymentResultId
(Long deploymentResultId) Find short descriptions of webhook responses associated with deployment result id.@NotNull List<WebhookResponse>
findWebhookResponsesForPlanResultKey
(String planResultKey) Find short descriptions of webhook responses associated with build key.getWebhookResponseDetails
(Long webhookResponseId) Find full description of webhook response associated with webhook response id.void
registerWebhookPrepareError
(WebhookToSend webhookToSend, String message) Save a webhook to DB which was not send due to an error.void
registerWebhookResponse
(Long webhookResponseId, String body, int statusCode, Multimap<String, String> headers, VariableSubstitutor variableSubstitutor) Change state of webhook response entity in DB in case of receiving a response.@NotNull Long
registerWebhookSend
(WebhookToSend webhookToSend) Save a pending webhook to DB.void
registerWebhookSentException
(Long webhookResponseId, Throwable throwable, VariableSubstitutor variableSubstitutor) Change state of webhook response entity in DB in case of exception while waiting for response.void
removeWebhookResponseForPlan
(String planKey) Remove webhook responses associated with given plan key from DB when deleting plan.void
removeWebhookResponsesForChainResult
(String planResultKey) Remove webhook responses associated with given plan result key from DB when deleting build result.void
removeWebhookResponsesForDeploymentResult
(Long deploymentResultId) Remove webhook responses associated with given deployment result id from DB when deleting deployment result.
-
Constructor Details
-
DefaultWebhookResponseService
-
-
Method Details
-
getWebhookResponseDetails
Description copied from interface:WebhookResponseService
Find full description of webhook response associated with webhook response id.- Specified by:
getWebhookResponseDetails
in interfaceWebhookResponseService
- Parameters:
webhookResponseId
- id of webhook response.- Returns:
- a webhook response entity associated with the given webhook response id.
-
findWebhookResponsesForDeploymentResultId
@NotNull public @NotNull List<WebhookResponse> findWebhookResponsesForDeploymentResultId(Long deploymentResultId) Description copied from interface:WebhookResponseService
Find short descriptions of webhook responses associated with deployment result id.- Specified by:
findWebhookResponsesForDeploymentResultId
in interfaceWebhookResponseService
- Returns:
- a list of all webhook responses (DTO not full entities) associated with the given deployment result id.
-
findWebhookResponsesForPlanResultKey
@NotNull public @NotNull List<WebhookResponse> findWebhookResponsesForPlanResultKey(String planResultKey) Description copied from interface:WebhookResponseService
Find short descriptions of webhook responses associated with build key.- Specified by:
findWebhookResponsesForPlanResultKey
in interfaceWebhookResponseService
- Returns:
- a list of all webhook responses (DTO not full entities) associated with the given plan result key.
-
registerWebhookSend
Description copied from interface:WebhookResponseService
Save a pending webhook to DB.- Specified by:
registerWebhookSend
in interfaceWebhookResponseService
- Parameters:
webhookToSend
- sent webhook- Returns:
- id of created webhook response entity.
-
countWebhookResponsesByDeploymentResultId
Description copied from interface:WebhookResponseService
Count all webhook responses in deployment result.- Specified by:
countWebhookResponsesByDeploymentResultId
in interfaceWebhookResponseService
- Returns:
- a number of webhook response entities associated with deployment result id.
-
registerWebhookResponse
public void registerWebhookResponse(Long webhookResponseId, String body, int statusCode, Multimap<String, String> headers, VariableSubstitutor variableSubstitutor) Description copied from interface:WebhookResponseService
Change state of webhook response entity in DB in case of receiving a response.- Specified by:
registerWebhookResponse
in interfaceWebhookResponseService
- Parameters:
webhookResponseId
- id of webhook response entity.body
- response body of returned webhook.statusCode
- response status code of returned webhook.headers
- response headers of returned webhook.variableSubstitutor
- variable substitutor to use for hide sensitive information.
-
registerWebhookPrepareError
Description copied from interface:WebhookResponseService
Save a webhook to DB which was not send due to an error.- Specified by:
registerWebhookPrepareError
in interfaceWebhookResponseService
- Parameters:
webhookToSend
- webhook which was trying to be sent.message
- error message.
-
registerWebhookSentException
public void registerWebhookSentException(Long webhookResponseId, Throwable throwable, VariableSubstitutor variableSubstitutor) Description copied from interface:WebhookResponseService
Change state of webhook response entity in DB in case of exception while waiting for response.- Specified by:
registerWebhookSentException
in interfaceWebhookResponseService
- Parameters:
webhookResponseId
- id of webhook response entity.throwable
- exception thrown while waiting for response.variableSubstitutor
- variable substitutor to use for hide sensitive information.
-
removeWebhookResponsesForChainResult
Description copied from interface:WebhookResponseService
Remove webhook responses associated with given plan result key from DB when deleting build result.- Specified by:
removeWebhookResponsesForChainResult
in interfaceWebhookResponseService
-
removeWebhookResponseForPlan
Description copied from interface:WebhookResponseService
Remove webhook responses associated with given plan key from DB when deleting plan.- Specified by:
removeWebhookResponseForPlan
in interfaceWebhookResponseService
-
removeWebhookResponsesForDeploymentResult
Description copied from interface:WebhookResponseService
Remove webhook responses associated with given deployment result id from DB when deleting deployment result.- Specified by:
removeWebhookResponsesForDeploymentResult
in interfaceWebhookResponseService
-