Package nxt.peer
Class NetworkMessage.GetInfoMessage
java.lang.Object
nxt.peer.NetworkMessage
nxt.peer.NetworkMessage.GetInfoMessage
- Enclosing class:
- NetworkMessage
The GetInfo message is exchanged when a peer connection is established. There is no response message.
- Application name (string)
- Application version (string)
- Application platform (string)
- Share address (boolean)
- Announced address (string)
- API port (short)
- SSL port (short)
- Available services (long)
- Disabled APIs (string)
- APIServer idle timeout (integer)
- Blockchain state (integer)
- Security token (variable length)
-
Nested Class Summary
Nested classes/interfaces inherited from class nxt.peer.NetworkMessage
NetworkMessage.AddPeersMessage, NetworkMessage.BlockchainStateMessage, NetworkMessage.BlockIdsMessage, NetworkMessage.BlockInventoryMessage, NetworkMessage.BlocksMessage, NetworkMessage.BundlerRateMessage, NetworkMessage.CumulativeDifficultyMessage, NetworkMessage.ErrorMessage, NetworkMessage.GetBlockMessage, NetworkMessage.GetCumulativeDifficultyMessage, NetworkMessage.GetInfoMessage, NetworkMessage.GetMilestoneBlockIdsMessage, NetworkMessage.GetNextBlockIdsMessage, NetworkMessage.GetNextBlocksMessage, NetworkMessage.GetPeersMessage, NetworkMessage.GetTransactionsMessage, NetworkMessage.GetUnconfirmedTransactionsMessage, NetworkMessage.MilestoneBlockIdsMessage, NetworkMessage.TransactionsInventoryMessage, NetworkMessage.TransactionsMessage -
Field Summary
Fields inherited from class nxt.peer.NetworkMessage
MAX_ARRAY_LENGTH, MAX_LIST_SIZE, MAX_LIST_SIZE_PRE_2_3_3, messageId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NetworkMessageconstructMessage(ByteBuffer bytes) Construct the message from the message bytesGet the announced addressintGet the API portintGet the API server idle timeoutGet the application nameGet the application platformGet the application versionGet the blockchain stateGet the disabledAPIsGet the authentication security tokenlongGet the available servicesbooleanCheck if the network address should be sharedintGet the SSL portvoidsetBlockchainState(Peer.BlockchainState blockchainState) Set the blockchain state
-
Constructor Details
-
GetInfoMessage
public GetInfoMessage(String appName, String appVersion, String appPlatform, boolean shareAddress, String announcedAddress, int apiPort, int sslPort, long services, String disabledAPIs, int apiServerIdleTimeout, byte[] peerPublicKey) Construct a GetInfo message- Parameters:
appName- Application nameappVersion- Application versionappPlatform- Application platformshareAddress- TRUE to share the network address with peersannouncedAddress- Announced address or nullapiPort- API portsslPort- API SSL portservices- Available application servicesdisabledAPIs- Disabled API namesapiServerIdleTimeout- API server idle timeoutpeerPublicKey- Peer public key or null
-
-
Method Details
-
constructMessage
protected NetworkMessage constructMessage(ByteBuffer bytes) throws BufferOverflowException, BufferUnderflowException, nxt.peer.NetworkException Construct the message from the message bytes- Overrides:
constructMessagein classNetworkMessage- Parameters:
bytes- Message bytes following the message name- Returns:
- Message
- Throws:
BufferOverflowException- Message buffer is too smallBufferUnderflowException- Message is too shortnxt.peer.NetworkException- Message is not valid
-
getApplicationName
Get the application name- Returns:
- Application name or null if no name specified
-
getApplicationVersion
Get the application version- Returns:
- Application version or null if no version specified
-
getApplicationPlatform
Get the application platform- Returns:
- Application platform or null if no platform specified
-
getAnnouncedAddress
Get the announced address- Returns:
- Announced address or null if no address specified
-
getApiPort
public int getApiPort()Get the API port- Returns:
- API port
-
getSslPort
public int getSslPort()Get the SSL port- Returns:
- SSL port
-
getServices
public long getServices()Get the available services- Returns:
- Service bits
-
getDisabledAPIs
Get the disabledAPIs- Returns:
- disabledAPIs as base64 encoded string
-
getApiServerIdleTimeout
public int getApiServerIdleTimeout()Get the API server idle timeout- Returns:
- APIServer idle timeout
-
getBlockchainState
Get the blockchain state- Returns:
- Blockchain state
-
setBlockchainState
Set the blockchain state- Parameters:
blockchainState- Blockchain state
-
getSecurityToken
Get the authentication security token- Returns:
- Authentication security token or null
-