Package org.apache.camel.model.rest
Class VerbDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<VerbDefinition>
org.apache.camel.model.rest.VerbDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
- Direct Known Subclasses:
DeleteDefinition
,GetDefinition
,HeadDefinition
,PatchDefinition
,PostDefinition
,PutDefinition
@Metadata(label="rest")
public abstract class VerbDefinition
extends OptionalIdentifiedDefinition<VerbDefinition>
A rest operation (such as GET, POST etc.)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
asVerb()
delete()
get()
getLabel()
Class
<?> getPath()
getRest()
getTo()
getType()
Class
<?> head()
post()
put()
void
setApiDocs
(String apiDocs) Whether to include or exclude this rest operation in API documentation.void
setBindingMode
(String bindingMode) Sets the binding mode to use.void
setClientRequestValidation
(String clientRequestValidation) Whether to enable validation of the client request to check: 1) Content-Type header matches what the Rest DSL consumes; returns HTTP Status 415 if validation error.void
setConsumes
(String consumes) To define the content type what the REST service consumes (accept as input), such as application/xml or application/json.void
setDeprecated
(String deprecated) Marks this rest operation as deprecated in OpenApi documentation.void
setDisabled
(String disabled) Whether to disable this REST service from the route during build time.void
setEnableCORS
(String enableCORS) Whether to enable CORS headers in the HTTP response.void
setEnableNoContentResponse
(String enableNoContentResponse) Whether to return HTTP 204 with an empty body when a response contains an empty JSON object or XML root object.void
setOutType
(String outType) Sets the class name to use for binding from POJO to output for the outgoing data This option will override what may be configured on a parent levelvoid
setOutTypeClass
(Class<?> outTypeClass) Sets the class to use for binding from POJO to output for the outgoing data This option will override what may be configured on a parent level.void
setParams
(List<ParamDefinition> params) To specify the REST operation parameters.void
The path mapping URIs of this REST operation such as /{id}.void
setProduces
(String produces) To define the content type what the REST service produces (uses for output), such as application/xml or application/json This option will override what may be configured on a parent levelvoid
setResponseMsgs
(List<ResponseMessageDefinition> responseMsgs) Sets operation response messages.void
setRest
(RestDefinition rest) void
setRouteId
(String routeId) Sets the id of the routevoid
setSecurity
(List<SecurityDefinition> security) Sets the security settings for this verb.void
setSkipBindingOnErrorCode
(String skipBindingOnErrorCode) Whether to skip binding on output if there is a custom HTTP error code header.void
setTo
(ToDefinition to) The Camel endpoint this REST service will call, such as a direct endpoint to link to an existing route that handles this REST call.void
Sets the class name to use for binding from input to POJO for the incoming data This option will override what may be configured on a parent level.void
setTypeClass
(Class<?> typeClass) Sets the class to use for binding from input to POJO for the incoming data This option will override what may be configured on a parent level.Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getNodePrefixId, getParent, hasCustomIdAssigned, id, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Constructor Details
-
VerbDefinition
public VerbDefinition()
-
-
Method Details
-
getShortName
-
getLabel
-
getDeprecated
-
setDeprecated
Marks this rest operation as deprecated in OpenApi documentation. -
deprecated
-
getRouteId
-
setRouteId
Sets the id of the route -
getParams
-
setParams
To specify the REST operation parameters. -
getResponseMsgs
-
setResponseMsgs
Sets operation response messages. -
getSecurity
-
setSecurity
Sets the security settings for this verb. -
getPath
-
setPath
The path mapping URIs of this REST operation such as /{id}. -
getConsumes
-
setConsumes
To define the content type what the REST service consumes (accept as input), such as application/xml or application/json. This option will override what may be configured on a parent level -
getProduces
-
setProduces
To define the content type what the REST service produces (uses for output), such as application/xml or application/json This option will override what may be configured on a parent level -
getDisabled
-
setDisabled
Whether to disable this REST service from the route during build time. Once an REST service has been disabled then it cannot be enabled later at runtime. -
getBindingMode
-
setBindingMode
Sets the binding mode to use. This option will override what may be configured on a parent level The default value is off -
getSkipBindingOnErrorCode
-
setSkipBindingOnErrorCode
Whether to skip binding on output if there is a custom HTTP error code header. This allows to build custom error messages that do not bind to json / xml etc, as success messages otherwise will do. This option will override what may be configured on a parent level -
getClientRequestValidation
-
setClientRequestValidation
Whether to enable validation of the client request to check: 1) Content-Type header matches what the Rest DSL consumes; returns HTTP Status 415 if validation error. 2) Accept header matches what the Rest DSL produces; returns HTTP Status 406 if validation error. 3) Missing required data (query parameters, HTTP headers, body); returns HTTP Status 400 if validation error. 4) Parsing error of the message body (JSon, XML or Auto binding mode must be enabled); returns HTTP Status 400 if validation error. -
getEnableCORS
-
setEnableCORS
Whether to enable CORS headers in the HTTP response. This option will override what may be configured on a parent level The default value is false. -
getEnableNoContentResponse
-
setEnableNoContentResponse
Whether to return HTTP 204 with an empty body when a response contains an empty JSON object or XML root object. The default value is false. -
getType
-
setType
Sets the class name to use for binding from input to POJO for the incoming data This option will override what may be configured on a parent level. The name of the class of the input data. Append a [] to the end of the name if you want the input to be an array type. -
getTypeClass
-
setTypeClass
Sets the class to use for binding from input to POJO for the incoming data This option will override what may be configured on a parent level. -
getOutType
-
setOutType
Sets the class name to use for binding from POJO to output for the outgoing data This option will override what may be configured on a parent level The name of the class of the input data. Append a [] to the end of the name if you want the input to be an array type. -
getOutTypeClass
-
setOutTypeClass
Sets the class to use for binding from POJO to output for the outgoing data This option will override what may be configured on a parent level. -
getApiDocs
-
setApiDocs
Whether to include or exclude this rest operation in API documentation. The default value is true. -
getTo
-
setTo
The Camel endpoint this REST service will call, such as a direct endpoint to link to an existing route that handles this REST call. -
getRest
-
setRest
-
get
-
get
-
post
-
post
-
put
-
put
-
delete
-
delete
-
head
-
head
-
verb
-
verb
-
asVerb
-