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.String getHeaderAuthCustomTypeName()
    Set the custom headers.
    java.lang.String getHeaderAuthorizationContent()
    Get the content from Authrization header.If it is BASIC, it will be in the format of username:password.
    WebhookAuthenticationType getHeaderAuthorizationType()
    Get the type used in Authorization header.
    java.lang.String getHmacHashHeader()
    Get the header name for HMAC Verification.
    java.lang.String getHmacKey()
    Get the HMAC secret key.
    java.lang.String getUrl()
    Get the Url.
    void setBasicAuthorization​(java.lang.String userName, java.lang.String password)
    Set the BASIC Authorization.
    void setBearerAuthorization​(java.lang.String bearerToken)
    Set the BEARER Authorization.
    void setCustomAuthorization​(java.lang.String schemeName, java.lang.String customToken)
    Set the Custom Authorization.
    void setHeaderAuthCustomTypeName​(java.lang.String headerAuthCustomTypeName)
    Set the custom Token Scheme.
    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.
    void setHeaderAuthorizationType​(WebhookAuthenticationType headerAuthorizationType)
    Set the type used in Authorization header.
    void setHmacHashHeader​(java.lang.String hmacHashHeader)
    Set the header name for HMAC Verification.
    void setHmacKey​(java.lang.String hmacKey)
    Set the HMAC secret key.
    void setUrl​(java.lang.String url)
    Set the custom headers.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 destination
      hmacKey - 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 destination
      headerAuthorizationType - Type of the content in Authorization Header
      headerAuthorizationContent - 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 destination
      headerAuthorizationType - Type of the content in Authorization Header
      headerAuthorizationContent - Content in Authorization Header, if it is BASIC, it should be a string in format of username:password
      hmacKey - 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 name
      password - 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 header
      customToken - 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

      public WebhookAuthenticationType getHeaderAuthorizationType()
      Get the type used in Authorization header.
    • setHeaderAuthorizationType

      public void setHeaderAuthorizationType​(WebhookAuthenticationType headerAuthorizationType)
      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