public class DefaultRestRegistry extends ServiceSupport implements StaticService, RestRegistry, CamelContextAware
RestRegistry.RestServiceshutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
DefaultRestRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRestService(Consumer consumer,
String url,
String baseUrl,
String basePath,
String uriTemplate,
String method,
String consumes,
String produces,
String inType,
String outType,
String routeId,
String description)
Adds a new REST service to the registry.
|
String |
apiDocAsJson()
Outputs the Rest services API documentation in JSon (requires camel-swagger-java on classpath)
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
CamelContext |
getCamelContext()
Get the
CamelContext |
List<RestRegistry.RestService> |
listAllRestServices()
List all REST services from this registry.
|
void |
removeRestService(Consumer consumer)
Removes the REST service from the registry
|
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
int |
size()
Number of rest services in the registry.
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic DefaultRestRegistry()
public void addRestService(Consumer consumer, String url, String baseUrl, String basePath, String uriTemplate, String method, String consumes, String produces, String inType, String outType, String routeId, String description)
RestRegistryaddRestService in interface RestRegistryconsumer - the consumerurl - the absolute url of the REST servicebaseUrl - the base url of the REST servicebasePath - the base pathuriTemplate - the uri templatemethod - the HTTP methodconsumes - optional details about what media-types the REST service acceptsproduces - optional details about what media-types the REST service returnsinType - optional detail input binding to a FQN class nameoutType - optional detail output binding to a FQN class namerouteId - the id of the route this rest service will be usingdescription - optional description about the the servicepublic void removeRestService(Consumer consumer)
RestRegistryremoveRestService in interface RestRegistryconsumer - the consumerpublic List<RestRegistry.RestService> listAllRestServices()
RestRegistrylistAllRestServices in interface RestRegistrypublic int size()
RestRegistrysize in interface RestRegistrypublic String apiDocAsJson()
RestRegistryapiDocAsJson in interface RestRegistrypublic CamelContext getCamelContext()
CamelContextAwareCamelContextgetCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwarecamelContext - the Camel contextprotected void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop() throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()Apache Camel