| 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 |
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
and {@link #maxConnectionPoolTimeout(int)} for
tuning the pool |
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 |
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 |
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()
and {@link #maxConnectionPoolTimeout(int)} for
tuning the poolpublic 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 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 J4pClient build()
public org.apache.http.client.HttpClient createHttpClient()
Copyright © 2014. All rights reserved.