public abstract class ComponentConfigurationSupport extends Object implements ComponentConfiguration
ComponentConfiguration
Constructor and Description |
---|
ComponentConfigurationSupport(Component component) |
Modifier and Type | Method and Description |
---|---|
List<String> |
completeEndpointPath(String completionText)
A helper method for tools such as CLIs, IDEs or web tools that provides a completion list for Endpoint Paths
rather like bash tab completion or Karaf attribute or option completion handers.
|
void |
configureEndpoint(Endpoint endpoint)
Configures the properties on the given endpoint
|
Endpoint |
createEndpoint()
Converts the configuration into a URI and then looks up the endpoint in the
CamelContext
which typically results in a new Endpoint instance being created. |
String |
createParameterJsonSchema()
Creates a JSON schema representation of the
configuration parameters for this endpoint and the types and validation rules.
|
String |
getBaseUri()
Returns the base URI without any scheme or URI query parameters (property values)
|
Object |
getParameter(String name)
Returns the parameter value for the given name
|
ParameterConfiguration |
getParameterConfiguration(String name)
Returns the URI query parameter configuration for the given parameter name or null if it does not exist
|
Map<String,Object> |
getParameters()
Returns the current parameters of the configuration (usually encoded as ?foo=bar&whatnot=something URI query parameters)
|
String |
getUriString()
Returns the URI string (without schema) with query parameters for the current
configuration which can then be used to create an
Endpoint |
void |
setBaseUri(String baseUri)
Sets the base URI without any query parameters added
|
void |
setParameter(String name,
Object value)
Sets the parameter value of the given name
|
void |
setParameters(Map<String,Object> newValues)
Sets the parameter values of this configuration
|
void |
setUriString(String uri)
Sets the URI string (without schema but with optional query parameters)
which will update the
ComponentConfiguration.getBaseUri() and the ComponentConfiguration.getParameters() values |
protected void |
validatePropertyName(String name)
Allow implementations to validate whether a property name is valid
and either throw an exception or log a warning of an unknown property being used
|
protected Object |
validatePropertyValue(String name,
Object value)
Allow implementations to validate whether a property name is valid
and either throw an exception or log a warning of an unknown property being used
and to convert the given value to the correct type before updating the value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEndpointParameter, getParameterConfigurationMap, setEndpointParameter
public ComponentConfigurationSupport(Component component)
public Map<String,Object> getParameters()
ComponentConfiguration
getParameters
in interface ComponentConfiguration
public void setParameters(Map<String,Object> newValues)
ComponentConfiguration
setParameters
in interface ComponentConfiguration
public Object getParameter(String name)
ComponentConfiguration
getParameter
in interface ComponentConfiguration
name
- the name of the URI query parameter to getpublic void setParameter(String name, Object value)
ComponentConfiguration
setParameter
in interface ComponentConfiguration
name
- the name of the URI query parametervalue
- the new value of the parameterpublic String getBaseUri()
getBaseUri
in interface ComponentConfiguration
public void setBaseUri(String baseUri)
ComponentConfiguration
setBaseUri
in interface ComponentConfiguration
public Endpoint createEndpoint() throws Exception
ComponentConfiguration
CamelContext
which typically results in a new Endpoint
instance being created.createEndpoint
in interface ComponentConfiguration
Exception
public void configureEndpoint(Endpoint endpoint)
configureEndpoint
in interface ComponentConfiguration
public String getUriString()
ComponentConfiguration
Endpoint
getUriString
in interface ComponentConfiguration
public void setUriString(String uri) throws URISyntaxException
ComponentConfiguration
ComponentConfiguration.getBaseUri()
and the ComponentConfiguration.getParameters()
valuessetUriString
in interface ComponentConfiguration
uri
- the new URI string with query argumentsURISyntaxException
public ParameterConfiguration getParameterConfiguration(String name)
ComponentConfiguration
getParameterConfiguration
in interface ComponentConfiguration
public List<String> completeEndpointPath(String completionText)
ComponentConfiguration
completeEndpointPath
in interface ComponentConfiguration
completionText
- the prefix text used to complete on (usually a matching bit of text)public String createParameterJsonSchema()
ComponentConfiguration
createParameterJsonSchema
in interface ComponentConfiguration
protected void validatePropertyName(String name)
protected Object validatePropertyValue(String name, Object value)
Apache Camel