org.mockserver.model
Class ConnectionOptions

java.lang.Object
  extended by org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
      extended by org.mockserver.model.ObjectWithJsonToString
          extended by org.mockserver.model.ConnectionOptions

public class ConnectionOptions
extends ObjectWithJsonToString

Author:
jamesdbloom

Field Summary
 
Fields inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
logger
 
Constructor Summary
ConnectionOptions()
           
 
Method Summary
 Boolean getCloseSocket()
           
 Integer getContentLengthHeaderOverride()
           
 Boolean getKeepAliveOverride()
           
 Boolean getSuppressConnectionHeader()
           
 Boolean getSuppressContentLengthHeader()
           
static boolean isFalseOrNull(Boolean aBoolean)
           
 ConnectionOptions withCloseSocket(Boolean closeSocket)
          Override whether the socket is closed after a response is sent: if true the socket will always be closed, if false the socket will never be closed, if not set the socket will be closed unless the request received is HTTP 1.1 and contains a "Connection" header with a value of "keep-alive"
 ConnectionOptions withContentLengthHeaderOverride(Integer contentLengthHeaderOverride)
          Override the "Content-Length" header with the specified amount, if not set the "Content-Length" header will have a value determined by the length of the body
 ConnectionOptions withKeepAliveOverride(Boolean keepAliveOverride)
          Override the "Connection" header: if true the "Connection" header is specified with a value of "keep-alive" if false the "Connection" header is specified with a value of "close" if not set the "Connection" header will have a a value of "close" unless the request received is HTTP 1.1 and contains a "Connection" header with a value of "keep-alive"
 ConnectionOptions withSuppressConnectionHeader(Boolean suppressConnectionHeader)
          Prevent a "Connection" header from being added to the response
 ConnectionOptions withSuppressContentLengthHeader(Boolean suppressContentLengthHeader)
          Prevent a "Content-Length" header from being added to the response
 
Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toString
 
Methods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
addFieldsExcludedFromEqualsAndHashCode, equals, fieldsExcludedFromEqualsAndHashCode, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionOptions

public ConnectionOptions()
Method Detail

isFalseOrNull

public static boolean isFalseOrNull(Boolean aBoolean)

withSuppressContentLengthHeader

public ConnectionOptions withSuppressContentLengthHeader(Boolean suppressContentLengthHeader)
Prevent a "Content-Length" header from being added to the response

Parameters:
suppressContentLengthHeader - if true no "Content-Length" header will be added to the response

getSuppressContentLengthHeader

public Boolean getSuppressContentLengthHeader()

withContentLengthHeaderOverride

public ConnectionOptions withContentLengthHeaderOverride(Integer contentLengthHeaderOverride)
Override the "Content-Length" header with the specified amount, if not set the "Content-Length" header will have a value determined by the length of the body

Parameters:
contentLengthHeaderOverride - the value to use for the "Content-Length" header

getContentLengthHeaderOverride

public Integer getContentLengthHeaderOverride()

withSuppressConnectionHeader

public ConnectionOptions withSuppressConnectionHeader(Boolean suppressConnectionHeader)
Prevent a "Connection" header from being added to the response

Parameters:
suppressConnectionHeader - if true no "Connection" header will be added to the response

getSuppressConnectionHeader

public Boolean getSuppressConnectionHeader()

withKeepAliveOverride

public ConnectionOptions withKeepAliveOverride(Boolean keepAliveOverride)
Override the "Connection" header: if true the "Connection" header is specified with a value of "keep-alive" if false the "Connection" header is specified with a value of "close" if not set the "Connection" header will have a a value of "close" unless the request received is HTTP 1.1 and contains a "Connection" header with a value of "keep-alive"

Parameters:
keepAliveOverride - if true "keep-alive" is used if false "close" is used for the "Connection" header

getCloseSocket

public Boolean getCloseSocket()

withCloseSocket

public ConnectionOptions withCloseSocket(Boolean closeSocket)
Override whether the socket is closed after a response is sent: if true the socket will always be closed, if false the socket will never be closed, if not set the socket will be closed unless the request received is HTTP 1.1 and contains a "Connection" header with a value of "keep-alive"

Parameters:
closeSocket - set whether the socket is closed after a response is sent

getKeepAliveOverride

public Boolean getKeepAliveOverride()


Copyright © 2015. All rights reserved.