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:
Block
,OutputNode
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
- Direct Known Subclasses:
DeleteVerbDefinition
,GetVerbDefinition
,HeadVerbDefinition
,PatchVerbDefinition
,PostVerbDefinition
,PutVerbDefinition
@Metadata(label="rest") public class VerbDefinition extends OptionalIdentifiedDefinition<VerbDefinition> implements Block, OutputNode
Rest command
-
-
Constructor Summary
Constructors Constructor Description VerbDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOutput(ProcessorDefinition<?> processorDefinition)
Adds the given definition as output to this blockString
asVerb()
RestDefinition
delete()
RestDefinition
delete(String uri)
VerbDefinition
deprecated()
Sets deprecated flag in openapiRestDefinition
get()
RestDefinition
get(String uri)
String
getApiDocs()
String
getBindingMode()
String
getClientRequestValidation()
String
getConsumes()
Boolean
getDeprecated()
String
getEnableCORS()
String
getLabel()
String
getMethod()
String
getOutType()
Class<?>
getOutTypeClass()
List<RestOperationParamDefinition>
getParams()
String
getProduces()
List<RestOperationResponseMsgDefinition>
getResponseMsgs()
RestDefinition
getRest()
RouteDefinition
getRoute()
String
getRouteId()
List<SecurityDefinition>
getSecurity()
String
getShortName()
String
getSkipBindingOnErrorCode()
ToDefinition
getTo()
ToDynamicDefinition
getToD()
OptionalIdentifiedDefinition<?>
getToOrRoute()
String
getType()
Class<?>
getTypeClass()
String
getUri()
Boolean
getUsedForGeneratingNodeId()
RestDefinition
head()
RestDefinition
head(String uri)
RestDefinition
post()
RestDefinition
post(String uri)
RestDefinition
put()
RestDefinition
put(String uri)
void
setApiDocs(String apiDocs)
Whether to include or exclude the VerbDefinition 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 whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration of its consumes/produces settings.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(Boolean deprecated)
void
setEnableCORS(String enableCORS)
Whether to enable CORS headers in the HTTP response.void
setMethod(String method)
The HTTP verb such as GET, POST, DELETE, etc.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<RestOperationParamDefinition> params)
To specify the REST operation parameters.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<RestOperationResponseMsgDefinition> responseMsgs)
Sets operation response messages.void
setRest(RestDefinition rest)
void
setRoute(RouteDefinition route)
void
setRouteId(String routeId)
The route id this rest-dsl is using (read-only)void
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)
void
setToD(ToDynamicDefinition to)
void
setToOrRoute(OptionalIdentifiedDefinition<?> toOrRoute)
To route from this REST service to a Camel endpoint, or an inlined routevoid
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.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.void
setUri(String uri)
Uri template of this REST service such as /{id}.void
setUsedForGeneratingNodeId(Boolean usedForGeneratingNodeId)
RestDefinition
verb(String verb)
RestDefinition
verb(String verb, String uri)
-
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, description, getCustomId, getDescription, getDescriptionText, getId, getParent, hasCustomIdAssigned, id, idOrCreate, setCustomId, setDescription, setGeneratedId, setId
-
-
-
-
Method Detail
-
getShortName
public String getShortName()
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
-
getLabel
public String getLabel()
- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
-
addOutput
public void addOutput(ProcessorDefinition<?> processorDefinition)
Description copied from interface:Block
Adds the given definition as output to this block
-
getDeprecated
public Boolean getDeprecated()
-
deprecated
public VerbDefinition deprecated()
Sets deprecated flag in openapi
-
setDeprecated
public void setDeprecated(Boolean deprecated)
-
getParams
public List<RestOperationParamDefinition> getParams()
-
setParams
public void setParams(List<RestOperationParamDefinition> params)
To specify the REST operation parameters.
-
getResponseMsgs
public List<RestOperationResponseMsgDefinition> getResponseMsgs()
-
setResponseMsgs
public void setResponseMsgs(List<RestOperationResponseMsgDefinition> responseMsgs)
Sets operation response messages.
-
getSecurity
public List<SecurityDefinition> getSecurity()
-
setSecurity
public void setSecurity(List<SecurityDefinition> security)
Sets the security settings for this verb.
-
getMethod
public String getMethod()
-
setMethod
public void setMethod(String method)
The HTTP verb such as GET, POST, DELETE, etc.
-
getUri
public String getUri()
-
setUri
public void setUri(String uri)
Uri template of this REST service 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 auto
-
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 whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration of its consumes/produces settings. This can be turned on, to enable this check. In case of validation error, then HTTP Status codes 415 or 406 is returned. The default value is false.
-
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.
-
getRouteId
public String getRouteId()
-
setRouteId
public void setRouteId(String routeId)
The route id this rest-dsl is using (read-only)
-
getApiDocs
public String getApiDocs()
-
setApiDocs
public void setApiDocs(String apiDocs)
Whether to include or exclude the VerbDefinition in API documentation. The default value is true.
-
getRest
public RestDefinition getRest()
-
setRest
public void setRest(RestDefinition rest)
-
getRoute
public RouteDefinition getRoute()
-
setRoute
public void setRoute(RouteDefinition route)
-
getTo
public ToDefinition getTo()
-
getToD
public ToDynamicDefinition getToD()
-
setTo
public void setTo(ToDefinition to)
-
setToD
public void setToD(ToDynamicDefinition to)
-
getToOrRoute
public OptionalIdentifiedDefinition<?> getToOrRoute()
-
setToOrRoute
public void setToOrRoute(OptionalIdentifiedDefinition<?> toOrRoute)
To route from this REST service to a Camel endpoint, or an inlined route
-
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 String asVerb()
-
getUsedForGeneratingNodeId
public Boolean getUsedForGeneratingNodeId()
-
setUsedForGeneratingNodeId
public void setUsedForGeneratingNodeId(Boolean usedForGeneratingNodeId)
-
-