public class DefaultCamelCatalog extends Object implements CamelCatalog
CamelCatalog
.Constructor and Description |
---|
DefaultCamelCatalog()
Creates the
CamelCatalog without caching enabled. |
DefaultCamelCatalog(boolean caching)
Creates the
CamelCatalog |
Modifier and Type | Method and Description |
---|---|
void |
addComponent(String name,
String className)
Adds a 3rd party component to this catalog.
|
void |
addDataFormat(String name,
String className)
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 properties
|
String |
asEndpointUri(String scheme,
String json,
boolean encode)
Creates an endpoint uri in Java style from the information in the json schema
|
String |
asEndpointUriXml(String scheme,
Map<String,String> properties,
boolean encode)
Creates an endpoint uri in XML style (eg escape & as &l;) from the information from the properties
|
String |
asEndpointUriXml(String scheme,
String json,
boolean encode)
Creates an endpoint uri in XML style (eg escape & as &l;) from the information in the json schema
|
String |
blueprintSchemaAsXml()
Returns the Camel Blueprint XML schema
|
String |
componentJSonSchema(String name)
Returns the component information as JSon format.
|
String |
dataFormatJSonSchema(String name)
Returns the data format information as JSon format.
|
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 uri
|
Map<String,String> |
endpointProperties(String uri)
Parses the endpoint uri and constructs a key/value properties of each option
|
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 catalog
|
List<String> |
findComponentNames(String filter)
Find all the component names from the Camel catalog that matches the label
|
Set<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 catalog
|
List<String> |
findDataFormatNames(String filter)
Find all the data format names from the Camel catalog that matches the label
|
Set<String> |
findLanguageLabels()
Find all the unique label names all the data formats are using.
|
List<String> |
findLanguageNames()
Find all the language names from the Camel catalog
|
List<String> |
findLanguageNames(String filter)
Find all the language names from the Camel catalog that matches the label
|
Set<String> |
findModelLabels()
Find all the unique label names all the models are using.
|
List<String> |
findModelNames()
Find all the model names from the Camel catalog
|
List<String> |
findModelNames(String filter)
Find all the model names from the Camel catalog that matches the label
|
String |
getCatalogVersion()
The version of this Camel Catalog
|
String |
languageJSonSchema(String name)
Returns the language information as JSon format.
|
String |
listComponentsAsJson()
Lists all the components summary details in JSon
|
String |
listDataFormatsAsJson()
Lists all the data formats summary details in JSon
|
String |
listLanguagesAsJson()
Lists all the languages summary details in JSon
|
String |
listModelsAsJson()
Lists all the models (EIPs) summary details in JSon
|
String |
modelJSonSchema(String name)
Returns the model information as JSon format.
|
void |
setSuggestionStrategy(SuggestionStrategy suggestionStrategy)
To plugin a custom
SuggestionStrategy to provide suggestion for unknown options |
String |
springSchemaAsXml()
Returns the Camel Spring XML schema
|
String |
summaryAsJson()
Reports a summary what the catalog contains in JSon
|
EndpointValidationResult |
validateEndpointProperties(String uri)
Parses and validates the endpoint uri and constructs a key/value properties of each option.
|
EndpointValidationResult |
validateEndpointProperties(String uri,
boolean ignoreLenientProperties)
Parses and validates the endpoint uri and constructs a key/value properties of each option.
|
SimpleValidationResult |
validateSimpleExpression(String simple)
Parses and validates the simple expression.
|
SimpleValidationResult |
validateSimplePredicate(String simple)
Parses and validates the simple predicate
Important: This requires having camel-core on the classpath
|
boolean |
validateTimePattern(String pattern)
Validates the pattern whether its a valid time pattern.
|
public DefaultCamelCatalog()
CamelCatalog
without caching enabled.public DefaultCamelCatalog(boolean caching)
CamelCatalog
caching
- whether to use cachepublic void enableCache()
CamelCatalog
enableCache
in interface CamelCatalog
public void setSuggestionStrategy(SuggestionStrategy suggestionStrategy)
CamelCatalog
SuggestionStrategy
to provide suggestion for unknown optionssetSuggestionStrategy
in interface CamelCatalog
public void addComponent(String name, String className)
CamelCatalog
addComponent
in interface CamelCatalog
name
- the component nameclassName
- the fully qualified class name for the component classpublic void addDataFormat(String name, String className)
CamelCatalog
addDataFormat
in interface CamelCatalog
name
- the data format nameclassName
- the fully qualified class name for the data format classpublic String getCatalogVersion()
CamelCatalog
getCatalogVersion
in interface CamelCatalog
public List<String> findComponentNames()
CamelCatalog
findComponentNames
in interface CamelCatalog
public List<String> findDataFormatNames()
CamelCatalog
findDataFormatNames
in interface CamelCatalog
public List<String> findLanguageNames()
CamelCatalog
findLanguageNames
in interface CamelCatalog
public List<String> findModelNames()
CamelCatalog
findModelNames
in interface CamelCatalog
public List<String> findModelNames(String filter)
CamelCatalog
findModelNames
in interface CamelCatalog
public List<String> findComponentNames(String filter)
CamelCatalog
findComponentNames
in interface CamelCatalog
public List<String> findDataFormatNames(String filter)
CamelCatalog
findDataFormatNames
in interface CamelCatalog
public List<String> findLanguageNames(String filter)
CamelCatalog
findLanguageNames
in interface CamelCatalog
public String modelJSonSchema(String name)
CamelCatalog
modelJSonSchema
in interface CamelCatalog
name
- the model namepublic String componentJSonSchema(String name)
CamelCatalog
componentJSonSchema
in interface CamelCatalog
name
- the component namepublic String dataFormatJSonSchema(String name)
CamelCatalog
dataFormatJSonSchema
in interface CamelCatalog
name
- the data format namepublic String languageJSonSchema(String name)
CamelCatalog
languageJSonSchema
in interface CamelCatalog
name
- the language namepublic Set<String> findModelLabels()
CamelCatalog
findModelLabels
in interface CamelCatalog
public Set<String> findComponentLabels()
CamelCatalog
findComponentLabels
in interface CamelCatalog
public Set<String> findDataFormatLabels()
CamelCatalog
findDataFormatLabels
in interface CamelCatalog
public Set<String> findLanguageLabels()
CamelCatalog
findLanguageLabels
in interface CamelCatalog
public String archetypeCatalogAsXml()
CamelCatalog
archetypeCatalogAsXml
in interface CamelCatalog
public String springSchemaAsXml()
CamelCatalog
springSchemaAsXml
in interface CamelCatalog
public String blueprintSchemaAsXml()
CamelCatalog
blueprintSchemaAsXml
in interface CamelCatalog
public boolean validateTimePattern(String pattern)
CamelCatalog
validateTimePattern
in interface CamelCatalog
pattern
- the pattern such as 5000, 5s, 5sec, 4min, 4m30s, 1h, etc.public EndpointValidationResult validateEndpointProperties(String uri)
CamelCatalog
validateEndpointProperties
in interface CamelCatalog
uri
- the endpoint uripublic EndpointValidationResult validateEndpointProperties(String uri, boolean ignoreLenientProperties)
CamelCatalog
validateEndpointProperties
in interface CamelCatalog
uri
- the endpoint uriignoreLenientProperties
- whether to ignore components that uses lenient properties.public Map<String,String> endpointProperties(String uri) throws URISyntaxException
CamelCatalog
endpointProperties
in interface CamelCatalog
uri
- the endpoint uriURISyntaxException
public String endpointComponentName(String uri)
CamelCatalog
endpointComponentName
in interface CamelCatalog
uri
- the endpoint uripublic String asEndpointUri(String scheme, String json, boolean encode) throws URISyntaxException
CamelCatalog
asEndpointUri
in interface CamelCatalog
scheme
- the endpoint schemajson
- the json schema with the endpoint propertiesencode
- whether to URL encode the returned uri or notURISyntaxException
- is thrown if there is encoding errorpublic String asEndpointUriXml(String scheme, String json, boolean encode) throws URISyntaxException
CamelCatalog
asEndpointUriXml
in interface CamelCatalog
scheme
- the endpoint schemajson
- the json schema with the endpoint propertiesencode
- whether to URL encode the returned uri or notURISyntaxException
- is thrown if there is encoding errorpublic String asEndpointUri(String scheme, Map<String,String> properties, boolean encode) throws URISyntaxException
CamelCatalog
asEndpointUri
in interface CamelCatalog
scheme
- the endpoint schemaproperties
- the properties as key value pairsencode
- whether to URL encode the returned uri or notURISyntaxException
- is thrown if there is encoding errorpublic String asEndpointUriXml(String scheme, Map<String,String> properties, boolean encode) throws URISyntaxException
CamelCatalog
asEndpointUriXml
in interface CamelCatalog
scheme
- the endpoint schemaproperties
- the properties as key value pairsencode
- whether to URL encode the returned uri or notURISyntaxException
- is thrown if there is encoding errorpublic SimpleValidationResult validateSimpleExpression(String simple)
CamelCatalog
validateSimpleExpression
in interface CamelCatalog
simple
- the simple expressionpublic SimpleValidationResult validateSimplePredicate(String simple)
CamelCatalog
validateSimplePredicate
in interface CamelCatalog
simple
- the simple predicatepublic String listComponentsAsJson()
CamelCatalog
listComponentsAsJson
in interface CamelCatalog
public String listDataFormatsAsJson()
CamelCatalog
listDataFormatsAsJson
in interface CamelCatalog
public String listLanguagesAsJson()
CamelCatalog
listLanguagesAsJson
in interface CamelCatalog
public String listModelsAsJson()
CamelCatalog
listModelsAsJson
in interface CamelCatalog
public String summaryAsJson()
CamelCatalog
summaryAsJson
in interface CamelCatalog
Apache Camel