Package org.iplass.mtp.webhook.endpoint
Class WebhookEndpoint
java.lang.Object
org.iplass.mtp.webhook.endpoint.WebhookEndpoint
public class WebhookEndpoint
extends java.lang.Object
The class representing the destination of Webhook.
-
Constructor Summary
Constructors Constructor Description WebhookEndpoint(java.lang.String url)Create the WebhookEndpoint that can be set to Webhook.WebhookEndpoint(java.lang.String url, java.lang.String hmacKey)Create the WebhookEndpoint that can be set to Webhook.WebhookEndpoint(java.lang.String url, WebhookAuthenticationType headerAuthorizationType, java.lang.String headerAuthorizationContent)Create the WebhookEndpoint that can be set to Webhook.WebhookEndpoint(java.lang.String url, WebhookAuthenticationType headerAuthorizationType, java.lang.String headerAuthorizationContent, java.lang.String hmacKey)Create the WebhookEndpoint that can be set to Webhook. -
Method Summary
Modifier and Type Method Description java.lang.StringgetHeaderAuthCustomTypeName()Set the custom headers.java.lang.StringgetHeaderAuthorizationContent()Get the content from Authrization header.If it is BASIC, it will be in the format of username:password.WebhookAuthenticationTypegetHeaderAuthorizationType()Get the type used in Authorization header.java.lang.StringgetHmacHashHeader()Get the header name for HMAC Verification.java.lang.StringgetHmacKey()Get the HMAC secret key.java.lang.StringgetUrl()Get the Url.voidsetBasicAuthorization(java.lang.String userName, java.lang.String password)Set the BASIC Authorization.voidsetBearerAuthorization(java.lang.String bearerToken)Set the BEARER Authorization.voidsetCustomAuthorization(java.lang.String schemeName, java.lang.String customToken)Set the Custom Authorization.voidsetHeaderAuthCustomTypeName(java.lang.String headerAuthCustomTypeName)Set the custom Token Scheme.voidsetHeaderAuthorizationContent(java.lang.String headerAuthorizationContent)Set the content from Authrization header.If it is BASIC, it Should be in the format of username:password.voidsetHeaderAuthorizationType(WebhookAuthenticationType headerAuthorizationType)Set the type used in Authorization header.voidsetHmacHashHeader(java.lang.String hmacHashHeader)Set the header name for HMAC Verification.voidsetHmacKey(java.lang.String hmacKey)Set the HMAC secret key.voidsetUrl(java.lang.String url)Set the custom headers.
-
Constructor Details
-
WebhookEndpoint
public WebhookEndpoint(java.lang.String url)Create the WebhookEndpoint that can be set to Webhook.- Parameters:
url- The URL of the destination
-
WebhookEndpoint
public WebhookEndpoint(java.lang.String url, java.lang.String hmacKey)Create the WebhookEndpoint that can be set to Webhook.- Parameters:
url- The URL of the destinationhmacKey- The secret key to generate HMAC hashes
-
WebhookEndpoint
public WebhookEndpoint(java.lang.String url, WebhookAuthenticationType headerAuthorizationType, java.lang.String headerAuthorizationContent)Create the WebhookEndpoint that can be set to Webhook.- Parameters:
url- The URL of the destinationheaderAuthorizationType- Type of the content in Authorization HeaderheaderAuthorizationContent- Content in Authorization Header, if it is BASIC, it should be a string in format of username:password
-
WebhookEndpoint
public WebhookEndpoint(java.lang.String url, WebhookAuthenticationType headerAuthorizationType, java.lang.String headerAuthorizationContent, java.lang.String hmacKey)Create the WebhookEndpoint that can be set to Webhook.- Parameters:
url- The URL of the destinationheaderAuthorizationType- Type of the content in Authorization HeaderheaderAuthorizationContent- Content in Authorization Header, if it is BASIC, it should be a string in format of username:passwordhmacKey- The secret key to generate HMAC hashes
-
-
Method Details
-
setBasicAuthorization
public void setBasicAuthorization(java.lang.String userName, java.lang.String password)Set the BASIC Authorization. the existing Authorization content will be dropped.- Parameters:
userName- User namepassword- Password
-
setBearerAuthorization
public void setBearerAuthorization(java.lang.String bearerToken)Set the BEARER Authorization. the existing Authorization content will be dropped.- Parameters:
bearerToken- BEARER token
-
setCustomAuthorization
public void setCustomAuthorization(java.lang.String schemeName, java.lang.String customToken)Set the Custom Authorization. the existing Authorization content will be dropped.- Parameters:
schemeName- The scheme name to be used in Authorization headercustomToken- Custom Token
-
getUrl
public java.lang.String getUrl()Get the Url. -
setUrl
public void setUrl(java.lang.String url)Set the custom headers.- Parameters:
url- URL
-
getHeaderAuthorizationType
Get the type used in Authorization header. -
setHeaderAuthorizationType
Set the type used in Authorization header.- Parameters:
headerAuthorizationType- Type
-
getHeaderAuthorizationContent
public java.lang.String getHeaderAuthorizationContent()Get the content from Authrization header.If it is BASIC, it will be in the format of username:password. -
setHeaderAuthorizationContent
public void setHeaderAuthorizationContent(java.lang.String headerAuthorizationContent)Set the content from Authrization header.If it is BASIC, it Should be in the format of username:password.- Parameters:
headerAuthorizationContent- Content
-
getHmacKey
public java.lang.String getHmacKey()Get the HMAC secret key. -
setHmacKey
public void setHmacKey(java.lang.String hmacKey)Set the HMAC secret key.- Parameters:
hmacKey- Secret key
-
getHmacHashHeader
public java.lang.String getHmacHashHeader()Get the header name for HMAC Verification. -
setHmacHashHeader
public void setHmacHashHeader(java.lang.String hmacHashHeader)Set the header name for HMAC Verification.- Parameters:
hmacHashHeader- Header name
-
getHeaderAuthCustomTypeName
public java.lang.String getHeaderAuthCustomTypeName()Set the custom headers. -
setHeaderAuthCustomTypeName
public void setHeaderAuthCustomTypeName(java.lang.String headerAuthCustomTypeName)Set the custom Token Scheme. It is the "BASIC" part of [Authorization: BASIC "username:password"]- Parameters:
headerAuthCustomTypeName- The scheme name to be used in Authorization header
-