Class WebhookConfiguration

java.lang.Object
org.apache.camel.component.webhook.WebhookConfiguration
All Implemented Interfaces:
Cloneable

@UriParams public class WebhookConfiguration extends Object implements Cloneable
Configuration class for the webhook component.
  • Constructor Details

    • WebhookConfiguration

      public WebhookConfiguration()
  • Method Details

    • getWebhookComponentName

      public String getWebhookComponentName()
    • copy

      public WebhookConfiguration copy()
      Returns a copy of this configuration
    • storeConfiguration

      public void storeConfiguration(org.apache.camel.spi.RestConfiguration restConfiguration)
    • retrieveRestConfiguration

      public org.apache.camel.spi.RestConfiguration retrieveRestConfiguration()
    • computeFullExternalUrl

      public String computeFullExternalUrl() throws UnknownHostException
      Computes the external URL of the webhook as seen by the remote webhook provider.
      Returns:
      the webhook external URL
      Throws:
      UnknownHostException
    • computeFullPath

      public String computeFullPath(boolean external)
      Computes the path part of the webhook.
      Parameters:
      external - indicates if it's the path seen by the external provider or the internal one.
      Returns:
      the webhook full path
    • computeServerUriPrefix

      public String computeServerUriPrefix() throws UnknownHostException
      Computes the URL of the webhook that should be used to bind the REST endpoint locally.
      Throws:
      UnknownHostException
    • computeDefaultPath

      public static String computeDefaultPath(String uri)
      A default path is computed for the webhook if not provided by the user. It uses a hash of the delegate endpoint in order for it to be reproducible. This is not random on purpose.
    • getEndpointUri

      public String getEndpointUri()
    • setEndpointUri

      public void setEndpointUri(String endpointUri)
      The delegate uri. Must belong to a component that supports webhooks.
    • setWebhookComponentName

      public void setWebhookComponentName(String webhookComponentName)
      The Camel Rest component to use for the REST transport, such as netty-http.
    • getWebhookExternalUrl

      public String getWebhookExternalUrl()
    • setWebhookExternalUrl

      public void setWebhookExternalUrl(String webhookExternalUrl)
      The URL of the current service as seen by the webhook provider
    • getWebhookBasePath

      public String getWebhookBasePath()
    • setWebhookBasePath

      public void setWebhookBasePath(String webhookBasePath)
      The first (base) path element where the webhook will be exposed. It's a good practice to set it to a random string, so that it cannot be guessed by unauthorized parties.
    • getWebhookPath

      public String getWebhookPath()
    • setWebhookPath

      public void setWebhookPath(String webhookPath)
      The path where the webhook endpoint will be exposed (relative to basePath, if any)
    • isWebhookAutoRegister

      public boolean isWebhookAutoRegister()
    • setWebhookAutoRegister

      public void setWebhookAutoRegister(boolean webhookAutoRegister)
      Automatically register the webhook at startup and unregister it on shutdown.