|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
String getBaseUri()
void setBaseUri(String baseUri)
Map<String,Object> getParameters()
void setParameters(Map<String,Object> propertyValues)
Object getParameter(String name)
name
- the name of the URI query parameter to get
void setParameter(String name, Object value)
name
- the name of the URI query parametervalue
- the new value of the parameterString getUriString()
Endpoint
void setUriString(String newValue) throws URISyntaxException
getBaseUri()
and the getParameters()
values
newValue
- the new URI string with query arguments
URISyntaxException
ParameterConfiguration getParameterConfiguration(String name)
SortedMap<String,ParameterConfiguration> getParameterConfigurationMap()
ParameterConfiguration
objects
Endpoint createEndpoint() throws Exception
CamelContext
which typically results in a new Endpoint
instance being created.
Exception
void configureEndpoint(Endpoint endpoint)
endpoint
- Object getEndpointParameter(Endpoint endpoint, String name) throws RuntimeCamelException
endpoint
- the endpoint instancename
- the name of the URI query parameter
RuntimeCamelException
- if the parameter name does not exist on the endpointvoid setEndpointParameter(Endpoint endpoint, String name, Object value) throws RuntimeCamelException
endpoint
- the endpoint instancename
- the name of the URI query parametervalue
- the new value of the URI query parameter
RuntimeCamelException
List<String> completeEndpointPath(String completionText)
completionText
- the prefix text used to complete on (usually a matching bit of text)
String createParameterJsonSchema()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |