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
ConstructorsConstructorDescriptionWebhookEndpoint(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.voidsetBasicAuthorization(String userName, String password) Set the BASIC Authorization.voidsetBearerAuthorization(String bearerToken) Set the BEARER Authorization.voidsetCustomAuthorization(String schemeName, String customToken) Set the Custom Authorization.voidsetHeaderAuthCustomTypeName(String headerAuthCustomTypeName) Set the custom Token Scheme.voidsetHeaderAuthorizationContent(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(String hmacHashHeader) Set the header name for HMAC Verification.voidsetHmacKey(String hmacKey) Set the HMAC secret key.voidSet 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
-