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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
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.String
archetypeCatalogAsXml()
Returns the Apache Camel Maven Archetype catalog in XML format.String
asEndpointUri(String scheme, Map<String,String> properties, boolean encode)
Creates an endpoint uri in Java style from the information from the propertiesString
asEndpointUriXml(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>
camelQuarkusReleases()
Load all Camel Quarkus releases from catalogList<org.apache.camel.tooling.model.ReleaseModel>
camelReleases()
Load all Camel releases (core and spring-boot) from catalogString
componentJSonSchema(String name)
Returns the component information as JSON format.org.apache.camel.tooling.model.ComponentModel
componentModel(String name)
String
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
eipModel(String name)
void
enableCache()
Enables caching of the resources which makes the catalog faster, but keeps data in memory during caching.String
endpointComponentName(String uri)
Returns the component name from the given endpoint uriMap<String,String>
endpointLenientProperties(String uri)
Parses the endpoint uri and constructs a key/value properties of only the lenient properties (eg custom options)Map<String,String>
endpointProperties(String uri)
Parses the endpoint uri and constructs a key/value properties of each optionSet<String>
findComponentLabels()
Find all the unique label names all the components are using.List<String>
findComponentNames()
Find all the component names from the Camel catalogList<String>
findComponentNames(String filter)
Find all the component names from the Camel catalog that matches the labelSet<String>
findDataFormatLabels()
Find all the unique label names all the data formats are using.List<String>
findDataFormatNames()
Find all the data format names from the Camel catalogList<String>
findDataFormatNames(String filter)
Find all the data format names from the Camel catalog that matches the labelSet<String>
findLanguageLabels()
Find all the unique label names all the languages are using.List<String>
findLanguageNames()
Find all the language names from the Camel catalogList<String>
findLanguageNames(String filter)
Find all the language names from the Camel catalog that matches the labelSet<String>
findModelLabels()
Find all the unique label names all the models are using.List<String>
findModelNames()
Find all the model names from the Camel catalogList<String>
findModelNames(String filter)
Find all the model names from the Camel catalog that matches the labeldefault List<String>
findNames(Kind kind)
Set<String>
findOtherLabels()
Find all the unique label names all the other (miscellaneous) are using.List<String>
findOtherNames()
Find all the other (miscellaneous) names from the Camel catalogList<String>
findOtherNames(String filter)
Find all the other (miscellaneous) names from the Camel catalog that matches the labelString
getCatalogVersion()
The version of this Camel Catalogorg.apache.camel.catalog.JSonSchemaResolver
getJSonSchemaResolver()
Returns theJSonSchemaResolver
used by this catalog.String
getLoadedVersion()
Gets the current loaded Camel version used by the catalog.RuntimeProvider
getRuntimeProvider()
Gets theRuntimeProvider
in use.String
getRuntimeProviderLoadedVersion()
Gets the current loaded runtime provider version used by the catalog.org.apache.camel.catalog.SuggestionStrategy
getSuggestionStrategy()
Gets theSuggestionStrategy
in useVersionManager
getVersionManager()
Gets theVersionManager
in useboolean
isCaching()
Whether caching has been enabled.String
languageJSonSchema(String name)
Returns the language information as JSON format.org.apache.camel.tooling.model.LanguageModel
languageModel(String name)
String
listComponentsAsJson()
Lists all the components summary details in JSonString
listDataFormatsAsJson()
Lists all the data formats summary details in JSonString
listLanguagesAsJson()
Lists all the languages summary details in JSonString
listModelsAsJson()
Lists all the models (EIPs) summary details in JSonString
listOthersAsJson()
Lists all the others (miscellaneous) summary details in JSonInputStream
loadResource(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.String
mainJsonSchema()
Returns the camel-main json schemaorg.apache.camel.tooling.model.MainModel
mainModel()
default org.apache.camel.tooling.model.BaseModel<?>
model(Kind kind, String name)
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 GAVString
modelJSonSchema(String name)
Returns the model information as JSON format.String
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.String
springSchemaAsXml()
Returns the Camel Spring XML schemaString
summaryAsJson()
Reports a summary what the catalog contains in JSonorg.apache.camel.catalog.ConfigurationPropertiesValidationResult
validateConfigurationProperty(String text)
Parses and validates the configuration propertyorg.apache.camel.catalog.EndpointValidationResult
validateEndpointProperties(String uri)
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 Detail
-
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
void setRuntimeProvider(RuntimeProvider provider)
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
void setVersionManager(VersionManager versionManager)
To plugin a customVersionManager
to load other versions of Camel the catalog should use.
-
getVersionManager
VersionManager getVersionManager()
Gets theVersionManager
in use
-
addComponent
void addComponent(String name, String className)
Adds a 3rd party component to this catalog.- Parameters:
name
- the component nameclassName
- the fully qualified class name for the component class
-
addComponent
void addComponent(String name, String className, String jsonSchema)
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
void addDataFormat(String name, String className)
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
void addDataFormat(String name, String className, String jsonSchema)
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
boolean loadVersion(String version)
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
boolean loadRuntimeProviderVersion(String groupId, String artifactId, String version)
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
List<String> findComponentNames()
Find all the component names from the Camel catalog
-
findDataFormatNames
List<String> findDataFormatNames()
Find all the data format names from the Camel catalog
-
findLanguageNames
List<String> findLanguageNames()
Find all the language names from the Camel catalog
-
findOtherNames
List<String> findOtherNames()
Find all the other (miscellaneous) names from the Camel catalog
-
findNames
default List<String> findNames(Kind kind)
- Parameters:
kind
- the kind to look for- Returns:
- the list of part names of the given
Kind
available in thisCamelCatalog
-
findComponentNames
List<String> findComponentNames(String filter)
Find all the component names from the Camel catalog that matches the label
-
findDataFormatNames
List<String> findDataFormatNames(String filter)
Find all the data format names from the Camel catalog that matches the label
-
findLanguageNames
List<String> findLanguageNames(String filter)
Find all the language names from the Camel catalog that matches the label
-
findModelNames
List<String> findModelNames(String filter)
Find all the model names from the Camel catalog that matches the label
-
findOtherNames
List<String> findOtherNames(String filter)
Find all the other (miscellaneous) names from the Camel catalog that matches the label
-
componentJSonSchema
String componentJSonSchema(String name)
Returns the component information as JSON format.- Parameters:
name
- the component name- Returns:
- component details in JSon
-
dataFormatJSonSchema
String dataFormatJSonSchema(String name)
Returns the data format information as JSON format.- Parameters:
name
- the data format name- Returns:
- data format details in JSon
-
languageJSonSchema
String languageJSonSchema(String name)
Returns the language information as JSON format.- Parameters:
name
- the language name- Returns:
- language details in JSon
-
otherJSonSchema
String otherJSonSchema(String name)
Returns the other (miscellaneous) information as JSON format.- Parameters:
name
- the other (miscellaneous) name- Returns:
- other (miscellaneous) details in JSon
-
modelJSonSchema
String modelJSonSchema(String name)
Returns the model information as JSON format.- Parameters:
name
- the model name- Returns:
- model details in JSon
-
findComponentLabels
Set<String> findComponentLabels()
Find all the unique label names all the components are using.- Returns:
- a set of all the labels.
-
findDataFormatLabels
Set<String> findDataFormatLabels()
Find all the unique label names all the data formats are using.- Returns:
- a set of all the labels.
-
findLanguageLabels
Set<String> findLanguageLabels()
Find all the unique label names all the languages are using.- Returns:
- a set of all the labels.
-
findModelLabels
Set<String> findModelLabels()
Find all the unique label names all the models are using.- Returns:
- a set of all the labels.
-
findOtherLabels
Set<String> findOtherLabels()
Find all the unique label names all the other (miscellaneous) are using.- Returns:
- a set of all the labels.
-
archetypeCatalogAsXml
String archetypeCatalogAsXml()
Returns the Apache Camel Maven Archetype catalog in XML format.- Returns:
- the catalog in XML
-
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
Map<String,String> endpointProperties(String uri) throws URISyntaxException
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
Map<String,String> endpointLenientProperties(String uri) throws URISyntaxException
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
boolean validateTimePattern(String pattern)
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
org.apache.camel.catalog.EndpointValidationResult validateEndpointProperties(String uri)
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
String endpointComponentName(String uri)
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 URISyntaxException
Creates 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 URISyntaxException
Creates 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
org.apache.camel.tooling.model.ComponentModel componentModel(String name)
- Parameters:
name
- the component name to look up- Returns:
- the requested component or
null
in case it is not available in thisCamelCatalog
-
dataFormatModel
org.apache.camel.tooling.model.DataFormatModel dataFormatModel(String name)
- 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
org.apache.camel.tooling.model.LanguageModel languageModel(String name)
- Parameters:
name
- the language name to look up- Returns:
- the requested language or
null
in case it is not available in thisCamelCatalog
-
otherModel
org.apache.camel.tooling.model.OtherModel otherModel(String name)
- Parameters:
name
- the other name to look up- Returns:
- the requested other or
null
in case it is not available in thisCamelCatalog
-
eipModel
org.apache.camel.tooling.model.EipModel eipModel(String name)
- 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
default org.apache.camel.tooling.model.BaseModel<?> model(Kind kind, String name)
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
InputStream loadResource(String kind, String name)
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
-
-