org.apache.synapse.commons.throttle.core

## Class SharedParamManager

- java.lang.Object
- - org.apache.synapse.commons.throttle.core.SharedParamManager

-     public class SharedParamManager
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SharedParamManager()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `addAndGetDistributedCounter(java.lang.String id, long value)` Add given value to the distribute counter of caller context of given id.
    `static long` | `asyncGetAndAddDistributedCounter(java.lang.String id, long value)` Asynchronously add given value to the distribute counter of caller context of given id.
    `static long` | `asyncGetAndAlterDistributedCounter(java.lang.String id, long value)` Asynchronously add given value to the distribute counter of caller context of given id.
    `static long` | `getDistributedCounter(java.lang.String id)` Return hazelcast shared counter for this caller context with given id.
    `static long` | `getSharedTimestamp(java.lang.String id)` Return hazelcast shared timestamp for this caller context with given id.
    `static long` | `getSharedTimestampWithFullId(java.lang.String id)` Return hazelcast shared timestamp for this caller context with given full id.
    `static void` | `removeCounter(java.lang.String id)` Destroy hazelcast global counter, if it's local then remove the map entry
    `static void` | `removeTimestamp(java.lang.String id)` Destroy hazelcast shared timggestamp counter, if it's local then remove the map entry
    `static void` | `removeTimestampWithFullId(java.lang.String id)` Destroy hazelcast shared timggestamp counter with full id, if it's local then remove the map entry
    `static void` | `setDistributedCounter(java.lang.String id, long value)` Set distribute counter of caller context of given id to the provided value.
    `static void` | `setSharedTimestamp(java.lang.String id, long timestamp)` Set distribute timestamp of caller context of given id to the provided value.

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

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

- - ### Constructor Detail

    - #### SharedParamManager

          public SharedParamManager()

  - ### Method Detail

    - #### getDistributedCounter

          public static long getDistributedCounter(java.lang.String id)

      Return hazelcast shared counter for this caller context with given id. If it's not distributed will get from the local counter
      Parameters:
        `id` - of the shared counter
      Returns:
        shared hazelcast current shared counter

    - #### setDistributedCounter

          public static void setDistributedCounter(java.lang.String id,
                                                   long value)

      Set distribute counter of caller context of given id to the provided value. If it's not distributed do the same for local counter
      Parameters:
        `id` - of the caller context
        `value` - to set to the global counter

    - #### addAndGetDistributedCounter

          public static long addAndGetDistributedCounter(java.lang.String id,
                                                         long value)

      Add given value to the distribute counter of caller context of given id. If it's not distributed return local counter
      Parameters:
        `id` - of the caller context
        `value` - to set to the global counter

    - #### asyncGetAndAddDistributedCounter

          public static long asyncGetAndAddDistributedCounter(java.lang.String id,
                                                              long value)

      Asynchronously add given value to the distribute counter of caller context of given id. If it's not distributed return local counter. This will return global value before add the provided counter
      Parameters:
        `id` - of the caller context
        `value` - to set to the global counter

    - #### asyncGetAndAlterDistributedCounter

          public static long asyncGetAndAlterDistributedCounter(java.lang.String id,
                                                                long value)

      Asynchronously add given value to the distribute counter of caller context of given id. If it's not distributed return local counter. This will return global value before add the provided counter
      Parameters:
        `id` - of the caller context
        `value` - to set to the global counter

    - #### removeCounter

          public static void removeCounter(java.lang.String id)

      Destroy hazelcast global counter, if it's local then remove the map entry
      Parameters:
        `id` - of the caller context

    - #### getSharedTimestamp

          public static long getSharedTimestamp(java.lang.String id)

      Return hazelcast shared timestamp for this caller context with given id. If it's not distributed will get from the local counter
      Parameters:
        `id` - of the shared counter
      Returns:
        shared hazelcast current shared counter

    - #### getSharedTimestampWithFullId

          public static long getSharedTimestampWithFullId(java.lang.String id)

      Return hazelcast shared timestamp for this caller context with given full id. If it's not distributed will get from the local counter
      Parameters:
        `id` - of the shared counter
      Returns:
        shared hazelcast current shared counter

    - #### setSharedTimestamp

          public static void setSharedTimestamp(java.lang.String id,
                                                long timestamp)

      Set distribute timestamp of caller context of given id to the provided value. If it's not distributed do the same for local counter
      Parameters:
        `id` - of the caller context
        `timestamp` - to set to the global counter

    - #### removeTimestamp

          public static void removeTimestamp(java.lang.String id)

      Destroy hazelcast shared timggestamp counter, if it's local then remove the map entry
      Parameters:
        `id` - of the caller context

    - #### removeTimestampWithFullId

          public static void removeTimestampWithFullId(java.lang.String id)

      Destroy hazelcast shared timggestamp counter with full id, if it's local then remove the map entry
      Parameters:
        `id` - of the caller context

Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.