Package nxt.peer

Class NetworkMessage.GetInfoMessage

java.lang.Object
nxt.peer.NetworkMessage
nxt.peer.NetworkMessage.GetInfoMessage
Enclosing class:
NetworkMessage

public static class NetworkMessage.GetInfoMessage extends 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)
  • 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 name
      appVersion - Application version
      appPlatform - Application platform
      shareAddress - TRUE to share the network address with peers
      announcedAddress - Announced address or null
      apiPort - API port
      sslPort - API SSL port
      services - Available application services
      disabledAPIs - Disabled API names
      apiServerIdleTimeout - API server idle timeout
      peerPublicKey - 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:
      constructMessage in class NetworkMessage
      Parameters:
      bytes - Message bytes following the message name
      Returns:
      Message
      Throws:
      BufferOverflowException - Message buffer is too small
      BufferUnderflowException - Message is too short
      nxt.peer.NetworkException - Message is not valid
    • getApplicationName

      public String getApplicationName()
      Get the application name
      Returns:
      Application name or null if no name specified
    • getApplicationVersion

      public String getApplicationVersion()
      Get the application version
      Returns:
      Application version or null if no version specified
    • getApplicationPlatform

      public String getApplicationPlatform()
      Get the application platform
      Returns:
      Application platform or null if no platform specified
    • getShareAddress

      public boolean getShareAddress()
      Check if the network address should be shared
      Returns:
      TRUE if the address should be shared
    • getAnnouncedAddress

      public String 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

      public String 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

      public Peer.BlockchainState getBlockchainState()
      Get the blockchain state
      Returns:
      Blockchain state
    • setBlockchainState

      public void setBlockchainState(Peer.BlockchainState blockchainState)
      Set the blockchain state
      Parameters:
      blockchainState - Blockchain state
    • getSecurityToken

      public SecurityToken getSecurityToken()
      Get the authentication security token
      Returns:
      Authentication security token or null