public class DefaultWebhookResponseService extends Object implements WebhookResponseService
Modifier and Type | Class and Description |
---|---|
static class |
DefaultWebhookResponseService.WebhookToSave |
Constructor and Description |
---|
DefaultWebhookResponseService(WebhookResponseDao webhookResponseDao) |
Modifier and Type | Method and Description |
---|---|
Long |
countWebhookResponsesByDeploymentResultId(Long deploymentResultId)
Count all webhook responses in deployment result.
|
List<WebhookResponse> |
findWebhookResponsesForDeploymentResultId(Long deploymentResultId)
Find short descriptions of webhook responses associated with deployment result id.
|
List<WebhookResponse> |
findWebhookResponsesForPlanResultKey(String planResultKey)
Find short descriptions of webhook responses associated with build key.
|
WebhookResponseDetails |
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,
org.springframework.http.ResponseEntity<String> webhookResponse,
VariableSubstitutor variableSubstitutor)
Change state of webhook response entity in DB in case of receiving a response.
|
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.
|
@Autowired public DefaultWebhookResponseService(WebhookResponseDao webhookResponseDao)
public WebhookResponseDetails getWebhookResponseDetails(Long webhookResponseId)
WebhookResponseService
getWebhookResponseDetails
in interface WebhookResponseService
webhookResponseId
- id of webhook response.@NotNull public List<WebhookResponse> findWebhookResponsesForDeploymentResultId(Long deploymentResultId)
WebhookResponseService
findWebhookResponsesForDeploymentResultId
in interface WebhookResponseService
@NotNull public List<WebhookResponse> findWebhookResponsesForPlanResultKey(String planResultKey)
WebhookResponseService
findWebhookResponsesForPlanResultKey
in interface WebhookResponseService
@NotNull public Long registerWebhookSend(WebhookToSend webhookToSend)
WebhookResponseService
registerWebhookSend
in interface WebhookResponseService
webhookToSend
- sent webhook@NotNull public Long countWebhookResponsesByDeploymentResultId(Long deploymentResultId)
WebhookResponseService
countWebhookResponsesByDeploymentResultId
in interface WebhookResponseService
public void registerWebhookResponse(Long webhookResponseId, org.springframework.http.ResponseEntity<String> webhookResponse, VariableSubstitutor variableSubstitutor)
WebhookResponseService
registerWebhookResponse
in interface WebhookResponseService
webhookResponseId
- id of webhook response entity.webhookResponse
- response of returned webhook.variableSubstitutor
- variable substitutor to use for hide sensitive information.public void registerWebhookPrepareError(WebhookToSend webhookToSend, String message)
WebhookResponseService
registerWebhookPrepareError
in interface WebhookResponseService
webhookToSend
- webhook which was trying to be sent.message
- error message.public void registerWebhookSentException(Long webhookResponseId, Throwable throwable, VariableSubstitutor variableSubstitutor)
WebhookResponseService
registerWebhookSentException
in interface WebhookResponseService
webhookResponseId
- id of webhook response entity.throwable
- exception thrown while waiting for response.variableSubstitutor
- variable substitutor to use for hide sensitive information.public void removeWebhookResponsesForChainResult(String planResultKey)
WebhookResponseService
removeWebhookResponsesForChainResult
in interface WebhookResponseService
public void removeWebhookResponseForPlan(String planKey)
WebhookResponseService
removeWebhookResponseForPlan
in interface WebhookResponseService
public void removeWebhookResponsesForDeploymentResult(Long deploymentResultId)
WebhookResponseService
removeWebhookResponsesForDeploymentResult
in interface WebhookResponseService
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.