Package com.atlassian.bamboo.webhook
Interface WebhookResponseService
-
- All Known Implementing Classes:
DefaultWebhookResponseService
public interface WebhookResponseService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @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.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, String body, int statusCode, com.google.common.collect.Multimap<String,String> headers, VariableSubstitutor variableSubstitutor)
Change state of webhook response entity in DB in case of receiving a response.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.@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.
-
-
-
Method Detail
-
getWebhookResponseDetails
@Nullable WebhookResponseDetails getWebhookResponseDetails(Long webhookResponseId)
Find full description of webhook response associated with webhook response id.- Parameters:
webhookResponseId
- id of webhook response.- Returns:
- a webhook response entity associated with the given webhook response id.
-
findWebhookResponsesForPlanResultKey
@NotNull @NotNull List<WebhookResponse> findWebhookResponsesForPlanResultKey(String planResultKey)
Find short descriptions of webhook responses associated with build key.- Parameters:
planResultKey
-- Returns:
- a list of all webhook responses (DTO not full entities) associated with the given plan result key.
-
findWebhookResponsesForDeploymentResultId
@NotNull @NotNull List<WebhookResponse> findWebhookResponsesForDeploymentResultId(Long deploymentResultId)
Find short descriptions of webhook responses associated with deployment result id.- Parameters:
deploymentResultId
-- Returns:
- a list of all webhook responses (DTO not full entities) associated with the given deployment result id.
-
registerWebhookSend
@NotNull @NotNull Long registerWebhookSend(WebhookToSend webhookToSend)
Save a pending webhook to DB.- Parameters:
webhookToSend
- sent webhook- Returns:
- id of created webhook response entity.
-
countWebhookResponsesByDeploymentResultId
@NotNull @NotNull Long countWebhookResponsesByDeploymentResultId(Long deploymentResultId)
Count all webhook responses in deployment result.- Parameters:
deploymentResultId
-- Returns:
- a number of webhook response entities associated with deployment result id.
-
registerWebhookResponse
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.- Parameters:
webhookResponseId
- id of webhook response entity.webhookResponse
- response of returned webhook.variableSubstitutor
- variable substitutor to use for hide sensitive information.
-
registerWebhookResponse
void registerWebhookResponse(Long webhookResponseId, String body, int statusCode, com.google.common.collect.Multimap<String,String> headers, VariableSubstitutor variableSubstitutor)
Change state of webhook response entity in DB in case of receiving a response.- 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
void registerWebhookPrepareError(WebhookToSend webhookToSend, String message)
Save a webhook to DB which was not send due to an error.- Parameters:
webhookToSend
- webhook which was trying to be sent.message
- error message.
-
registerWebhookSentException
void registerWebhookSentException(Long webhookResponseId, Throwable throwable, VariableSubstitutor variableSubstitutor)
Change state of webhook response entity in DB in case of exception while waiting for response.- Parameters:
webhookResponseId
- id of webhook response entity.throwable
- exception thrown while waiting for response.variableSubstitutor
- variable substitutor to use for hide sensitive information.
-
removeWebhookResponsesForChainResult
void removeWebhookResponsesForChainResult(String planResultKey)
Remove webhook responses associated with given plan result key from DB when deleting build result.- Parameters:
planResultKey
-
-
removeWebhookResponseForPlan
void removeWebhookResponseForPlan(String planKey)
Remove webhook responses associated with given plan key from DB when deleting plan.- Parameters:
planKey
-
-
removeWebhookResponsesForDeploymentResult
void removeWebhookResponsesForDeploymentResult(Long deploymentResultId)
Remove webhook responses associated with given deployment result id from DB when deleting deployment result.- Parameters:
deploymentResultId
-
-
-