public class HttpSender extends AbstractSender
Modifier and Type | Class and Description |
---|---|
static class |
HttpSender.Method
Enumeration on available HTTP methods.
|
Constructor and Description |
---|
HttpSender() |
Modifier and Type | Method and Description |
---|---|
void |
doClose() |
void |
doInit(Properties messageAttributes) |
Serializable |
doSend(Message message,
MeasurementUnit measurementUnit)
Actually performs the send operation.
|
HttpSender.Method |
getDynamicMethod(Properties placeholders)
Gets the template used to determine HTTP method dynamically.
|
List<Integer> |
getExpectedResponseCodeList()
Gets the list of expected response codes.
|
String |
getExpectedResponseCodes()
Gets the value of expectedResponseCodes property.
|
HttpSender.Method |
getMethod()
Gets the value of HTTP method.
|
boolean |
isStoreCookies()
Gets whether the sender will store cookies between requests.
|
void |
postSend(Message message)
Performs any action that needs to be done to complete the sending of the message but is not directly related to the sending operation and thus not measured.
|
void |
preSend(Message message,
Properties messageAttributes)
Performs any action that needs to be done to send the message but is not directly related to the sending operation and thus not measured.
|
HttpSender |
setDynamicMethod(String dynamicMethod)
Sets the template used to determine HTTP method dynamically.
|
HttpSender |
setExpectedResponseCodes(String expectedResponseCodes)
Sets the value of expectedResponseCodes property.
|
HttpSender |
setMethod(HttpSender.Method method)
Sets the value of HTTP method.
|
HttpSender |
setStoreCookies(boolean storeCookies)
Sets whether the sender will store cookies between requests.
|
close, getTarget, getTarget, init, isKeepConnection, safeGetTarget, send, setKeepConnection, setTarget
public void doInit(Properties messageAttributes) throws PerfCakeException
doInit
in class AbstractSender
PerfCakeException
public void doClose()
doClose
in class AbstractSender
public HttpSender setExpectedResponseCodes(String expectedResponseCodes)
expectedResponseCodes
- The expectedResponseCodes property to set.public List<Integer> getExpectedResponseCodeList()
public String getExpectedResponseCodes()
public void preSend(Message message, Properties messageAttributes) throws Exception
MessageSender
preSend
in interface MessageSender
preSend
in class AbstractSender
message
- Message to be sent.messageAttributes
- Attributes that can be used to replace placeholders in message and or target.Exception
- In case anything fails during the preparation.public Serializable doSend(Message message, MeasurementUnit measurementUnit) throws Exception
AbstractSender
doSend
in class AbstractSender
message
- Message to be sent.measurementUnit
- Measurement unit carrying the current stop-watch.Exception
- When the sending operation failed.MessageSender.send(org.perfcake.message.Message, org.perfcake.reporting.MeasurementUnit)
public void postSend(Message message) throws Exception
MessageSender
postSend
in interface MessageSender
postSend
in class AbstractSender
message
- Message that was sent.Exception
- In case anything fails during the finalization.public HttpSender.Method getMethod()
public HttpSender setMethod(HttpSender.Method method)
method
- The HTTP method to set.public HttpSender setDynamicMethod(String dynamicMethod)
dynamicMethod
- The string template to dynamically determine HTTP method.public HttpSender.Method getDynamicMethod(Properties placeholders)
placeholders
- The properties to render the string template.public boolean isStoreCookies()
public HttpSender setStoreCookies(boolean storeCookies)
storeCookies
- True if and only if the cookies should be stored between requests.Copyright © 2010–2017 PerfCake Community. All rights reserved.