com.consol.citrus.http.message
Class HttpMessageSender

java.lang.Object
  extended by com.consol.citrus.message.AbstractSyncMessageSender
      extended by com.consol.citrus.http.message.HttpMessageSender
All Implemented Interfaces:
MessageSender

public class HttpMessageSender
extends AbstractSyncMessageSender

Message sender implementation sending messages over Http. Note: Message sender is only using POST request method to publish messages to the service endpoint.

Author:
Christoph Deppisch

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.consol.citrus.message.MessageSender
MessageSender.ErrorHandlingStrategy
 
Field Summary
 
Fields inherited from class com.consol.citrus.message.AbstractSyncMessageSender
log, replyMessageHandler
 
Constructor Summary
HttpMessageSender()
          Default constructor.
HttpMessageSender(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
          Constructor using custom client request factory.
HttpMessageSender(org.springframework.web.client.RestTemplate restTemplate)
          Constructor using custom rest template.
 
Method Summary
 String getCharset()
          Gets the charset.
 String getContentType()
          Gets the contentType.
 EndpointUriResolver getEndpointUriResolver()
          Gets the endpointUriResolver.
 MessageSender.ErrorHandlingStrategy getErrorHandlingStrategy()
          Gets the errorHandlingStrategy.
 org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> getHeaderMapper()
          Gets the headerMapper.
 org.springframework.http.HttpMethod getRequestMethod()
          Gets the requestMethod.
 String getRequestUrl()
          Get the complete request URL.
 org.springframework.web.client.RestTemplate getRestTemplate()
          Gets the restTemplate.
 void send(org.springframework.integration.Message<?> message)
          Sends the message.
 void setCharset(String charset)
          Sets the charset.
 void setContentType(String contentType)
          Sets the contentType.
 void setEndpointUriResolver(EndpointUriResolver endpointUriResolver)
          Sets the endpoint uri resolver.
 void setErrorHandlingStrategy(MessageSender.ErrorHandlingStrategy errorHandlingStrategy)
          Sets the errorHandlingStrategy.
 void setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)
          Sets the headerMapper.
 void setInterceptors(List<org.springframework.http.client.ClientHttpRequestInterceptor> interceptors)
          Sets the interceptors on this implementation's rest template.
 void setRequestMethod(org.springframework.http.HttpMethod requestMethod)
          Sets the requestMethod.
 void setRequestUrl(String url)
          Set the complete request URL.
 void setRestTemplate(org.springframework.web.client.RestTemplate restTemplate)
          Sets the restTemplate.
 
Methods inherited from class com.consol.citrus.message.AbstractSyncMessageSender
getActor, getCorrelator, getReplyMessageHandler, informReplyMessageHandler, setActor, setCorrelator, setReplyMessageHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpMessageSender

public HttpMessageSender()
Default constructor.


HttpMessageSender

public HttpMessageSender(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Constructor using custom client request factory.

Parameters:
requestFactory - the custom request factory.

HttpMessageSender

public HttpMessageSender(org.springframework.web.client.RestTemplate restTemplate)
Constructor using custom rest template.

Parameters:
restTemplate - the custom rest template.
Method Detail

send

public void send(org.springframework.integration.Message<?> message)
Description copied from interface: MessageSender
Sends the message.

Parameters:
message - the message object to send.
Throws:
CitrusRuntimeException
See Also:
MessageSender.send(org.springframework.integration.Message)

getRequestUrl

public String getRequestUrl()
Get the complete request URL.

Returns:
the urlPath

setRequestUrl

public void setRequestUrl(String url)
Set the complete request URL.

Parameters:
url - the url to set

setEndpointUriResolver

public void setEndpointUriResolver(EndpointUriResolver endpointUriResolver)
Sets the endpoint uri resolver.

Parameters:
endpointUriResolver - the endpointUriResolver to set

setRestTemplate

public void setRestTemplate(org.springframework.web.client.RestTemplate restTemplate)
Sets the restTemplate.

Parameters:
restTemplate - the restTemplate to set

setRequestMethod

public void setRequestMethod(org.springframework.http.HttpMethod requestMethod)
Sets the requestMethod.

Parameters:
requestMethod - the requestMethod to set

setCharset

public void setCharset(String charset)
Sets the charset.

Parameters:
charset - the charset to set

setHeaderMapper

public void setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)
Sets the headerMapper.

Parameters:
headerMapper - the headerMapper to set

setContentType

public void setContentType(String contentType)
Sets the contentType.

Parameters:
contentType - the contentType to set

getErrorHandlingStrategy

public MessageSender.ErrorHandlingStrategy getErrorHandlingStrategy()
Gets the errorHandlingStrategy.

Returns:
the errorHandlingStrategy

setErrorHandlingStrategy

public void setErrorHandlingStrategy(MessageSender.ErrorHandlingStrategy errorHandlingStrategy)
Sets the errorHandlingStrategy.

Parameters:
errorHandlingStrategy - the errorHandlingStrategy to set

getRequestMethod

public org.springframework.http.HttpMethod getRequestMethod()
Gets the requestMethod.

Returns:
the requestMethod

getCharset

public String getCharset()
Gets the charset.

Returns:
the charset

getContentType

public String getContentType()
Gets the contentType.

Returns:
the contentType

getRestTemplate

public org.springframework.web.client.RestTemplate getRestTemplate()
Gets the restTemplate.

Returns:
the restTemplate

getEndpointUriResolver

public EndpointUriResolver getEndpointUriResolver()
Gets the endpointUriResolver.

Returns:
the endpointUriResolver

getHeaderMapper

public org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> getHeaderMapper()
Gets the headerMapper.

Returns:
the headerMapper

setInterceptors

public void setInterceptors(List<org.springframework.http.client.ClientHttpRequestInterceptor> interceptors)
Sets the interceptors on this implementation's rest template.

Parameters:
interceptors - the interceptors to set


Copyright © 2008-2013 ConSol* Consulting&Solutions GmbH. All Rights Reserved.