Package org.iplass.mtp.webhook
Class Webhook
java.lang.Object
org.iplass.mtp.webhook.Webhook
Representing the Webhook to be dispatched.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHeader
(WebhookHeader header) Add additional custom headers.Get the content Type.Get the Destination class WebhookEndpoint object.Get the custom headers.Get the name of the HTTP connection method in use.Get the path and query.Get the payload content.Get the response handler object.void
setContentType
(String contentType) Set the content Type of the dispatched content.void
setEndpoint
(WebhookEndpoint endpoint) Set the Destination.void
setHeaders
(List<WebhookHeader> headers) Set the custom headers.void
setHttpMethod
(String httpMethod) Specify the HTTP connection method, if undefined, POST will be used.void
setPathAndQuery
(String pathAndQuery) Set the pathAndQuery.void
setPayloadContent
(String payloadContent) Set the payload content.void
setResponseHandler
(WebhookResponseHandler responseHandler) Set the response handler object.
-
Constructor Details
-
Webhook
public Webhook()
-
-
Method Details
-
getHeaders
Get the custom headers. -
setHeaders
Set the custom headers.- Parameters:
headers
- List of WebhookHeader
-
addHeader
Add additional custom headers.- Parameters:
headers
- WebhookHeader object
-
getHttpMethod
Get the name of the HTTP connection method in use. -
setHttpMethod
Specify the HTTP connection method, if undefined, POST will be used.- Parameters:
httpMethod
- Method name in uppercase. i.e. POST,GET
-
getContentType
Get the content Type. -
setContentType
Set the content Type of the dispatched content.- Parameters:
contentType
- The value for Content-Type Header
-
getPathAndQuery
Get the path and query. -
setPathAndQuery
Set the pathAndQuery. Beware to put "?" appropriately.- Parameters:
pathAndQuery
- Query content
-
getResponseHandler
Get the response handler object. -
setResponseHandler
Set the response handler object.- Parameters:
responseHandler
- WebhookResponseHandler object
-
getPayloadContent
Get the payload content. -
setPayloadContent
Set the payload content.- Parameters:
payloadContent
- The payload with the format indicated in Content-Type
-
getEndpoint
Get the Destination class WebhookEndpoint object. -
setEndpoint
Set the Destination.- Parameters:
endpoint
- WebhookEndpoint object
-