public interface Peer
Modifier and Type | Interface and Description |
---|---|
static class |
Peer.BlockchainState |
static class |
Peer.Service
Peer services
|
static class |
Peer.State
Peer state
|
Modifier and Type | Method and Description |
---|---|
void |
blacklist(java.lang.Exception cause)
Blacklist the peer
|
void |
blacklist(java.lang.String cause)
Blacklist the peer
|
void |
connectPeer()
Connect the peer
|
void |
disconnectPeer()
Disconnect the peer
|
java.lang.String |
getAnnouncedAddress()
Get the announced address
|
int |
getApiPort()
Get the open API port
|
int |
getApiServerIdleTimeout() |
int |
getApiSSLPort()
Get the open SSL port
|
java.lang.String |
getApplication()
Get the application name
|
java.lang.String |
getBlacklistingCause()
Get the blacklist reason
|
Peer.BlockchainState |
getBlockchainState() |
java.util.Set<APIEnum> |
getDisabledAPIs() |
long |
getDownloadedVolume()
Get the download volume
|
java.lang.String |
getHost()
Get the peer host address
|
int |
getLastConnectAttempt()
Get the time of the last connect attempt
|
int |
getLastUpdated()
Get the time when the last message was received from the peer
|
java.lang.StringBuilder |
getPeerApiUri() |
java.lang.String |
getPlatform()
Get the application platform
|
int |
getPort()
Get the peer port
|
java.lang.String |
getSoftware()
Get the software description as 'name(version)@platform'
|
Peer.State |
getState()
Get the peer state
|
long |
getUploadedVolume()
Get the upload volume
|
java.lang.String |
getVersion()
Get the application version
|
boolean |
isApiConnectable() |
boolean |
isBlacklisted()
Check if peer is blacklisted
|
boolean |
isHandshakePending()
Check if the connection handshake is in progress
|
boolean |
isInbound()
Check if this is an inbound connection
|
boolean |
isOpenAPI() |
boolean |
providesService(Peer.Service service)
Check if the peer provides the specified service
|
boolean |
providesServices(long services)
Check if the peer provides the specifies services
|
void |
sendMessage(NetworkMessage message)
Send an asynchronous message
|
NetworkMessage |
sendRequest(NetworkMessage message)
Send a request and wait for a response
|
boolean |
shareAddress()
Check if address should be shared
|
void |
unBlacklist()
Unblacklist the peer
|
void |
waitHandshake()
Wait for the initial exchange of GetInfo messages to complete
|
Peer.State getState()
java.lang.String getHost()
java.lang.String getAnnouncedAddress()
long getDownloadedVolume()
long getUploadedVolume()
java.lang.String getApplication()
java.lang.String getVersion()
java.lang.String getPlatform()
java.lang.String getSoftware()
int getPort()
int getApiPort()
int getApiSSLPort()
boolean shareAddress()
java.util.Set<APIEnum> getDisabledAPIs()
int getApiServerIdleTimeout()
Peer.BlockchainState getBlockchainState()
boolean isBlacklisted()
java.lang.String getBlacklistingCause()
void connectPeer()
boolean isHandshakePending()
void disconnectPeer()
void blacklist(java.lang.Exception cause)
cause
- Exception causing the blacklistvoid blacklist(java.lang.String cause)
cause
- Blacklist reasonvoid unBlacklist()
int getLastUpdated()
int getLastConnectAttempt()
boolean isInbound()
boolean providesService(Peer.Service service)
service
- Serviceboolean isOpenAPI()
boolean isApiConnectable()
java.lang.StringBuilder getPeerApiUri()
boolean providesServices(long services)
services
- Services as a bit mapvoid sendMessage(NetworkMessage message)
message
- Network messageNetworkMessage sendRequest(NetworkMessage message)
message
- Request messagevoid waitHandshake()