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)

- - ### 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, messageId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GetInfoMessage(java.lang.String appName, java.lang.String appVersion, java.lang.String appPlatform, boolean shareAddress, java.lang.String announcedAddress, int apiPort, int sslPort, long services, java.lang.String disabledAPIs, int apiServerIdleTimeout, byte[] peerPublicKey)` Construct a GetInfo message

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected NetworkMessage` | `constructMessage(java.nio.ByteBuffer bytes)` Construct the message from the message bytes
    `java.lang.String` | `getAnnouncedAddress()` Get the announced address
    `int` | `getApiPort()` Get the API port
    `int` | `getApiServerIdleTimeout()` Get the API server idle timeout
    `java.lang.String` | `getApplicationName()` Get the application name
    `java.lang.String` | `getApplicationPlatform()` Get the application platform
    `java.lang.String` | `getApplicationVersion()` Get the application version
    `Peer.BlockchainState` | `getBlockchainState()` Get the blockchain state
    `java.lang.String` | `getDisabledAPIs()` Get the disabledAPIs
    `SecurityToken` | `getSecurityToken()` Get the authentication security token
    `long` | `getServices()` Get the available services
    `boolean` | `getShareAddress()` Check if the network address should be shared
    `int` | `getSslPort()` Get the SSL port
    `void` | `setBlockchainState(Peer.BlockchainState blockchainState)` Set the blockchain state

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GetInfoMessage

          public GetInfoMessage(java.lang.String appName,
                                java.lang.String appVersion,
                                java.lang.String appPlatform,
                                boolean shareAddress,
                                java.lang.String announcedAddress,
                                int apiPort,
                                int sslPort,
                                long services,
                                java.lang.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 Detail

    - #### constructMessage

          protected NetworkMessage constructMessage(java.nio.ByteBuffer bytes)
                                             throws java.nio.BufferOverflowException,
                                                    java.nio.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:
        `java.nio.BufferOverflowException` - Message buffer is too small
        `java.nio.BufferUnderflowException` - Message is too short
        `NetworkException` - Message is not valid

    - #### getApplicationName

          public java.lang.String getApplicationName()

      Get the application name
      Returns:
        Application name or null if no name specified

    - #### getApplicationVersion

          public java.lang.String getApplicationVersion()

      Get the application version
      Returns:
        Application version or null if no version specified

    - #### getApplicationPlatform

          public java.lang.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 java.lang.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 java.lang.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