org.apache.camel
Interface ComponentConfiguration

All Known Implementing Classes:
ComponentConfigurationSupport, DefaultComponentConfiguration, UriComponentConfiguration

public interface ComponentConfiguration

Represents a set of configuration values for an endpoint URI which can be created from a URI string or a base URI string and a set of parameter names and values. The configuration values can then be introspected, modified and converted back into a URI string or Endpoint. For @{link UriEndpointComponent} implementations created for Endpoints annotated with UriEndpoint and the associated annotations then all the parameter values can be introspected and the parameter values are converted to their correct type. Other implementations keep all the types as String and there is no validation until you try to create an Endpoint from the values.


Method Summary
 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)
          Applies the current set of parameters to the given endpoint instance.
 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 query parameters added
 Object getEndpointParameter(Endpoint endpoint, String name)
          Gets the named URI parameter value on the given endpoint
 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
 SortedMap<String,ParameterConfiguration> getParameterConfigurationMap()
          Returns the sorted map of all the parameter names to their ParameterConfiguration objects
 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 setEndpointParameter(Endpoint endpoint, String name, Object value)
          Sets the named URI query parameter value on the given endpoint
 void setParameter(String name, Object value)
          Sets the parameter value of the given name
 void setParameters(Map<String,Object> propertyValues)
          Sets the parameter values of this configuration
 void setUriString(String newValue)
          Sets the URI string (without schema but with optional query parameters) which will update the getBaseUri() and the getParameters() values
 

Method Detail

getBaseUri

String getBaseUri()
Returns the base URI without any query parameters added


setBaseUri

void setBaseUri(String baseUri)
Sets the base URI without any query parameters added


getParameters

Map<String,Object> getParameters()
Returns the current parameters of the configuration (usually encoded as ?foo=bar&whatnot=something URI query parameters)


setParameters

void setParameters(Map<String,Object> propertyValues)
Sets the parameter values of this configuration


getParameter

Object getParameter(String name)
Returns the parameter value for the given name

Parameters:
name - the name of the URI query parameter to get
Returns:
the value of the parameter

setParameter

void setParameter(String name,
                  Object value)
Sets the parameter value of the given name

Parameters:
name - the name of the URI query parameter
value - the new value of the parameter

getUriString

String getUriString()
Returns the URI string (without schema) with query parameters for the current configuration which can then be used to create an Endpoint


setUriString

void setUriString(String newValue)
                  throws URISyntaxException
Sets the URI string (without schema but with optional query parameters) which will update the getBaseUri() and the getParameters() values

Parameters:
newValue - the new URI string with query arguments
Throws:
URISyntaxException

getParameterConfiguration

ParameterConfiguration getParameterConfiguration(String name)
Returns the URI query parameter configuration for the given parameter name or null if it does not exist


getParameterConfigurationMap

SortedMap<String,ParameterConfiguration> getParameterConfigurationMap()
Returns the sorted map of all the parameter names to their ParameterConfiguration objects


createEndpoint

Endpoint createEndpoint()
                        throws Exception
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.

Throws:
Exception

configureEndpoint

void configureEndpoint(Endpoint endpoint)
Applies the current set of parameters to the given endpoint instance.

Note that typically parts of the URI are not injected into the Endpoint; this method purely

Parameters:
endpoint -

getEndpointParameter

Object getEndpointParameter(Endpoint endpoint,
                            String name)
                            throws RuntimeCamelException
Gets the named URI parameter value on the given endpoint

Parameters:
endpoint - the endpoint instance
name - the name of the URI query parameter
Returns:
the value of the parameter
Throws:
RuntimeCamelException - if the parameter name does not exist on the endpoint

setEndpointParameter

void setEndpointParameter(Endpoint endpoint,
                          String name,
                          Object value)
                          throws RuntimeCamelException
Sets the named URI query parameter value on the given endpoint

Parameters:
endpoint - the endpoint instance
name - the name of the URI query parameter
value - the new value of the URI query parameter
Throws:
RuntimeCamelException

completeEndpointPath

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. So given the current configuration data, return a list of completions given the specified text. e.g. return the files in a directory, the matching queues in a message broker, the database tables in a database component etc

Parameters:
completionText - the prefix text used to complete on (usually a matching bit of text)
Returns:
a list of matches

createParameterJsonSchema

String createParameterJsonSchema()
Creates a JSON schema representation of the configuration parameters for this endpoint and the types and validation rules.

Returns:
a JSON string which represents the JSON schema for this endpoints configuration parameters.


Apache Camel