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
Default CamelCatalog.
  • Field Details

  • Constructor Details

    • DefaultCamelCatalog

      public DefaultCamelCatalog()
      Creates the CamelCatalog without caching enabled.
    • DefaultCamelCatalog

      public DefaultCamelCatalog(boolean caching)
      Creates the CamelCatalog
      Parameters:
      caching - whether to use cache
  • Method Details

    • getRuntimeProvider

      public RuntimeProvider getRuntimeProvider()
      Description copied from interface: CamelCatalog
      Gets the RuntimeProvider in use.
      Specified by:
      getRuntimeProvider in interface CamelCatalog
    • setRuntimeProvider

      public void setRuntimeProvider(RuntimeProvider runtimeProvider)
      Description copied from interface: CamelCatalog
      To plugin a custom RuntimeProvider that amends the catalog to only include information that is supported on the runtime.
      Specified by:
      setRuntimeProvider in interface CamelCatalog
    • 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 interface CamelCatalog
    • isCaching

      public boolean isCaching()
      Description copied from interface: CamelCatalog
      Whether caching has been enabled.
      Specified by:
      isCaching in interface CamelCatalog
    • setVersionManager

      public void setVersionManager(VersionManager versionManager)
      Description copied from interface: CamelCatalog
      To plugin a custom VersionManager to load other versions of Camel the catalog should use.
      Specified by:
      setVersionManager in interface CamelCatalog
    • getVersionManager

      public VersionManager getVersionManager()
      Description copied from interface: CamelCatalog
      Gets the VersionManager in use
      Specified by:
      getVersionManager in interface CamelCatalog
    • 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 interface CamelCatalog
      Parameters:
      name - the component name
      className - 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 interface CamelCatalog
      Parameters:
      name - the component name
      className - the fully qualified class name for the component class
      jsonSchema - 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 interface CamelCatalog
      Parameters:
      name - the data format name
      className - 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 interface CamelCatalog
      Parameters:
      name - the data format name
      className - the fully qualified class name for the data format class
      jsonSchema - the data format JSON schema
    • getCatalogVersion

      public String getCatalogVersion()
      Description copied from interface: CamelCatalog
      The version of this Camel Catalog
      Specified by:
      getCatalogVersion in interface CamelCatalog
    • 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 using CamelCatalog.loadVersion(String).

      Specified by:
      loadVersion in interface CamelCatalog
      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 interface CamelCatalog
    • getRuntimeProviderLoadedVersion

      public String getRuntimeProviderLoadedVersion()
      Description copied from interface: CamelCatalog
      Gets the current loaded runtime provider version used by the catalog.
      Specified by:
      getRuntimeProviderLoadedVersion in interface CamelCatalog
    • 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 using CamelCatalog.loadVersion(String).

      Specified by:
      loadRuntimeProviderVersion in interface CamelCatalog
      Parameters:
      groupId - the runtime provider Maven groupId
      artifactId - the runtime provider Maven artifactId
      version - 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 interface CamelCatalog
    • findDataFormatNames

      public List<String> findDataFormatNames()
      Description copied from interface: CamelCatalog
      Find all the data format names from the Camel catalog
      Specified by:
      findDataFormatNames in interface CamelCatalog
    • findLanguageNames

      public List<String> findLanguageNames()
      Description copied from interface: CamelCatalog
      Find all the language names from the Camel catalog
      Specified by:
      findLanguageNames in interface CamelCatalog
    • findModelNames

      public List<String> findModelNames()
      Description copied from interface: CamelCatalog
      Find all the model names from the Camel catalog
      Specified by:
      findModelNames in interface CamelCatalog
    • findOtherNames

      public List<String> findOtherNames()
      Description copied from interface: CamelCatalog
      Find all the other (miscellaneous) names from the Camel catalog
      Specified by:
      findOtherNames in interface CamelCatalog
    • 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 interface CamelCatalog
    • 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 interface CamelCatalog
    • 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 interface CamelCatalog
    • 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 interface CamelCatalog
    • 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 interface CamelCatalog
    • modelJSonSchema

      public String modelJSonSchema(String name)
      Description copied from interface: CamelCatalog
      Returns the model information as JSON format.
      Specified by:
      modelJSonSchema in interface CamelCatalog
      Overrides:
      modelJSonSchema in class org.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 interface CamelCatalog
      Overrides:
      eipModel in class org.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 this CamelCatalog
    • componentJSonSchema

      public String componentJSonSchema(String name)
      Description copied from interface: CamelCatalog
      Returns the component information as JSON format.
      Specified by:
      componentJSonSchema in interface CamelCatalog
      Overrides:
      componentJSonSchema in class org.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 interface CamelCatalog
      Overrides:
      componentModel in class org.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 this CamelCatalog
    • dataFormatJSonSchema

      public String dataFormatJSonSchema(String name)
      Description copied from interface: CamelCatalog
      Returns the data format information as JSON format.
      Specified by:
      dataFormatJSonSchema in interface CamelCatalog
      Overrides:
      dataFormatJSonSchema in class org.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 interface CamelCatalog
      Overrides:
      dataFormatModel in class org.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 this CamelCatalog
    • languageJSonSchema

      public String languageJSonSchema(String name)
      Description copied from interface: CamelCatalog
      Returns the language information as JSON format.
      Specified by:
      languageJSonSchema in interface CamelCatalog
      Overrides:
      languageJSonSchema in class org.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 interface CamelCatalog
      Overrides:
      languageModel in class org.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 this CamelCatalog
    • otherJSonSchema

      public String otherJSonSchema(String name)
      Description copied from interface: CamelCatalog
      Returns the other (miscellaneous) information as JSON format.
      Specified by:
      otherJSonSchema in interface CamelCatalog
      Overrides:
      otherJSonSchema in class org.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 interface CamelCatalog
      Overrides:
      otherModel in class org.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 this CamelCatalog
    • mainJSonSchema

      public String mainJSonSchema()
      Overrides:
      mainJSonSchema in class org.apache.camel.catalog.impl.AbstractCamelCatalog
    • mainModel

      public org.apache.camel.tooling.model.MainModel mainModel()
      Specified by:
      mainModel in interface CamelCatalog
      Overrides:
      mainModel in class org.apache.camel.catalog.impl.AbstractCamelCatalog
      Returns:
      the requested main model or null in case it is not available in this CamelCatalog
    • 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 interface CamelCatalog
      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 interface CamelCatalog
      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 interface CamelCatalog
      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 interface CamelCatalog
      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 interface CamelCatalog
      Returns:
      a set of all the labels.
    • springSchemaAsXml

      public String springSchemaAsXml()
      Description copied from interface: CamelCatalog
      Returns the Camel Spring XML schema
      Specified by:
      springSchemaAsXml in interface CamelCatalog
      Returns:
      the spring XML schema
    • mainJsonSchema

      public String mainJsonSchema()
      Description copied from interface: CamelCatalog
      Returns the camel-main json schema
      Specified by:
      mainJsonSchema in interface CamelCatalog
      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 interface CamelCatalog
    • listDataFormatsAsJson

      public String listDataFormatsAsJson()
      Description copied from interface: CamelCatalog
      Lists all the data formats summary details in JSon
      Specified by:
      listDataFormatsAsJson in interface CamelCatalog
    • listLanguagesAsJson

      public String listLanguagesAsJson()
      Description copied from interface: CamelCatalog
      Lists all the languages summary details in JSon
      Specified by:
      listLanguagesAsJson in interface CamelCatalog
    • listModelsAsJson

      public String listModelsAsJson()
      Description copied from interface: CamelCatalog
      Lists all the models (EIPs) summary details in JSon
      Specified by:
      listModelsAsJson in interface CamelCatalog
    • listOthersAsJson

      public String listOthersAsJson()
      Description copied from interface: CamelCatalog
      Lists all the others (miscellaneous) summary details in JSon
      Specified by:
      listOthersAsJson in interface CamelCatalog
    • summaryAsJson

      public String summaryAsJson()
      Description copied from interface: CamelCatalog
      Reports a summary what the catalog contains in JSon
      Specified by:
      summaryAsJson in interface CamelCatalog
    • 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 interface CamelCatalog
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version (optional)
      Returns:
      the requested model or null in case it is not available in this CamelCatalog
    • loadResource

      public InputStream loadResource(String kind, String name)
      Description copied from interface: CamelCatalog
      Load resource from catalog classpath
      Specified by:
      loadResource in interface CamelCatalog
      Parameters:
      kind - The resource kind, ex. camel-jbang
      name - 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 interface CamelCatalog
    • 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 interface CamelCatalog