public interface ClientConfiguer<ConfiguerT>
Modifier and Type | Method and Description |
---|---|
ConfiguerT |
addConfiguration(java.lang.String key,
java.lang.String value)
Add a configuration with
key and value . |
ConfiguerT |
withBlockingConnect()
Use blocking connection.
|
ConfiguerT |
withEndpoint(java.lang.String endpoint)
Provide an endpoint of aergo server.
|
ConfiguerT |
withNonBlockingConnect()
Use non-blocking connection.
|
ConfiguerT |
withPlainText()
Use plain text on connection.
|
ConfiguerT |
withRetry(int count,
long interval,
java.util.concurrent.TimeUnit unit)
If fails with non-connection error, after
interval count times. |
ConfiguerT |
withTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Set timeout for each request.
|
ConfiguerT |
withTransportSecurity(java.lang.String serverCommonName,
java.io.InputStream serverCertInputStream,
java.io.InputStream clientCertInputStream,
java.io.InputStream clientKeyInputStream)
Use transport security on connection.
|
ConfiguerT |
withTransportSecurity(java.lang.String serverCommonName,
java.lang.String serverCertPath,
java.lang.String clientCertPath,
java.lang.String clientKeyPath)
Use transport security on connection.
|
ConfiguerT addConfiguration(java.lang.String key, java.lang.String value)
key
and value
.key
- a keyvalue
- a valueConfiguerT withEndpoint(java.lang.String endpoint)
localhost:7845
endpoint
- aergo chain server endpointConfiguerT withNonBlockingConnect()
ConnectStrategy
is already set, that will be
overridden.ConfiguerT withBlockingConnect()
ConnectStrategy
is already set, that will be
overridden. This method works for jdk 1.7 or higher.ConfiguerT withTimeout(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- time to time outunit
- time's unitConfiguerT withRetry(int count, long interval, java.util.concurrent.TimeUnit unit)
interval
count
times. Default retry
count : 0, default retry interval : 5000 milliseconds.count
- retry count. If it is less than 0, set as 0interval
- interval value. If it's less than 0, set as 0unit
- interval unitConfiguerT withPlainText()
ConfiguerT withTransportSecurity(java.lang.String serverCommonName, java.lang.String serverCertPath, java.lang.String clientCertPath, java.lang.String clientKeyPath)
serverCommonName
- a server common nameserverCertPath
- a server certification pathclientCertPath
- a client certification pathclientKeyPath
- a client key path. Must be PKCS#8 formatConfiguerT withTransportSecurity(java.lang.String serverCommonName, java.io.InputStream serverCertInputStream, java.io.InputStream clientCertInputStream, java.io.InputStream clientKeyInputStream)
serverCommonName
- a server common nameserverCertInputStream
- a server certification streamclientCertInputStream
- a client certification streamclientKeyInputStream
- a client key stream. Must be PKCS#8 format