Package org.iplass.mtp.webhook.endpoint
Class WebhookEndpoint
java.lang.Object
org.iplass.mtp.webhook.endpoint.WebhookEndpoint
The class representing the destination of Webhook.
-
Constructor Summary
ConstructorDescriptionWebhookEndpoint
(String url) Create the WebhookEndpoint that can be set to Webhook.WebhookEndpoint
(String url, String hmacKey) Create the WebhookEndpoint that can be set to Webhook.WebhookEndpoint
(String url, WebhookAuthenticationType headerAuthorizationType, String headerAuthorizationContent) Create the WebhookEndpoint that can be set to Webhook.WebhookEndpoint
(String url, WebhookAuthenticationType headerAuthorizationType, String headerAuthorizationContent, String hmacKey) Create the WebhookEndpoint that can be set to Webhook. -
Method Summary
Modifier and TypeMethodDescriptionSet the custom headers.Get the content from Authrization header.If it is BASIC, it will be in the format of username:password.Get the type used in Authorization header.Get the header name for HMAC Verification.Get the HMAC secret key.getUrl()
Get the Url.void
setBasicAuthorization
(String userName, String password) Set the BASIC Authorization.void
setBearerAuthorization
(String bearerToken) Set the BEARER Authorization.void
setCustomAuthorization
(String schemeName, String customToken) Set the Custom Authorization.void
setHeaderAuthCustomTypeName
(String headerAuthCustomTypeName) Set the custom Token Scheme.void
setHeaderAuthorizationContent
(String headerAuthorizationContent) Set the content from Authrization header.If it is BASIC, it Should be in the format of username:password.void
setHeaderAuthorizationType
(WebhookAuthenticationType headerAuthorizationType) Set the type used in Authorization header.void
setHmacHashHeader
(String hmacHashHeader) Set the header name for HMAC Verification.void
setHmacKey
(String hmacKey) Set the HMAC secret key.void
Set the custom headers.
-
Constructor Details
-
WebhookEndpoint
Create the WebhookEndpoint that can be set to Webhook.- Parameters:
url
- The URL of the destination
-
WebhookEndpoint
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(String url, WebhookAuthenticationType headerAuthorizationType, 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(String url, WebhookAuthenticationType headerAuthorizationType, String headerAuthorizationContent, 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
Set the BASIC Authorization. the existing Authorization content will be dropped.- Parameters:
userName
- User namepassword
- Password
-
setBearerAuthorization
Set the BEARER Authorization. the existing Authorization content will be dropped.- Parameters:
bearerToken
- BEARER token
-
setCustomAuthorization
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
Get the Url. -
setUrl
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
Get the content from Authrization header.If it is BASIC, it will be in the format of username:password. -
setHeaderAuthorizationContent
Set the content from Authrization header.If it is BASIC, it Should be in the format of username:password.- Parameters:
headerAuthorizationContent
- Content
-
getHmacKey
Get the HMAC secret key. -
setHmacKey
Set the HMAC secret key.- Parameters:
hmacKey
- Secret key
-
getHmacHashHeader
Get the header name for HMAC Verification. -
setHmacHashHeader
Set the header name for HMAC Verification.- Parameters:
hmacHashHeader
- Header name
-
getHeaderAuthCustomTypeName
Set the custom headers. -
setHeaderAuthCustomTypeName
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
-