Package org.iplass.mtp.webhook
Class Webhook
java.lang.Object
org.iplass.mtp.webhook.Webhook
public class Webhook
extends java.lang.Object
Representing the Webhook to be dispatched.
-
Constructor Summary
Constructors Constructor Description Webhook() -
Method Summary
Modifier and Type Method Description voidaddHeader(WebhookHeader header)Add additional custom headers.java.lang.StringgetContentType()Get the content Type.WebhookEndpointgetEndpoint()Get the Destination class WebhookEndpoint object.java.util.List<WebhookHeader>getHeaders()Get the custom headers.java.lang.StringgetHttpMethod()Get the name of the HTTP connection method in use.java.lang.StringgetPathAndQuery()Get the path and query.java.lang.StringgetPayloadContent()Get the payload content.WebhookResponseHandlergetResponseHandler()Get the response handler object.voidsetContentType(java.lang.String contentType)Set the content Type of the dispatched content.voidsetEndpoint(WebhookEndpoint endpoint)Set the Destination.voidsetHeaders(java.util.List<WebhookHeader> headers)Set the custom headers.voidsetHttpMethod(java.lang.String httpMethod)Specify the HTTP connection method, if undefined, POST will be used.voidsetPathAndQuery(java.lang.String pathAndQuery)Set the pathAndQuery.voidsetPayloadContent(java.lang.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
public java.lang.String getHttpMethod()Get the name of the HTTP connection method in use. -
setHttpMethod
public void setHttpMethod(java.lang.String httpMethod)Specify the HTTP connection method, if undefined, POST will be used.- Parameters:
httpMethod- Method name in uppercase. i.e. POST,GET
-
getContentType
public java.lang.String getContentType()Get the content Type. -
setContentType
public void setContentType(java.lang.String contentType)Set the content Type of the dispatched content.- Parameters:
contentType- The value for Content-Type Header
-
getPathAndQuery
public java.lang.String getPathAndQuery()Get the path and query. -
setPathAndQuery
public void setPathAndQuery(java.lang.String pathAndQuery)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
public java.lang.String getPayloadContent()Get the payload content. -
setPayloadContent
public void setPayloadContent(java.lang.String payloadContent)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
-