Package org.apache.camel.spi
Interface RestRegistry
- All Superinterfaces:
AutoCloseable
,Service
,StaticService
A registry of all REST services running within the
CamelContext
which have been defined and
created using the Rest DSL.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Details about the REST service -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRestService
(Consumer consumer, boolean contractFirst, 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.Outputs the Rest services API documentation in JSON (requires camel-openapi-java on classpath)List all REST services from this registry.void
removeRestService
(Consumer consumer) Removes the REST service from the registryint
size()
Number of rest services in the registry.
-
Method Details
-
addRestService
void addRestService(Consumer consumer, boolean contractFirst, 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.- Parameters:
consumer
- the consumercontractFirst
- is the rest service based on code-first or contract-firsturl
- 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 service
-
removeRestService
Removes the REST service from the registry- Parameters:
consumer
- the consumer
-
listAllRestServices
List<RestRegistry.RestService> listAllRestServices()List all REST services from this registry.- Returns:
- all the REST services
-
size
int size()Number of rest services in the registry.- Returns:
- number of rest services in the registry.
-
apiDocAsJson
String apiDocAsJson()Outputs the Rest services API documentation in JSON (requires camel-openapi-java on classpath)- Returns:
- the API docs in JSon, or null if camel-openapi-java is not on classpath
-