org.apache.ignite.spi.discovery.tcp.ipfinder.gce

## Class TcpDiscoveryGoogleStorageIpFinder

- java.lang.Object
- - org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter
  - - org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder

- All Implemented Interfaces:
    TcpDiscoveryIpFinder

      public class TcpDiscoveryGoogleStorageIpFinder
      extends TcpDiscoveryIpFinderAdapter

  Google Cloud Storage based IP finder.

  For information about Cloud Storage visit cloud.google.com.

  # Configuration

  ## Mandatory

  - Service Account Id (see `setServiceAccountId(String)`)
  - Service Account P12 key file path (see `setServiceAccountP12FilePath(String)`)
  - Google Platform project name (see `setProjectName(String)`)
  - Google Storage bucket name (see `setBucketName(String)`)

  ## Optional

  - Shared flag (see `setShared(boolean)`)

  The finder will create a bucket with the provided name. The bucket will contain entries named like the following: `192.168.1.136#1001`.

  Note that storing data in Google Cloud Storage service will result in charges to your Google Cloud Platform account. Choose another implementation of `TcpDiscoveryIpFinder` for local or home network tests.

  Note that this finder is shared by default (see `TcpDiscoveryIpFinder.isShared()`.

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter

      `ignite`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TcpDiscoveryGoogleStorageIpFinder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<InetSocketAddress>` | `getRegisteredAddresses()` Gets all addresses registered in this finder.
    `void` | `registerAddresses(Collection<InetSocketAddress> addrs)` Registers new addresses.
    `TcpDiscoveryGoogleStorageIpFinder` | `setBucketName(String bucketName)` Sets Google Cloud Storage bucket name.
    `TcpDiscoveryGoogleStorageIpFinder` | `setProjectName(String projectName)` Sets Google Cloud Platforms project name.
    `TcpDiscoveryGoogleStorageIpFinder` | `setServiceAccountId(String id)` Sets the service account ID (typically an e-mail address).
    `TcpDiscoveryGoogleStorageIpFinder` | `setServiceAccountP12FilePath(String p12FileName)` Sets a full path to the private key in PKCS12 format of the Service Account.
    `TcpDiscoveryGoogleStorageIpFinder` | `setShared(boolean shared)` Sets shared flag.
    `String` | `toString()`
    `void` | `unregisterAddresses(Collection<InetSocketAddress> addrs)` Unregisters provided addresses.

    - ### Methods inherited from class org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter

      `close, discoveryClientMode, initializeLocalAddresses, isShared, onSpiContextDestroyed, onSpiContextInitialized, spiContext`

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

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

- - ### Constructor Detail

    - #### TcpDiscoveryGoogleStorageIpFinder

          public TcpDiscoveryGoogleStorageIpFinder()

  - ### Method Detail

    - #### getRegisteredAddresses

          public Collection<InetSocketAddress> getRegisteredAddresses()
                                                               throws IgniteSpiException

      Gets all addresses registered in this finder.
      Returns:
        All known addresses, potentially empty, but never `null`.
      Throws:
        `IgniteSpiException` - In case of error.

    - #### registerAddresses

          public void registerAddresses(Collection<InetSocketAddress> addrs)
                                 throws IgniteSpiException

      Registers new addresses.

      Implementation should accept duplicates quietly, but should not register address if it is already registered.

      Parameters:
        `addrs` - Addresses to register. Not `null` and not empty.
      Throws:
        `IgniteSpiException` - In case of error.

    - #### unregisterAddresses

          public void unregisterAddresses(Collection<InetSocketAddress> addrs)
                                   throws IgniteSpiException

      Unregisters provided addresses.

      Implementation should accept addresses that are currently not registered quietly (just no-op).

      Parameters:
        `addrs` - Addresses to unregister. Not `null` and not empty.
      Throws:
        `IgniteSpiException` - In case of error.

    - #### setProjectName

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryGoogleStorageIpFinder setProjectName(String projectName)

      Sets Google Cloud Platforms project name. Usually this is an auto generated project number (ex. 208709979073) that can be found in "Overview" section of Google Developer Console.

      For details refer to Google Cloud Platform API reference.

      Parameters:
        `projectName` - Project name.
      Returns:
        `this` for chaining.

    - #### setBucketName

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryGoogleStorageIpFinder setBucketName(String bucketName)

      Sets Google Cloud Storage bucket name. If the bucket doesn't exist Ignite will automatically create it. However the name must be unique across whole Google Cloud Storage and Service Account Id (see `setServiceAccountId(String)`) must be authorized to perform this operation.
      Parameters:
        `bucketName` - Bucket name.
      Returns:
        `this` for chaining.

    - #### setServiceAccountP12FilePath

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryGoogleStorageIpFinder setServiceAccountP12FilePath(String p12FileName)

      Sets a full path to the private key in PKCS12 format of the Service Account.

      For more information please refer to Service Account Authentication.

      Parameters:
        `p12FileName` - Private key file full path.
      Returns:
        `this` for chaining.

    - #### setServiceAccountId

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryGoogleStorageIpFinder setServiceAccountId(String id)

      Sets the service account ID (typically an e-mail address).

      For more information please refer to Service Account Authentication.

      Parameters:
        `id` - Service account ID.
      Returns:
        `this` for chaining.

    - #### setShared

          public TcpDiscoveryGoogleStorageIpFinder setShared(boolean shared)

      Sets shared flag. If `true` then it is expected that IP addresses registered with IP finder will be seen by IP finders on all other nodes.
      Overrides:
        `setShared` in class `TcpDiscoveryIpFinderAdapter`
      Parameters:
        `shared` - `true` if this IP finder is shared.
      Returns:
        `this` for chaining.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `TcpDiscoveryIpFinderAdapter`

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020