com.hazelcast.client.proxy

## Class ClientIdGeneratorProxy

- java.lang.Object
- - com.hazelcast.client.spi.ClientProxy
  - - com.hazelcast.client.proxy.ClientIdGeneratorProxy

- All Implemented Interfaces:
    DistributedObject, IdGenerator

      public class ClientIdGeneratorProxy
      extends ClientProxy
      implements IdGenerator

  Proxy implementation of `IdGenerator`.

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.client.spi.ClientProxy

      `name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientIdGeneratorProxy(String serviceName, String objectId, ClientContext context, IAtomicLong blockGenerator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `init(long id)` Tries to initialize this `IdGenerator` instance with the given ID.
    `long` | `newId()` Generates and returns a cluster-wide unique ID.
    `protected void` | `onDestroy()` Called before proxy is destroyed.
    `String` | `toString()`

    - ### Methods inherited from class com.hazelcast.client.spi.ClientProxy

      `deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onInitialize, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObject`

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

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

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getName, getPartitionKey, getServiceName`

- - ### Constructor Detail

    - #### ClientIdGeneratorProxy

          public ClientIdGeneratorProxy(String serviceName,
                                        String objectId,
                                        ClientContext context,
                                        IAtomicLong blockGenerator)

  - ### Method Detail

    - #### init

          public boolean init(long id)

      Description copied from interface: `IdGenerator`
      Tries to initialize this `IdGenerator` instance with the given ID.

      The next generated ID will be 1 greater than the supplied ID.

      Specified by:
        `init` in interface `IdGenerator`
      Returns:
        `true` if initialization succeeded, `false` otherwise.

    - #### newId

          public long newId()

      Description copied from interface: `IdGenerator`
      Generates and returns a cluster-wide unique ID.
      Specified by:
        `newId` in interface `IdGenerator`
      Returns:
        new cluster-wide unique ID

    - #### onDestroy

          protected void onDestroy()

      Description copied from class: `ClientProxy`
      Called before proxy is destroyed. Overriding implementations should clean/release resources created during initialization.
      Overrides:
        `onDestroy` in class `ClientProxy`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.