Constructor and Description |
---|
J4pClientBuilder()
Package access constructor, use static method on J4pClient for creating
the builder.
|
Modifier and Type | Method and Description |
---|---|
J4pClientBuilder |
authenticator(J4pAuthenticator pAuthenticator)
Set the authenticator for this client
|
J4pClient |
build()
Build the agent with the information given before
|
J4pClientBuilder |
connectionTimeout(int pTimeOut)
Determines the timeout in milliseconds until a connection is established.
|
J4pClientBuilder |
contentCharset(Charset pContentCharset)
Defines the charset to be used per default for encoding content body.
|
J4pClientBuilder |
contentCharset(String pContentCharset)
Defines the charset to be used per default for encoding content body.
|
J4pClientBuilder |
cookieStore(org.apache.http.client.CookieStore pCookieStore)
Use the given cookie store.
|
org.apache.http.client.HttpClient |
createHttpClient() |
J4pClientBuilder |
defaultMaxConnectionsPerRoute(int pDefaultMaxConnectionsPerRoute)
Sets the maximum number of connections per route allowed when using
pooledConnections() |
J4pClientBuilder |
expectContinue(boolean pUse)
Activates 'Expect: 100-Continue' handshake for the entity enclosing methods.
|
J4pClientBuilder |
maxConnectionPoolTimeout(int pConnectionPoolTimeout)
Sets the timeout in milliseconds used when retrieving a connection
from the connection manager.
|
J4pClientBuilder |
maxTotalConnections(int pConnections)
Sets the maximum number of connections allowed when using
pooledConnections() . |
J4pClientBuilder |
password(String pPassword)
Password for authentication
|
J4pClientBuilder |
pooledConnections()
Use a pooled connection manager for connecting to the agent, which
uses a pool of connections (see
#maxTotalConnections(int), {@link #maxConnectionPoolTimeout(int) {@link #defaultMaxConnectionsPerRoute}} for
tuning the pool |
J4pClientBuilder |
proxy(String pProxy)
Set the proxy for this client
|
J4pClientBuilder |
proxy(String pProxyHost,
int pProxyPort)
Set the proxy for this client
|
J4pClientBuilder |
proxy(String pProxyHost,
int pProxyPort,
String pProxyUser,
String pProxyPass)
Set the proxy for this client
|
J4pClientBuilder |
responseExtractor(J4pResponseExtractor pResponseExtractor)
Set the response extractor to use for handling single responses.
|
J4pClientBuilder |
singleConnection()
Use a single threaded client for connecting to the agent.
|
J4pClientBuilder |
socketBufferSize(int pSize)
Determines the size of the internal socket buffer used to buffer data while receiving /
transmitting HTTP messages.
|
J4pClientBuilder |
socketTimeout(int pTimeOut)
Defines the socket timeout (
SO_TIMEOUT ) in milliseconds,
which is the timeout for waiting for data or, put differently,
a maximum period inactivity between two consecutive data packets). |
J4pClientBuilder |
sslConnectionSocketFactory(org.apache.http.conn.socket.ConnectionSocketFactory pSslConnectionSocketFactory)
Set the SSL connection factory to use when connecting via SSL.
|
J4pClientBuilder |
target(String pUrl)
Target service URL when using the agent as a JSR-160 proxy
|
J4pClientBuilder |
targetPassword(String pPassword)
Target password for proxy mode.
|
J4pClientBuilder |
targetUser(String pUser)
Target user for proxy mode.
|
J4pClientBuilder |
tcpNoDelay(boolean pUse)
Determines whether Nagle's algorithm is to be used.
|
J4pClientBuilder |
url(String pUrl)
The Agent URL to connect to
|
J4pClientBuilder |
useProxyFromEnvironment()
Set the proxy for this client based on http_proxy system environment variable
|
J4pClientBuilder |
user(String pUser)
User to use for authentication
|
public J4pClientBuilder()
public final J4pClientBuilder url(String pUrl)
pUrl
- agent URLpublic final J4pClientBuilder user(String pUser)
pUser
- user namepublic final J4pClientBuilder password(String pPassword)
pPassword
- password to usepublic final J4pClientBuilder target(String pUrl)
pUrl
- JMX service URL for the 'real' target (that gets contacted by the agent)public final J4pClientBuilder targetUser(String pUser)
pUser
- User to be used for authentication in JSR-160 proxy communicationpublic final J4pClientBuilder targetPassword(String pPassword)
pPassword
- Password to be used for authentication in JSR-160 proxy communicationpublic final J4pClientBuilder singleConnection()
public final J4pClientBuilder pooledConnections()
#maxTotalConnections(int), {@link #maxConnectionPoolTimeout(int) {@link #defaultMaxConnectionsPerRoute}} for
tuning the pool
public final J4pClientBuilder connectionTimeout(int pTimeOut)
pTimeOut
- timeout in millisecondspublic final J4pClientBuilder socketTimeout(int pTimeOut)
SO_TIMEOUT
) in milliseconds,
which is the timeout for waiting for data or, put differently,
a maximum period inactivity between two consecutive data packets).
A timeout value of zero is interpreted as an infinite timeout, a negative value means the system default.pTimeOut
- SO_TIMEOUT value in milliseconds, 0 mean no timeout at all.public final J4pClientBuilder maxTotalConnections(int pConnections)
pooledConnections()
.pConnections
- number of max. simultaneous connections.public final J4pClientBuilder defaultMaxConnectionsPerRoute(int pDefaultMaxConnectionsPerRoute)
pooledConnections()
pDefaultMaxConnectionsPerRoute
- number of max connections per route.public final J4pClientBuilder maxConnectionPoolTimeout(int pConnectionPoolTimeout)
pConnectionPoolTimeout
- timeout in millisecondspublic final J4pClientBuilder contentCharset(String pContentCharset)
pContentCharset
- the charset to usepublic final J4pClientBuilder contentCharset(Charset pContentCharset)
pContentCharset
- the charset to usepublic final J4pClientBuilder expectContinue(boolean pUse)
pUse
- whether to use this algorithm or notpublic final J4pClientBuilder tcpNoDelay(boolean pUse)
pUse
- whether to use NO_DELAY or notpublic final J4pClientBuilder socketBufferSize(int pSize)
pSize
- size of socket bufferpublic final J4pClientBuilder cookieStore(org.apache.http.client.CookieStore pCookieStore)
pCookieStore
- cookiestore containing the cookies to send for requests.public final J4pClientBuilder authenticator(J4pAuthenticator pAuthenticator)
pAuthenticator
- authenticator used for checking the given user and password (if any).public final J4pClientBuilder proxy(String pProxy)
pProxy
- proxy definition in the format http://user:pass@host:port
or http://host:port
Example: http://tom:sEcReT@my.proxy.com:8080
public final J4pClientBuilder proxy(String pProxyHost, int pProxyPort)
pProxyHost
- proxy hostnamepProxyPort
- proxy port numberpublic final J4pClientBuilder proxy(String pProxyHost, int pProxyPort, String pProxyUser, String pProxyPass)
pProxyHost
- proxy hostnamepProxyPort
- proxy port numberpProxyUser
- proxy authentication usernamepProxyPass
- proxy authentication passwordpublic final J4pClientBuilder useProxyFromEnvironment()
public final J4pClientBuilder responseExtractor(J4pResponseExtractor pResponseExtractor)
pResponseExtractor
- response extractor to use.public final J4pClientBuilder sslConnectionSocketFactory(org.apache.http.conn.socket.ConnectionSocketFactory pSslConnectionSocketFactory)
pSslConnectionSocketFactory
- the SSL connection factory to usepublic J4pClient build()
public org.apache.http.client.HttpClient createHttpClient()
Copyright © 2021. All rights reserved.