Class TokenCache
- java.lang.Object
-
- org.apache.synapse.endpoints.auth.oauth.TokenCache
-
public class TokenCache extends Object
Token Cache Implementation Tokens will be invalidate after a interval of TOKEN_CACHE_TIMEOUT minutes
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TokenCache
getInstance()
Get TokenCache InstanceString
getToken(String id, Callable<String> callable)
This method returns the value in the cache, or computes it from the specified Callablevoid
removeToken(String id)
This method is called to remove the token from the cache when the endpoint is destroyed
-
-
-
Method Detail
-
getInstance
public static TokenCache getInstance()
Get TokenCache Instance- Returns:
- TokenCache
-
getToken
public String getToken(String id, Callable<String> callable) throws ExecutionException
This method returns the value in the cache, or computes it from the specified Callable- Parameters:
id
- id of the oauth handlercallable
- to generate a new token by calling oauth server- Returns:
- Token object
- Throws:
ExecutionException
-
removeToken
public void removeToken(String id)
This method is called to remove the token from the cache when the endpoint is destroyed- Parameters:
id
- id of the endpoint
-
-