Package org.apache.camel.catalog
Class DefaultCamelCatalog
- java.lang.Object
-
- org.apache.camel.catalog.impl.AbstractCamelCatalog
-
- org.apache.camel.catalog.DefaultCamelCatalog
-
- All Implemented Interfaces:
CamelCatalog
public class DefaultCamelCatalog extends org.apache.camel.catalog.impl.AbstractCamelCatalog implements CamelCatalog
DefaultCamelCatalog
.
-
-
Constructor Summary
Constructors Constructor Description DefaultCamelCatalog()
Creates theCamelCatalog
without caching enabled.DefaultCamelCatalog(boolean caching)
Creates theCamelCatalog
-
Method Summary
All Methods Instance Methods Concrete 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.List<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.Set<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 labelSet<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 CatalogString
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.VersionManager
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 schemaString
mainJSonSchema()
org.apache.camel.tooling.model.MainModel
mainModel()
org.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
setRuntimeProvider(RuntimeProvider runtimeProvider)
To plugin a customRuntimeProvider
that amends the catalog to only include information that is supported on the runtime.void
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 JSon-
Methods inherited from class org.apache.camel.catalog.impl.AbstractCamelCatalog
asEndpointUri, asEndpointUriXml, endpointComponentName, endpointLenientProperties, endpointProperties, getJSonSchemaResolver, getSuggestionStrategy, setJSonSchemaResolver, setSuggestionStrategy, validateConfigurationProperty, validateEndpointProperties, validateEndpointProperties, validateEndpointProperties, validateLanguageExpression, validateLanguagePredicate, validateProperties, validateTimePattern
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.camel.catalog.CamelCatalog
asEndpointUri, asEndpointUriXml, endpointComponentName, endpointLenientProperties, endpointProperties, findNames, getJSonSchemaResolver, getSuggestionStrategy, model, setJSonSchemaResolver, setSuggestionStrategy, validateConfigurationProperty, validateEndpointProperties, validateEndpointProperties, validateEndpointProperties, validateLanguageExpression, validateLanguagePredicate, validateTimePattern
-
-
-
-
Constructor Detail
-
DefaultCamelCatalog
public DefaultCamelCatalog()
Creates theCamelCatalog
without caching enabled.
-
DefaultCamelCatalog
public DefaultCamelCatalog(boolean caching)
Creates theCamelCatalog
- Parameters:
caching
- whether to use cache
-
-
Method Detail
-
getRuntimeProvider
public RuntimeProvider getRuntimeProvider()
Description copied from interface:CamelCatalog
Gets theRuntimeProvider
in use.- Specified by:
getRuntimeProvider
in interfaceCamelCatalog
-
setRuntimeProvider
public void setRuntimeProvider(RuntimeProvider runtimeProvider)
Description copied from interface:CamelCatalog
To plugin a customRuntimeProvider
that amends the catalog to only include information that is supported on the runtime.- Specified by:
setRuntimeProvider
in interfaceCamelCatalog
-
enableCache
public void enableCache()
Description copied from interface:CamelCatalog
Enables caching of the resources which makes the catalog faster, but keeps data in memory during caching. The catalog does not cache by default.- Specified by:
enableCache
in interfaceCamelCatalog
-
isCaching
public boolean isCaching()
Description copied from interface:CamelCatalog
Whether caching has been enabled.- Specified by:
isCaching
in interfaceCamelCatalog
-
setVersionManager
public void setVersionManager(VersionManager versionManager)
Description copied from interface:CamelCatalog
To plugin a customVersionManager
to load other versions of Camel the catalog should use.- Specified by:
setVersionManager
in interfaceCamelCatalog
-
getVersionManager
public VersionManager getVersionManager()
Description copied from interface:CamelCatalog
Gets theVersionManager
in use- Specified by:
getVersionManager
in interfaceCamelCatalog
-
addComponent
public void addComponent(String name, String className)
Description copied from interface:CamelCatalog
Adds a 3rd party component to this catalog.- Specified by:
addComponent
in interfaceCamelCatalog
- Parameters:
name
- the component nameclassName
- the fully qualified class name for the component class
-
addComponent
public void addComponent(String name, String className, String jsonSchema)
Description copied from interface:CamelCatalog
Adds a 3rd party component to this catalog.- Specified by:
addComponent
in interfaceCamelCatalog
- Parameters:
name
- the component nameclassName
- the fully qualified class name for the component classjsonSchema
- the component JSON schema
-
addDataFormat
public void addDataFormat(String name, String className)
Description copied from interface:CamelCatalog
Adds a 3rd party data format to this catalog.- Specified by:
addDataFormat
in interfaceCamelCatalog
- Parameters:
name
- the data format nameclassName
- the fully qualified class name for the data format class
-
addDataFormat
public void addDataFormat(String name, String className, String jsonSchema)
Description copied from interface:CamelCatalog
Adds a 3rd party data format to this catalog.- Specified by:
addDataFormat
in interfaceCamelCatalog
- Parameters:
name
- the data format nameclassName
- the fully qualified class name for the data format classjsonSchema
- the data format JSON schema
-
getCatalogVersion
public String getCatalogVersion()
Description copied from interface:CamelCatalog
The version of this Camel Catalog- Specified by:
getCatalogVersion
in interfaceCamelCatalog
-
loadVersion
public boolean loadVersion(String version)
Description copied from interface:CamelCatalog
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 usingCamelCatalog.loadVersion(String)
.- Specified by:
loadVersion
in interfaceCamelCatalog
- Parameters:
version
- the Camel version such as 2.17.1- Returns:
- true if the version was loaded, false if not.
-
getLoadedVersion
public String getLoadedVersion()
Description copied from interface:CamelCatalog
Gets the current loaded Camel version used by the catalog.- Specified by:
getLoadedVersion
in interfaceCamelCatalog
-
getRuntimeProviderLoadedVersion
public String getRuntimeProviderLoadedVersion()
Description copied from interface:CamelCatalog
Gets the current loaded runtime provider version used by the catalog.- Specified by:
getRuntimeProviderLoadedVersion
in interfaceCamelCatalog
-
loadRuntimeProviderVersion
public boolean loadRuntimeProviderVersion(String groupId, String artifactId, String version)
Description copied from interface:CamelCatalog
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 usingCamelCatalog.loadVersion(String)
.- Specified by:
loadRuntimeProviderVersion
in interfaceCamelCatalog
- 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
public List<String> findComponentNames()
Description copied from interface:CamelCatalog
Find all the component names from the Camel catalog- Specified by:
findComponentNames
in interfaceCamelCatalog
-
findDataFormatNames
public List<String> findDataFormatNames()
Description copied from interface:CamelCatalog
Find all the data format names from the Camel catalog- Specified by:
findDataFormatNames
in interfaceCamelCatalog
-
findLanguageNames
public List<String> findLanguageNames()
Description copied from interface:CamelCatalog
Find all the language names from the Camel catalog- Specified by:
findLanguageNames
in interfaceCamelCatalog
-
findModelNames
public List<String> findModelNames()
Description copied from interface:CamelCatalog
Find all the model names from the Camel catalog- Specified by:
findModelNames
in interfaceCamelCatalog
-
findOtherNames
public List<String> findOtherNames()
Description copied from interface:CamelCatalog
Find all the other (miscellaneous) names from the Camel catalog- Specified by:
findOtherNames
in interfaceCamelCatalog
-
findModelNames
public List<String> findModelNames(String filter)
Description copied from interface:CamelCatalog
Find all the model names from the Camel catalog that matches the label- Specified by:
findModelNames
in interfaceCamelCatalog
-
findComponentNames
public List<String> findComponentNames(String filter)
Description copied from interface:CamelCatalog
Find all the component names from the Camel catalog that matches the label- Specified by:
findComponentNames
in interfaceCamelCatalog
-
findDataFormatNames
public List<String> findDataFormatNames(String filter)
Description copied from interface:CamelCatalog
Find all the data format names from the Camel catalog that matches the label- Specified by:
findDataFormatNames
in interfaceCamelCatalog
-
findLanguageNames
public List<String> findLanguageNames(String filter)
Description copied from interface:CamelCatalog
Find all the language names from the Camel catalog that matches the label- Specified by:
findLanguageNames
in interfaceCamelCatalog
-
findOtherNames
public List<String> findOtherNames(String filter)
Description copied from interface:CamelCatalog
Find all the other (miscellaneous) names from the Camel catalog that matches the label- Specified by:
findOtherNames
in interfaceCamelCatalog
-
modelJSonSchema
public String modelJSonSchema(String name)
Description copied from interface:CamelCatalog
Returns the model information as JSON format.- Specified by:
modelJSonSchema
in interfaceCamelCatalog
- Overrides:
modelJSonSchema
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the model name- Returns:
- model details in JSon
-
eipModel
public org.apache.camel.tooling.model.EipModel eipModel(String name)
- Specified by:
eipModel
in interfaceCamelCatalog
- Overrides:
eipModel
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the EIP model name to look up- Returns:
- the requested EIP model or
null
in case it is not available in thisCamelCatalog
-
componentJSonSchema
public String componentJSonSchema(String name)
Description copied from interface:CamelCatalog
Returns the component information as JSON format.- Specified by:
componentJSonSchema
in interfaceCamelCatalog
- Overrides:
componentJSonSchema
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the component name- Returns:
- component details in JSon
-
componentModel
public org.apache.camel.tooling.model.ComponentModel componentModel(String name)
- Specified by:
componentModel
in interfaceCamelCatalog
- Overrides:
componentModel
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the component name to look up- Returns:
- the requested component or
null
in case it is not available in thisCamelCatalog
-
dataFormatJSonSchema
public String dataFormatJSonSchema(String name)
Description copied from interface:CamelCatalog
Returns the data format information as JSON format.- Specified by:
dataFormatJSonSchema
in interfaceCamelCatalog
- Overrides:
dataFormatJSonSchema
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the data format name- Returns:
- data format details in JSon
-
dataFormatModel
public org.apache.camel.tooling.model.DataFormatModel dataFormatModel(String name)
- Specified by:
dataFormatModel
in interfaceCamelCatalog
- Overrides:
dataFormatModel
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the data format name to look up- Returns:
- the requested data format or
null
in case it is not available in thisCamelCatalog
-
languageJSonSchema
public String languageJSonSchema(String name)
Description copied from interface:CamelCatalog
Returns the language information as JSON format.- Specified by:
languageJSonSchema
in interfaceCamelCatalog
- Overrides:
languageJSonSchema
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the language name- Returns:
- language details in JSon
-
languageModel
public org.apache.camel.tooling.model.LanguageModel languageModel(String name)
- Specified by:
languageModel
in interfaceCamelCatalog
- Overrides:
languageModel
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the language name to look up- Returns:
- the requested language or
null
in case it is not available in thisCamelCatalog
-
otherJSonSchema
public String otherJSonSchema(String name)
Description copied from interface:CamelCatalog
Returns the other (miscellaneous) information as JSON format.- Specified by:
otherJSonSchema
in interfaceCamelCatalog
- Overrides:
otherJSonSchema
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the other (miscellaneous) name- Returns:
- other (miscellaneous) details in JSon
-
otherModel
public org.apache.camel.tooling.model.OtherModel otherModel(String name)
- Specified by:
otherModel
in interfaceCamelCatalog
- Overrides:
otherModel
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Parameters:
name
- the other name to look up- Returns:
- the requested other or
null
in case it is not available in thisCamelCatalog
-
mainJSonSchema
public String mainJSonSchema()
- Overrides:
mainJSonSchema
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
-
mainModel
public org.apache.camel.tooling.model.MainModel mainModel()
- Specified by:
mainModel
in interfaceCamelCatalog
- Overrides:
mainModel
in classorg.apache.camel.catalog.impl.AbstractCamelCatalog
- Returns:
- the requested main model or
null
in case it is not available in thisCamelCatalog
-
findModelLabels
public Set<String> findModelLabels()
Description copied from interface:CamelCatalog
Find all the unique label names all the models are using.- Specified by:
findModelLabels
in interfaceCamelCatalog
- Returns:
- a set of all the labels.
-
findComponentLabels
public Set<String> findComponentLabels()
Description copied from interface:CamelCatalog
Find all the unique label names all the components are using.- Specified by:
findComponentLabels
in interfaceCamelCatalog
- Returns:
- a set of all the labels.
-
findDataFormatLabels
public Set<String> findDataFormatLabels()
Description copied from interface:CamelCatalog
Find all the unique label names all the data formats are using.- Specified by:
findDataFormatLabels
in interfaceCamelCatalog
- Returns:
- a set of all the labels.
-
findLanguageLabels
public Set<String> findLanguageLabels()
Description copied from interface:CamelCatalog
Find all the unique label names all the languages are using.- Specified by:
findLanguageLabels
in interfaceCamelCatalog
- Returns:
- a set of all the labels.
-
findOtherLabels
public Set<String> findOtherLabels()
Description copied from interface:CamelCatalog
Find all the unique label names all the other (miscellaneous) are using.- Specified by:
findOtherLabels
in interfaceCamelCatalog
- Returns:
- a set of all the labels.
-
archetypeCatalogAsXml
public String archetypeCatalogAsXml()
Description copied from interface:CamelCatalog
Returns the Apache Camel Maven Archetype catalog in XML format.- Specified by:
archetypeCatalogAsXml
in interfaceCamelCatalog
- Returns:
- the catalog in XML
-
springSchemaAsXml
public String springSchemaAsXml()
Description copied from interface:CamelCatalog
Returns the Camel Spring XML schema- Specified by:
springSchemaAsXml
in interfaceCamelCatalog
- Returns:
- the spring XML schema
-
mainJsonSchema
public String mainJsonSchema()
Description copied from interface:CamelCatalog
Returns the camel-main json schema- Specified by:
mainJsonSchema
in interfaceCamelCatalog
- Returns:
- the camel-main json schema
-
listComponentsAsJson
public String listComponentsAsJson()
Description copied from interface:CamelCatalog
Lists all the components summary details in JSon- Specified by:
listComponentsAsJson
in interfaceCamelCatalog
-
listDataFormatsAsJson
public String listDataFormatsAsJson()
Description copied from interface:CamelCatalog
Lists all the data formats summary details in JSon- Specified by:
listDataFormatsAsJson
in interfaceCamelCatalog
-
listLanguagesAsJson
public String listLanguagesAsJson()
Description copied from interface:CamelCatalog
Lists all the languages summary details in JSon- Specified by:
listLanguagesAsJson
in interfaceCamelCatalog
-
listModelsAsJson
public String listModelsAsJson()
Description copied from interface:CamelCatalog
Lists all the models (EIPs) summary details in JSon- Specified by:
listModelsAsJson
in interfaceCamelCatalog
-
listOthersAsJson
public String listOthersAsJson()
Description copied from interface:CamelCatalog
Lists all the others (miscellaneous) summary details in JSon- Specified by:
listOthersAsJson
in interfaceCamelCatalog
-
summaryAsJson
public String summaryAsJson()
Description copied from interface:CamelCatalog
Reports a summary what the catalog contains in JSon- Specified by:
summaryAsJson
in interfaceCamelCatalog
-
modelFromMavenGAV
public org.apache.camel.tooling.model.ArtifactModel<?> modelFromMavenGAV(String groupId, String artifactId, String version)
Description copied from interface:CamelCatalog
Lookup the model for the given Maven GAV- Specified by:
modelFromMavenGAV
in interfaceCamelCatalog
- 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
public InputStream loadResource(String kind, String name)
Description copied from interface:CamelCatalog
Load resource from catalog classpath- Specified by:
loadResource
in interfaceCamelCatalog
- 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
public List<org.apache.camel.tooling.model.ReleaseModel> camelReleases()
Description copied from interface:CamelCatalog
Load all Camel releases (core and spring-boot) from catalog- Specified by:
camelReleases
in interfaceCamelCatalog
-
camelQuarkusReleases
public List<org.apache.camel.tooling.model.ReleaseModel> camelQuarkusReleases()
Description copied from interface:CamelCatalog
Load all Camel Quarkus releases from catalog- Specified by:
camelQuarkusReleases
in interfaceCamelCatalog
-
-