public class BeowulfJConfig extends Object
The setters can be used to override the default values.
| Modifier and Type | Method and Description |
|---|---|
void |
addEndpointURI(URI endpointURI)
This method has the same functionality than
setEndpointURI(URI, boolean), but
this method will enable the SSL verification by default. |
void |
addEndpointURI(URI endpointURI,
boolean sslVerificationDisabled)
Configure the connection to the Beowulf Node by providing the endpoint URI
and the SSL verification settings.
|
AddressPrefixType |
getAddressPrefix()
Get the currently configured address prefix.
|
char[] |
getApiPassword()
Get the currently configured password used to login at a Beowulf Node to
access protected APIs.
|
AccountName |
getApiUsername()
Get the currently configured account name used to login at a Beowulf Node
to access protected APIs.
|
static AccountName |
getBeowulfJAccount() |
static String |
getBeowulfJAppName()
Get the application name of BeowulfJ.
|
static String |
getBeowulfJVersion()
Get the version of BeowulfJ that is currently used.
|
short |
getBeowulfJWeight()
Get the currently configured beneficiary weight.
|
String |
getChainId()
Get the currently configured chain id used to sign transactions.
|
javax.websocket.ClientEndpointConfig |
getClientEndpointConfig()
Get the configured ClientEndpointConfig instance.
|
String |
getDateTimePattern()
Get the currently configured date time pattern.
|
AccountName |
getDefaultAccount()
Get the currently configured default account name.
|
String |
getDefaultBeowulfApiUri()
Get current super node
|
AssetSymbolType |
getDollarSymbol()
Get the currently configured
AssetSymbolType for dollars (e.g. |
Charset |
getEncodingCharset()
Get the currently configured Charset that will be used to encode Strings.
|
List<org.apache.commons.lang3.tuple.Pair<URI,Boolean>> |
getEndpointURIs() |
int |
getIdleTimeout()
Get the configured, maximum time that BeowulfJ will keep an unused
connection open.
|
static BeowulfJConfig |
getInstance()
Receive a
BeowulfJConfig instance. |
long |
getMaximumExpirationDateOffset()
Get the currently configured maximum offset of the expiration date.
|
NetworkProperties |
getNetwork() |
static BeowulfJConfig |
getNewInstance()
Overrides the current
BeowulfJConfig
instance and returns a new one. |
org.apache.commons.lang3.tuple.Pair<URI,Boolean> |
getNextEndpointURI(int selector)
Get one of the configured endpoint URIs by providing a
selector. |
PrivateKeyStorage |
getPrivateKeyStorage()
Get the private key storage to manage the private keys for one or
multiple accounts.
|
int |
getResponseTimeout()
Get the configured, maximum time that BeowulfJ will wait for an answer of
the endpoint before throwing a
BeowulfTimeoutException exception. |
SynchronizationType |
getSynchronizationLevel()
Get the currently configured
synchronizationLevel. |
String |
getTimeZoneId()
Get the currently configured time zone id.
|
AssetSymbolType |
getTokenSymbol()
Get the currently configured
AssetSymbolType for tokens (e.g. |
ValidationType |
getValidationLevel()
Get the currently configured validation level.
|
AssetSymbolType |
getVestsSymbol()
Get the currently configured
AssetSymbolType for M. |
void |
setAddressPrefix(AddressPrefixType addressPrefix)
Set the address prefix.
|
void |
setApiPassword(char[] apiPassword)
Set the password which should be used to login to a node.
|
void |
setApiUsername(AccountName apiUsername)
Set the account name which should be used to login to a node.
|
void |
setBeowulfJWeight(short beowulfJWeight)
Set the currently configured beneficiary weight.
|
void |
setChainId(String chainId)
Set the chain id used to sign transactions.
|
void |
setClientEndpointConfig(javax.websocket.ClientEndpointConfig clientEndpointConfig)
Override the default ClientEndpointConfig instance.
|
void |
setDateTime(String dateTimePattern,
String timeZoneId)
Override the default date pattern.
|
void |
setDefaultAccount(AccountName defaultAccount)
Set the default account used for simplified operations.
|
void |
setDefaultBeowulfApiUri(String apiUri)
Override the currently configured
DEFAULT_BEOWULF_API_URI. |
void |
setDollarSymbol(AssetSymbolType dollarSymbol)
Override the default
dollarSymbol. |
void |
setEncodingCharset(Charset encodingCharset)
Define the Charset that should be used to encode Strings.
|
void |
setEndpointURIs(List<org.apache.commons.lang3.tuple.Pair<URI,Boolean>> endpointURIs)
Override the currently configured
endpointURIs. |
void |
setIdleTimeout(int idleTimeout)
Override the default, maximum time that BeowulfJ will keep an unused
connection open.A value that is 0 or negative indicates the sessions will
never timeout due to inactivity.
|
void |
setMaximumExpirationDateOffset(long maximumExpirationDateOffset)
A Beowulf Node will only accept transactions whose expiration date is not
to far in the future.
|
void |
setNetwork(NetworkProperties network) |
void |
setResponseTimeout(int responseTimeout)
Override the default, maximum time that BeowulfJ will wait for an answer of
the Beowulf Node.
|
void |
setSynchronizationLevel(SynchronizationType synchronizationLevel)
Override the currently configured
synchronizationLevel. |
void |
setTokenSymbol(AssetSymbolType tokenSymbol)
Override the default
tokenSymbol. |
void |
setValidationLevel(ValidationType validationLevel)
Override the default validation level that BeowulfJ will use to validate if
an Object contains valid information before broadcasting it to the Beowulf
Node.
|
void |
setVestsSymbol(AssetSymbolType vestsSymbol)
Override the default
vestsSymbol. |
public static BeowulfJConfig getInstance()
BeowulfJConfig instance.public static BeowulfJConfig getNewInstance()
BeowulfJConfig
instance and returns a new one.public static AccountName getBeowulfJAccount()
public static String getBeowulfJVersion()
public static String getBeowulfJAppName()
public SynchronizationType getSynchronizationLevel()
synchronizationLevel.
The synchronizationLevel defines which values should be
synchronized between this BeowulfJ instance and the connected node. By
default, BeowulfJ will synchronize as much as possible.
public void setSynchronizationLevel(SynchronizationType synchronizationLevel)
synchronizationLevel.
The synchronizationLevel defines which values should be
synchronized between this BeowulfJ instance and the connected node. By
default, BeowulfJ will synchronize as much as possible.
synchronizationLevel - The synchronization level to set.public String getDefaultBeowulfApiUri()
public void setDefaultBeowulfApiUri(String apiUri)
DEFAULT_BEOWULF_API_URI.
The DEFAULT_BEOWULF_API_URI define what super node to interact with
apiUri - The api Uri to set.public char[] getApiPassword()
public void setApiPassword(char[] apiPassword)
apiPassword - The password to use.public AccountName getApiUsername()
public void setApiUsername(AccountName apiUsername)
apiUsername - The account name to use.public AccountName getDefaultAccount()
public void setDefaultAccount(AccountName defaultAccount)
defaultAccount - The account to set.public String getChainId()
public void setChainId(String chainId)
chainId - The chain id to set.public javax.websocket.ClientEndpointConfig getClientEndpointConfig()
clientEndpointConfig is only used for WebSocket
endpoints.public void setClientEndpointConfig(javax.websocket.ClientEndpointConfig clientEndpointConfig)
clientEndpointConfig - The configuration of the client end point.public String getDateTimePattern()
public Charset getEncodingCharset()
public void setEncodingCharset(Charset encodingCharset)
encodingCharset - A Charset instance like StandardCharsets.UTF_8.public long getMaximumExpirationDateOffset()
public void setMaximumExpirationDateOffset(long maximumExpirationDateOffset)
Example:
Time now: 2017-04-20 20:33 Latest allowed expiration date: 2017-04-20
21:24
The difference between $NOW and the $MAXIMAL_ALLOWED_TIME can be configured here.
maximumExpirationDateOffset - The offset in milliseconds.public PrivateKeyStorage getPrivateKeyStorage()
The private keys have been defined by the account creator (e.g. beowulf.com) and are required to write data on the blockchain.
public AddressPrefixType getAddressPrefix()
public void setAddressPrefix(AddressPrefixType addressPrefix)
addressPrefix - The address prefix to set.public int getResponseTimeout()
BeowulfTimeoutException exception.public void setResponseTimeout(int responseTimeout)
0 the timeout mechanism will be
disabled.responseTimeout - Time in milliseconds.IllegalArgumentException - If the value of timeout is negative.public int getIdleTimeout()
public void setIdleTimeout(int idleTimeout)
idleTimeout - The time in milliseconds a connection should be left intact
even when no activities are performed.public String getTimeZoneId()
public List<org.apache.commons.lang3.tuple.Pair<URI,Boolean>> getEndpointURIs()
public void setEndpointURIs(List<org.apache.commons.lang3.tuple.Pair<URI,Boolean>> endpointURIs)
endpointURIs.endpointURIs - A list of endpoints to connect to.public org.apache.commons.lang3.tuple.Pair<URI,Boolean> getNextEndpointURI(int selector)
selector.selector - A number used to calculate the next stored endpoint URI from
the list of configured endpoint URIs.public short getBeowulfJWeight()
public void setBeowulfJWeight(short beowulfJWeight)
beowulfJWeight - The beneficiary weight for BeowulfJ.public void setDateTime(String dateTimePattern, String timeZoneId)
dateTimePattern - The date time pattern used for serialization/deserialization.timeZoneId - The time zone id used for serialization/deserialization (e.g.
"UTC").public void addEndpointURI(URI endpointURI) throws URISyntaxException
setEndpointURI(URI, boolean), but
this method will enable the SSL verification by default.endpointURI - The URI of the node you want to connect to.URISyntaxException - If the endpointURI is null.public void addEndpointURI(URI endpointURI, boolean sslVerificationDisabled) throws URISyntaxException
endpointURI - The URI of the node you want to connect to.sslVerificationDisabled - Define if BeowulfJ should verify the SSL certificate of the
endpoint. This option will be ignored if the given
endpointURI is using a non SSL protocol.URISyntaxException - If the endpointURI is null.public ValidationType getValidationLevel()
public void setValidationLevel(ValidationType validationLevel)
validationLevel - The validation level to set.public AssetSymbolType getDollarSymbol()
AssetSymbolType for dollars (e.g.
W). The configured symbol type is used to validate M fields of
operations.AssetSymbolType for dollars.public void setDollarSymbol(AssetSymbolType dollarSymbol)
dollarSymbol. The configured symbol
type is used to validate M fields of operations.dollarSymbol - The AssetSymbolType for dollars to set.public AssetSymbolType getTokenSymbol()
AssetSymbolType for tokens (e.g.
BWF). The configured symbol type is used to validate M fields of
operations.AssetSymbolType for tokens.public void setTokenSymbol(AssetSymbolType tokenSymbol)
tokenSymbol. The configured symbol type
is used to validate token fields of operations.tokenSymbol - The AssetSymbolType for tokens to set.public AssetSymbolType getVestsSymbol()
AssetSymbolType for M. The
configured symbol type is used to validate M fields of operations.AssetSymbolType for M.public void setVestsSymbol(AssetSymbolType vestsSymbol)
vestsSymbol. The configured symbol type
is used to validate M fields of operations.vestsSymbol - The AssetSymbolType for M to set.public NetworkProperties getNetwork()
public void setNetwork(NetworkProperties network)
Copyright © 2019. All rights reserved.