Package org.iplass.mtp.webhook
Class Webhook
java.lang.Object
org.iplass.mtp.webhook.Webhook
Representing the Webhook to be dispatched.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHeader(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.voidsetContentType(String contentType) Set the content Type of the dispatched content.voidsetEndpoint(WebhookEndpoint endpoint) Set the Destination.voidsetHeaders(List<WebhookHeader> headers) Set the custom headers.voidsetHttpMethod(String httpMethod) Specify the HTTP connection method, if undefined, POST will be used.voidsetPathAndQuery(String pathAndQuery) Set the pathAndQuery.voidsetPayloadContent(String payloadContent) Set the payload content.voidsetResponseHandler(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
-