Class SharedParamManager
- java.lang.Object
-
- org.apache.synapse.commons.throttle.core.SharedParamManager
-
public class SharedParamManager extends Object
-
-
Constructor Summary
Constructors Constructor Description SharedParamManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longaddAndGetDistributedCounter(String id, long value)Add given value to the distribute counter of caller context of given id.static longasyncGetAndAddDistributedCounter(String id, long value)Asynchronously add given value to the distribute counter of caller context of given id.static longasyncGetAndAlterDistributedCounter(String id, long value)Asynchronously add given value to the distribute counter of caller context of given id.static longgetDistributedCounter(String id)Return distributed shared counter for this caller context with given id.static longgetSharedTimestamp(String id)Return hazelcast shared timestamp for this caller context with given id.static voidremoveCounter(String id)Destroy hazelcast global counter, if it's local then remove the map entrystatic voidremoveTimestamp(String id)Destroy hazelcast shared timggestamp counter, if it's local then remove the map entrystatic voidsetDistributedCounter(String id, long value)Set distribute counter of caller context of given id to the provided value.static voidsetExpiryTime(String id, long expiryTimeStamp)static voidsetSharedTimestamp(String id, long timestamp)Set distribute timestamp of caller context of given id to the provided value.
-
-
-
Method Detail
-
getDistributedCounter
public static long getDistributedCounter(String id)
Return distributed 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(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 contextvalue- to set to the global counter
-
addAndGetDistributedCounter
public static long addAndGetDistributedCounter(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 contextvalue- to set to the global counter
-
asyncGetAndAddDistributedCounter
public static long asyncGetAndAddDistributedCounter(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 contextvalue- to set to the global counter
-
asyncGetAndAlterDistributedCounter
public static long asyncGetAndAlterDistributedCounter(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 contextvalue- to set to the global counter
-
removeCounter
public static void removeCounter(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(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
-
setSharedTimestamp
public static void setSharedTimestamp(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 contexttimestamp- to set to the global counter
-
removeTimestamp
public static void removeTimestamp(String id)
Destroy hazelcast shared timggestamp counter, if it's local then remove the map entry- Parameters:
id- of the caller context
-
setExpiryTime
public static void setExpiryTime(String id, long expiryTimeStamp)
-
-