Package org.apache.camel.catalog
Interface CamelCatalog
- All Known Implementing Classes:
DefaultCamelCatalog
public interface CamelCatalog
Catalog of components, data formats, models (EIPs), languages, and more from this Apache Camel release.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponent
(String name, String className) Adds a 3rd party component to this catalog.void
addComponent
(String name, String className, String jsonSchema) Adds a 3rd party component to this catalog.void
addDataFormat
(String name, String className) Adds a 3rd party data format to this catalog.void
addDataFormat
(String name, String className, String jsonSchema) Adds a 3rd party data format to this catalog.asEndpointUri
(String scheme, Map<String, String> properties, boolean encode) Creates an endpoint uri in Java style from the information from the propertiesasEndpointUriXml
(String scheme, Map<String, String> properties, boolean encode) Creates an endpoint uri in XML style from the information from the propertiesList<org.apache.camel.tooling.model.ReleaseModel>
Load all Camel Quarkus releases from catalogList<org.apache.camel.tooling.model.ReleaseModel>
Load all Camel releases (core and spring-boot) from catalogcomponentJSonSchema
(String name) Returns the component information as JSON format.org.apache.camel.tooling.model.ComponentModel
componentModel
(String name) dataFormatJSonSchema
(String name) Returns the data format information as JSON format.org.apache.camel.tooling.model.DataFormatModel
dataFormatModel
(String name) org.apache.camel.tooling.model.EipModel
void
Enables caching of the resources which makes the catalog faster, but keeps data in memory during caching.Returns the component name from the given endpoint uriParses the endpoint uri and constructs a key/value properties of only the lenient properties (eg custom options)endpointProperties
(String uri) Parses the endpoint uri and constructs a key/value properties of each optionFind all the unique label names all the components are using.Find all the component names from the Camel catalogfindComponentNames
(String filter) Find all the component names from the Camel catalog that matches the labelFind all the unique label names all the data formats are using.Find all the data format names from the Camel catalogfindDataFormatNames
(String filter) Find all the data format names from the Camel catalog that matches the labelFind all the unique label names all the languages are using.Find all the language names from the Camel catalogfindLanguageNames
(String filter) Find all the language names from the Camel catalog that matches the labelFind all the unique label names all the models are using.Find all the model names from the Camel catalogfindModelNames
(String filter) Find all the model names from the Camel catalog that matches the labelFind all the unique label names all the other (miscellaneous) are using.Find all the other (miscellaneous) names from the Camel catalogfindOtherNames
(String filter) Find all the other (miscellaneous) names from the Camel catalog that matches the labelThe version of this Camel Catalogorg.apache.camel.catalog.JSonSchemaResolver
Returns theJSonSchemaResolver
used by this catalog.Gets the current loaded Camel version used by the catalog.Gets theRuntimeProvider
in use.Gets the current loaded runtime provider version used by the catalog.org.apache.camel.catalog.SuggestionStrategy
Gets theSuggestionStrategy
in useGets theVersionManager
in useboolean
Whether caching has been enabled.languageJSonSchema
(String name) Returns the language information as JSON format.org.apache.camel.tooling.model.LanguageModel
languageModel
(String name) Lists all the components summary details in JSonLists all the data formats summary details in JSonLists all the languages summary details in JSonLists all the models (EIPs) summary details in JSonLists all the others (miscellaneous) summary details in JSonloadResource
(String kind, String name) Load resource from catalog classpathboolean
loadRuntimeProviderVersion
(String groupId, String artifactId, String version) Attempt to load the runtime provider version to be used by the catalog.boolean
loadVersion
(String version) Attempt to load the Camel version to be used by the catalog.Returns the camel-main json schemaorg.apache.camel.tooling.model.MainModel
default org.apache.camel.tooling.model.BaseModel<?>
Lookup the model for the given kind and nameorg.apache.camel.tooling.model.ArtifactModel<?>
modelFromMavenGAV
(String groupId, String artifactId, String version) Lookup the model for the given Maven GAVmodelJSonSchema
(String name) Returns the model information as JSON format.otherJSonSchema
(String name) Returns the other (miscellaneous) information as JSON format.org.apache.camel.tooling.model.OtherModel
otherModel
(String name) void
setJSonSchemaResolver
(org.apache.camel.catalog.JSonSchemaResolver resolver) To use a customJSonSchemaResolver
with this catalog.void
setRuntimeProvider
(RuntimeProvider provider) To plugin a customRuntimeProvider
that amends the catalog to only include information that is supported on the runtime.void
setSuggestionStrategy
(org.apache.camel.catalog.SuggestionStrategy suggestionStrategy) To plugin a customSuggestionStrategy
to provide suggestion for unknown optionsvoid
setVersionManager
(VersionManager versionManager) To plugin a customVersionManager
to load other versions of Camel the catalog should use.Returns the Camel Spring XML schemaReports a summary what the catalog contains in JSonorg.apache.camel.catalog.ConfigurationPropertiesValidationResult
Parses and validates the configuration propertyorg.apache.camel.catalog.EndpointValidationResult
Parses and validates the endpoint uri and constructs a key/value properties of each option.org.apache.camel.catalog.EndpointValidationResult
validateEndpointProperties
(String uri, boolean ignoreLenientProperties) Parses and validates the endpoint uri and constructs a key/value properties of each option.org.apache.camel.catalog.EndpointValidationResult
validateEndpointProperties
(String uri, boolean ignoreLenientProperties, boolean consumerOnly, boolean producerOnly) Parses and validates the endpoint uri and constructs a key/value properties of each option.org.apache.camel.catalog.LanguageValidationResult
validateLanguageExpression
(ClassLoader classLoader, String language, String text) Parses and validates the language as an expressionorg.apache.camel.catalog.LanguageValidationResult
validateLanguagePredicate
(ClassLoader classLoader, String language, String text) Parses and validates the language as a predicateboolean
validateTimePattern
(String pattern) Validates the pattern whether its a valid time pattern.
-
Method Details
-
getJSonSchemaResolver
org.apache.camel.catalog.JSonSchemaResolver getJSonSchemaResolver()Returns theJSonSchemaResolver
used by this catalog.- Returns:
- the resolver
-
setJSonSchemaResolver
void setJSonSchemaResolver(org.apache.camel.catalog.JSonSchemaResolver resolver) To use a customJSonSchemaResolver
with this catalog.- Parameters:
resolver
- the custom resolver
-
setRuntimeProvider
To plugin a customRuntimeProvider
that amends the catalog to only include information that is supported on the runtime. -
getRuntimeProvider
RuntimeProvider getRuntimeProvider()Gets theRuntimeProvider
in use. -
enableCache
void enableCache()Enables caching of the resources which makes the catalog faster, but keeps data in memory during caching. The catalog does not cache by default. -
isCaching
boolean isCaching()Whether caching has been enabled. -
setSuggestionStrategy
void setSuggestionStrategy(org.apache.camel.catalog.SuggestionStrategy suggestionStrategy) To plugin a customSuggestionStrategy
to provide suggestion for unknown options -
getSuggestionStrategy
org.apache.camel.catalog.SuggestionStrategy getSuggestionStrategy()Gets theSuggestionStrategy
in use -
setVersionManager
To plugin a customVersionManager
to load other versions of Camel the catalog should use. -
getVersionManager
VersionManager getVersionManager()Gets theVersionManager
in use -
addComponent
Adds a 3rd party component to this catalog.- Parameters:
name
- the component nameclassName
- the fully qualified class name for the component class
-
addComponent
Adds a 3rd party component to this catalog.- Parameters:
name
- the component nameclassName
- the fully qualified class name for the component classjsonSchema
- the component JSON schema
-
addDataFormat
Adds a 3rd party data format to this catalog.- Parameters:
name
- the data format nameclassName
- the fully qualified class name for the data format class
-
addDataFormat
Adds a 3rd party data format to this catalog.- Parameters:
name
- the data format nameclassName
- the fully qualified class name for the data format classjsonSchema
- the data format JSON schema
-
getCatalogVersion
String getCatalogVersion()The version of this Camel Catalog -
loadVersion
Attempt to load the Camel version to be used by the catalog. Loading the camel-catalog JAR of the given version of choice may require internet access to download the JAR from Maven central. You can pre download the JAR and install in a local Maven repository to avoid internet access for offline environments. When loading a new version the cache will be invalidated. Important: When loading a new runtime provider version, then its strongly advised to load the same/corresponding version first usingloadVersion(String)
.- Parameters:
version
- the Camel version such as 2.17.1- Returns:
- true if the version was loaded, false if not.
-
getLoadedVersion
String getLoadedVersion()Gets the current loaded Camel version used by the catalog. -
getRuntimeProviderLoadedVersion
String getRuntimeProviderLoadedVersion()Gets the current loaded runtime provider version used by the catalog. -
loadRuntimeProviderVersion
Attempt to load the runtime provider version to be used by the catalog. Loading the runtime provider JAR of the given version of choice may require internet access to download the JAR from Maven central. You can pre download the JAR and install in a local Maven repository to avoid internet access for offline environments. Important: When loading a new runtime provider version, then its strongly advised to load the same/corresponding version first usingloadVersion(String)
.- Parameters:
groupId
- the runtime provider Maven groupIdartifactId
- the runtime provider Maven artifactIdversion
- the runtime provider Maven version- Returns:
- true if the version was loaded, false if not.
-
findComponentNames
Find all the component names from the Camel catalog -
findDataFormatNames
Find all the data format names from the Camel catalog -
findLanguageNames
Find all the language names from the Camel catalog -
findModelNames
Find all the model names from the Camel catalog -
findOtherNames
Find all the other (miscellaneous) names from the Camel catalog -
findNames
- Parameters:
kind
- the kind to look for- Returns:
- the list of part names of the given
Kind
available in thisCamelCatalog
-
findComponentNames
Find all the component names from the Camel catalog that matches the label -
findDataFormatNames
Find all the data format names from the Camel catalog that matches the label -
findLanguageNames
Find all the language names from the Camel catalog that matches the label -
findModelNames
Find all the model names from the Camel catalog that matches the label -
findOtherNames
Find all the other (miscellaneous) names from the Camel catalog that matches the label -
componentJSonSchema
Returns the component information as JSON format.- Parameters:
name
- the component name- Returns:
- component details in JSon
-
dataFormatJSonSchema
Returns the data format information as JSON format.- Parameters:
name
- the data format name- Returns:
- data format details in JSon
-
languageJSonSchema
Returns the language information as JSON format.- Parameters:
name
- the language name- Returns:
- language details in JSon
-
otherJSonSchema
Returns the other (miscellaneous) information as JSON format.- Parameters:
name
- the other (miscellaneous) name- Returns:
- other (miscellaneous) details in JSon
-
modelJSonSchema
Returns the model information as JSON format.- Parameters:
name
- the model name- Returns:
- model details in JSon
-
findComponentLabels
Find all the unique label names all the components are using.- Returns:
- a set of all the labels.
-
findDataFormatLabels
Find all the unique label names all the data formats are using.- Returns:
- a set of all the labels.
-
findLanguageLabels
Find all the unique label names all the languages are using.- Returns:
- a set of all the labels.
-
findModelLabels
Find all the unique label names all the models are using.- Returns:
- a set of all the labels.
-
findOtherLabels
Find all the unique label names all the other (miscellaneous) are using.- Returns:
- a set of all the labels.
-
springSchemaAsXml
String springSchemaAsXml()Returns the Camel Spring XML schema- Returns:
- the spring XML schema
-
mainJsonSchema
String mainJsonSchema()Returns the camel-main json schema- Returns:
- the camel-main json schema
-
endpointProperties
Parses the endpoint uri and constructs a key/value properties of each option- Parameters:
uri
- the endpoint uri- Returns:
- properties as key value pairs of each endpoint option
- Throws:
URISyntaxException
-
endpointLenientProperties
Parses the endpoint uri and constructs a key/value properties of only the lenient properties (eg custom options) For example using the HTTP components to provide query parameters in the endpoint uri.- Parameters:
uri
- the endpoint uri- Returns:
- properties as key value pairs of each lenient properties
- Throws:
URISyntaxException
-
validateTimePattern
Validates the pattern whether its a valid time pattern.- Parameters:
pattern
- the pattern such as 5000, 5s, 5sec, 4min, 4m30s, 1h, etc.- Returns:
- true if valid, false if invalid
-
validateEndpointProperties
Parses and validates the endpoint uri and constructs a key/value properties of each option.- Parameters:
uri
- the endpoint uri- Returns:
- validation result
-
validateEndpointProperties
org.apache.camel.catalog.EndpointValidationResult validateEndpointProperties(String uri, boolean ignoreLenientProperties) Parses and validates the endpoint uri and constructs a key/value properties of each option. The option ignoreLenientProperties can be used to ignore components that uses lenient properties. When this is true, then the uri validation is stricter but would fail on properties that are not part of the component but in the uri because of using lenient properties. For example using the HTTP components to provide query parameters in the endpoint uri.- Parameters:
uri
- the endpoint uriignoreLenientProperties
- whether to ignore components that uses lenient properties.- Returns:
- validation result
-
validateEndpointProperties
org.apache.camel.catalog.EndpointValidationResult validateEndpointProperties(String uri, boolean ignoreLenientProperties, boolean consumerOnly, boolean producerOnly) Parses and validates the endpoint uri and constructs a key/value properties of each option. The option ignoreLenientProperties can be used to ignore components that uses lenient properties. When this is true, then the uri validation is stricter but would fail on properties that are not part of the component but in the uri because of using lenient properties. For example using the HTTP components to provide query parameters in the endpoint uri.- Parameters:
uri
- the endpoint uriignoreLenientProperties
- whether to ignore components that uses lenient properties.consumerOnly
- whether the endpoint is only used as a consumerproducerOnly
- whether the endpoint is only used as a producer- Returns:
- validation result
-
validateLanguagePredicate
org.apache.camel.catalog.LanguageValidationResult validateLanguagePredicate(ClassLoader classLoader, String language, String text) Parses and validates the language as a predicate Important: This requires having camel-core and the language dependencies on the classpath- Parameters:
classLoader
- a custom classloader to use for loading the language from the classpath, or null for using default classloaderlanguage
- the name of the languagetext
- the predicate text- Returns:
- validation result
-
validateLanguageExpression
org.apache.camel.catalog.LanguageValidationResult validateLanguageExpression(ClassLoader classLoader, String language, String text) Parses and validates the language as an expression Important: This requires having camel-core and the language dependencies on the classpath- Parameters:
classLoader
- a custom classloader to use for loading the language from the classpath, or null for using default classloaderlanguage
- the name of the languagetext
- the expression text- Returns:
- validation result
-
validateConfigurationProperty
org.apache.camel.catalog.ConfigurationPropertiesValidationResult validateConfigurationProperty(String text) Parses and validates the configuration property- Parameters:
text
- the configuration text- Returns:
- validation result
-
endpointComponentName
Returns the component name from the given endpoint uri- Parameters:
uri
- the endpoint uri- Returns:
- the component name (aka scheme), or null if not possible to determine
-
asEndpointUri
String asEndpointUri(String scheme, Map<String, String> properties, boolean encode) throws URISyntaxExceptionCreates an endpoint uri in Java style from the information from the properties- Parameters:
scheme
- the endpoint schemaproperties
- the properties as key value pairsencode
- whether to URL encode the returned uri or not- Returns:
- the constructed endpoint uri
- Throws:
URISyntaxException
- is thrown if there is encoding error
-
asEndpointUriXml
String asEndpointUriXml(String scheme, Map<String, String> properties, boolean encode) throws URISyntaxExceptionCreates an endpoint uri in XML style from the information from the properties- Parameters:
scheme
- the endpoint schemaproperties
- the properties as key value pairsencode
- whether to URL encode the returned uri or not- Returns:
- the constructed endpoint uri
- Throws:
URISyntaxException
- is thrown if there is encoding error
-
listComponentsAsJson
String listComponentsAsJson()Lists all the components summary details in JSon -
listDataFormatsAsJson
String listDataFormatsAsJson()Lists all the data formats summary details in JSon -
listLanguagesAsJson
String listLanguagesAsJson()Lists all the languages summary details in JSon -
listModelsAsJson
String listModelsAsJson()Lists all the models (EIPs) summary details in JSon -
listOthersAsJson
String listOthersAsJson()Lists all the others (miscellaneous) summary details in JSon -
summaryAsJson
String summaryAsJson()Reports a summary what the catalog contains in JSon -
componentModel
- Parameters:
name
- the component name to look up- Returns:
- the requested component or
null
in case it is not available in thisCamelCatalog
-
dataFormatModel
- Parameters:
name
- the data format name to look up- Returns:
- the requested data format or
null
in case it is not available in thisCamelCatalog
-
languageModel
- Parameters:
name
- the language name to look up- Returns:
- the requested language or
null
in case it is not available in thisCamelCatalog
-
otherModel
- Parameters:
name
- the other name to look up- Returns:
- the requested other or
null
in case it is not available in thisCamelCatalog
-
eipModel
- Parameters:
name
- the EIP model name to look up- Returns:
- the requested EIP model or
null
in case it is not available in thisCamelCatalog
-
mainModel
org.apache.camel.tooling.model.MainModel mainModel()- Returns:
- the requested main model or
null
in case it is not available in thisCamelCatalog
-
model
Lookup the model for the given kind and name- Parameters:
kind
- the requested kindname
- the name to look up- Returns:
- the requested model or
null
in case it is not available in thisCamelCatalog
-
modelFromMavenGAV
org.apache.camel.tooling.model.ArtifactModel<?> modelFromMavenGAV(String groupId, String artifactId, String version) Lookup the model for the given Maven GAV- Parameters:
groupId
- maven group idartifactId
- maven artifact idversion
- maven version (optional)- Returns:
- the requested model or
null
in case it is not available in thisCamelCatalog
-
loadResource
Load resource from catalog classpath- Parameters:
kind
- The resource kind, ex. camel-jbangname
- The resource name- Returns:
- An input stream for reading the resource; null if the resource could not be found
-
camelReleases
List<org.apache.camel.tooling.model.ReleaseModel> camelReleases()Load all Camel releases (core and spring-boot) from catalog -
camelQuarkusReleases
List<org.apache.camel.tooling.model.ReleaseModel> camelQuarkusReleases()Load all Camel Quarkus releases from catalog
-