Class WebhookConfiguration
java.lang.Object
org.apache.camel.component.webhook.WebhookConfiguration
- All Implemented Interfaces:
Cloneable
Configuration class for the webhook component.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomputeDefaultPath(String uri) A default path is computed for the webhook if not provided by the user.Computes the external URL of the webhook as seen by the remote webhook provider.computeFullPath(boolean external) Computes the path part of the webhook.Computes the URL of the webhook that should be used to bind the REST endpoint locally.copy()Returns a copy of this configurationbooleanorg.apache.camel.spi.RestConfigurationvoidsetEndpointUri(String endpointUri) The delegate uri.voidsetWebhookAutoRegister(boolean webhookAutoRegister) Automatically register the webhook at startup and unregister it on shutdown.voidsetWebhookBasePath(String webhookBasePath) The first (base) path element where the webhook will be exposed.voidsetWebhookComponentName(String webhookComponentName) The Camel Rest component to use for the REST transport, such as netty-http.voidsetWebhookExternalUrl(String webhookExternalUrl) The URL of the current service as seen by the webhook providervoidsetWebhookPath(String webhookPath) The path where the webhook endpoint will be exposed (relative to basePath, if any)voidstoreConfiguration(org.apache.camel.spi.RestConfiguration restConfiguration)
-
Constructor Details
-
WebhookConfiguration
public WebhookConfiguration()
-
-
Method Details
-
getWebhookComponentName
-
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
Computes the external URL of the webhook as seen by the remote webhook provider.- Returns:
- the webhook external URL
- Throws:
UnknownHostException
-
computeFullPath
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
Computes the URL of the webhook that should be used to bind the REST endpoint locally.- Throws:
UnknownHostException
-
computeDefaultPath
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
-
setEndpointUri
The delegate uri. Must belong to a component that supports webhooks. -
setWebhookComponentName
The Camel Rest component to use for the REST transport, such as netty-http. -
getWebhookExternalUrl
-
setWebhookExternalUrl
The URL of the current service as seen by the webhook provider -
getWebhookBasePath
-
setWebhookBasePath
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
-
setWebhookPath
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.
-