public final class RestComponentHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Object> |
addHttpRestrictParam(Map<String,Object> queryMap,
String verb,
boolean addOptions) |
static String |
createRestConsumerUrl(String componentName,
String path,
Map<String,Object> queryMap)
Creates the Rest consumers url based on component and url options.
|
static String |
createRestConsumerUrl(String componentName,
String scheme,
String host,
int port,
String path,
Map<String,Object> queryMap)
Creates the Rest consumers url based on component and url options.
|
static String |
createRestConsumerUrl(String componentName,
String verb,
String path,
Map<String,Object> queryMap)
Creates the Rest consumers url based on component and url options.
|
static Map<String,Object> |
initRestEndpointProperties(String componentName,
org.apache.camel.spi.RestConfiguration config)
Creates an Endpoint Property Map based on properies set in the component's RestConfiguration.
|
static String |
resolveRestHostName(String host,
org.apache.camel.spi.RestConfiguration config)
Sets the Rest consumer host based on RestConfiguration
|
public static Map<String,Object> addHttpRestrictParam(Map<String,Object> queryMap, String verb, boolean addOptions)
queryMap - the map of Endpoint options to apply the HTTP restrict settings toverb - the HTTP verb for the routeaddOptions - should OPTIONS verb be added.public static Map<String,Object> initRestEndpointProperties(String componentName, org.apache.camel.spi.RestConfiguration config)
componentName - the Rest Component nameconfig - the RestConfigurationpublic static String resolveRestHostName(String host, org.apache.camel.spi.RestConfiguration config) throws UnknownHostException
host - the existing host configurationconfig - the RestConfigurationUnknownHostException - thrown when local host or local ip can't be resolved via network interfaces.public static String createRestConsumerUrl(String componentName, String verb, String path, Map<String,Object> queryMap) throws URISyntaxException
componentName - the name of the rest componentverb - the HTTP verbpath - the HTTP path of the routequeryMap - the endpoint query optionsURISyntaxException - - is thrown if uri has invalid syntax.public static String createRestConsumerUrl(String componentName, String path, Map<String,Object> queryMap) throws URISyntaxException
componentName - the name of the rest componentpath - the HTTP path of the routequeryMap - the endpoint query optionsURISyntaxException - - is thrown if uri has invalid syntax.public static String createRestConsumerUrl(String componentName, String scheme, String host, int port, String path, Map<String,Object> queryMap) throws URISyntaxException
componentName - the name of the rest componentscheme - the scheme of the HTTP route http/httpshost - the host of the HTTP routeport - the port the route will be exposed throughpath - the HTTP path of the routequeryMap - the endpoint query optionsURISyntaxException - - is thrown if uri has invalid syntax.Apache Camel