org.mule.transport.http.components
Class RestServiceWrapper
java.lang.Object
org.mule.component.AbstractComponent
org.mule.transport.http.components.RestServiceWrapper
- All Implemented Interfaces:
- AnnotatedObject, Component, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessor
public class RestServiceWrapper
- extends AbstractComponent
This service can used to proxy REST style services as local Mule Components. It
can be configured with a service URL plus a number of properties that allow you to
configure the parameters and error conditions on the service.
Methods inherited from class org.mule.component.AbstractComponent |
createResultEvent, dispose, doDispose, doStart, doStop, fireComponentNotification, getAnnotation, getAnnotations, getFlowConstruct, getInterceptors, getName, getStatistics, initialise, process, release, setAnnotations, setFlowConstruct, setInterceptors, setMuleContext, start, stop, toString |
DELETE
public static final String DELETE
- See Also:
- Constant Field Values
GET
public static final String GET
- See Also:
- Constant Field Values
CONTENT_TYPE_VALUE
public static final String CONTENT_TYPE_VALUE
- See Also:
- Constant Field Values
HTTP_METHOD
public static final String HTTP_METHOD
- See Also:
- Constant Field Values
logger
protected transient Log logger
- logger used by this class
RestServiceWrapper
public RestServiceWrapper()
getServiceUrl
public String getServiceUrl()
setServiceUrl
public void setServiceUrl(String serviceUrl)
getRequiredParams
public Map getRequiredParams()
setRequiredParams
public void setRequiredParams(Map requiredParams)
- Required params that are pulled from the message. If these params don't exist
the call will fail Note that you can use
ExpressionEvaluator
expressions such as
xpath, header, xquery, etc
- Parameters:
requiredParams
-
getOptionalParams
public Map getOptionalParams()
- Optional params that are pulled from the message. If these params don't exist
execution will continue. Note that you can use
ExpressionEvaluator
expressions such as xpath, header, xquery, etc
setOptionalParams
public void setOptionalParams(Map optionalParams)
getHttpMethod
public String getHttpMethod()
setHttpMethod
public void setHttpMethod(String httpMethod)
getPayloadParameterNames
public List getPayloadParameterNames()
setPayloadParameterNames
public void setPayloadParameterNames(List payloadParameterNames)
getFilter
public Filter getFilter()
setFilter
public void setFilter(Filter errorFilter)
doInitialise
protected void doInitialise()
throws InitialisationException
- Overrides:
doInitialise
in class AbstractComponent
- Throws:
InitialisationException
doInvoke
public Object doInvoke(MuleEvent event)
throws Exception
- Specified by:
doInvoke
in class AbstractComponent
- Throws:
Exception
isErrorPayload
protected boolean isErrorPayload(MuleMessage message)
handleException
protected void handleException(RestServiceException e,
MuleMessage result)
throws Exception
- Throws:
Exception
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.