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.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
Constructors Constructor Description VerbDefinition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringasVerb()RestDefinitiondelete()RestDefinitiondelete(String uri)VerbDefinitiondeprecated()RestDefinitionget()RestDefinitionget(String uri)StringgetApiDocs()StringgetBindingMode()StringgetClientRequestValidation()StringgetConsumes()StringgetDeprecated()StringgetEnableCORS()StringgetLabel()StringgetOutType()Class<?>getOutTypeClass()List<ParamDefinition>getParams()StringgetPath()StringgetProduces()List<ResponseMessageDefinition>getResponseMsgs()RestDefinitiongetRest()List<SecurityDefinition>getSecurity()StringgetShortName()StringgetSkipBindingOnErrorCode()ToDefinitiongetTo()StringgetType()Class<?>getTypeClass()RestDefinitionhead()RestDefinitionhead(String uri)RestDefinitionpost()RestDefinitionpost(String uri)RestDefinitionput()RestDefinitionput(String uri)voidsetApiDocs(String apiDocs)Whether to include or exclude this rest operation in API documentation.voidsetBindingMode(String bindingMode)Sets the binding mode to use.voidsetClientRequestValidation(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.voidsetConsumes(String consumes)To define the content type what the REST service consumes (accept as input), such as application/xml or application/json.voidsetDeprecated(String deprecated)Marks this rest operation as deprecated in OpenApi documentation.voidsetEnableCORS(String enableCORS)Whether to enable CORS headers in the HTTP response.voidsetOutType(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 levelvoidsetOutTypeClass(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.voidsetParams(List<ParamDefinition> params)To specify the REST operation parameters.voidsetPath(String path)The path mapping URIs of this REST operation such as /{id}.voidsetProduces(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 levelvoidsetResponseMsgs(List<ResponseMessageDefinition> responseMsgs)Sets operation response messages.voidsetRest(RestDefinition rest)voidsetSecurity(List<SecurityDefinition> security)Sets the security settings for this verb.voidsetSkipBindingOnErrorCode(String skipBindingOnErrorCode)Whether to skip binding on output if there is a custom HTTP error code header.voidsetTo(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.voidsetType(String type)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.voidsetTypeClass(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.RestDefinitionverb(String verb)RestDefinitionverb(String verb, String uri)-
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getParent, hasCustomIdAssigned, id, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
-
-
-
Method Detail
-
getShortName
public String getShortName()
-
getLabel
public String getLabel()
-
getDeprecated
public String getDeprecated()
-
setDeprecated
public void setDeprecated(String deprecated)
Marks this rest operation as deprecated in OpenApi documentation.
-
deprecated
public VerbDefinition deprecated()
-
getParams
public List<ParamDefinition> getParams()
-
setParams
public void setParams(List<ParamDefinition> params)
To specify the REST operation parameters.
-
getResponseMsgs
public List<ResponseMessageDefinition> getResponseMsgs()
-
setResponseMsgs
public void setResponseMsgs(List<ResponseMessageDefinition> responseMsgs)
Sets operation response messages.
-
getSecurity
public List<SecurityDefinition> getSecurity()
-
setSecurity
public void setSecurity(List<SecurityDefinition> security)
Sets the security settings for this verb.
-
getPath
public String getPath()
-
setPath
public void setPath(String path)
The path mapping URIs of this REST operation such as /{id}.
-
getConsumes
public String getConsumes()
-
setConsumes
public void setConsumes(String consumes)
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
public String getProduces()
-
setProduces
public 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 level
-
getBindingMode
public String getBindingMode()
-
setBindingMode
public void setBindingMode(String bindingMode)
Sets the binding mode to use. This option will override what may be configured on a parent level The default value is off
-
getSkipBindingOnErrorCode
public String getSkipBindingOnErrorCode()
-
setSkipBindingOnErrorCode
public void setSkipBindingOnErrorCode(String skipBindingOnErrorCode)
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
public String getClientRequestValidation()
-
setClientRequestValidation
public 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. 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
public String getEnableCORS()
-
setEnableCORS
public void setEnableCORS(String enableCORS)
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.
-
getType
public String getType()
-
setType
public void setType(String type)
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
public Class<?> getTypeClass()
-
setTypeClass
public 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.
-
getOutType
public String getOutType()
-
setOutType
public 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 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
public Class<?> getOutTypeClass()
-
setOutTypeClass
public void 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.
-
getApiDocs
public String getApiDocs()
-
setApiDocs
public void setApiDocs(String apiDocs)
Whether to include or exclude this rest operation in API documentation. The default value is true.
-
getTo
public ToDefinition getTo()
-
setTo
public 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.
-
getRest
public RestDefinition getRest()
-
setRest
public void setRest(RestDefinition rest)
-
get
public RestDefinition get()
-
get
public RestDefinition get(String uri)
-
post
public RestDefinition post()
-
post
public RestDefinition post(String uri)
-
put
public RestDefinition put()
-
put
public RestDefinition put(String uri)
-
delete
public RestDefinition delete()
-
delete
public RestDefinition delete(String uri)
-
head
public RestDefinition head()
-
head
public RestDefinition head(String uri)
-
verb
public RestDefinition verb(String verb)
-
verb
public RestDefinition verb(String verb, String uri)
-
asVerb
public abstract String asVerb()
-
-