Class Caches
- java.lang.Object
-
- com.identityworksllc.iiq.common.cache.Caches
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clear()
Clears all items in the Bundle, Configuration, and Custom cachesstatic CacheMap<String,sailpoint.object.Bundle>
createBundleCache()
Creates a new to hold Bundle objects, with the configured timeoutstatic <T extends sailpoint.object.SailPointObject>
CacheMap<String,T>createCache(Class<T> type)
Creates a new instance of a cache to hold the given type.static CacheMap<String,sailpoint.object.Configuration>
createConfigurationCache()
Creates a new to hold Configuration objects, with the configured timeoutstatic CacheMap<String,sailpoint.object.Custom>
createCustomCache()
Creates a new to hold Custom objects, with the configured timeoutstatic sailpoint.object.Bundle
getBundle(String nameOrId)
Retrieves a Bundle from the cache, or from the DB if the cache has expiredstatic CacheMap<String,sailpoint.object.Bundle>
getBundleCache()
Gets the static Bundle cache mapstatic sailpoint.object.Configuration
getConfiguration(String nameOrId)
Gets the Configuration object (cached or newly loaded) that corresponds to the given name or IDstatic CacheMap<String,sailpoint.object.Configuration>
getConfigurationCache()
Gets the static Configuration cache map created on startupstatic sailpoint.object.Custom
getCustom(String nameOrId)
Gets the Custom (cached or newly loaded) that corresponds to the given name or IDstatic CacheMap<String,sailpoint.object.Custom>
getCustomCacheMap()
Gets the static Custom cache map created on startupstatic int
getDefaultTimeoutSeconds(Class<? extends sailpoint.object.SailPointObject> type)
Returns the configured cache timeout in seconds.
-
-
-
Method Detail
-
clear
public static void clear()
Clears all items in the Bundle, Configuration, and Custom caches
-
createBundleCache
public static CacheMap<String,sailpoint.object.Bundle> createBundleCache()
Creates a new to hold Bundle objects, with the configured timeout- Returns:
- a CacheMap that holds Bundle objects
-
createCache
public static <T extends sailpoint.object.SailPointObject> CacheMap<String,T> createCache(Class<T> type)
Creates a new instance of a cache to hold the given type.The default cache will expire its entries after 60 seconds, but this can be configured as described in
getDefaultTimeoutSeconds(Class)
.- Type Parameters:
T
- The type reference of the SailPointObject to construct- Parameters:
type
- The type of object to store in the cache- Returns:
- The newly created cache
-
createConfigurationCache
public static CacheMap<String,sailpoint.object.Configuration> createConfigurationCache()
Creates a new to hold Configuration objects, with the configured timeout- Returns:
- a CacheMap that holds Configuration objects
-
createCustomCache
public static CacheMap<String,sailpoint.object.Custom> createCustomCache()
Creates a new to hold Custom objects, with the configured timeout- Returns:
- a CacheMap that holds Custom objects
-
getBundle
public static sailpoint.object.Bundle getBundle(String nameOrId)
Retrieves a Bundle from the cache, or from the DB if the cache has expired- Parameters:
nameOrId
- The name or ID of the Bundle to retrieve- Returns:
- The resulting Bundle, if one exists with that name
-
getBundleCache
public static CacheMap<String,sailpoint.object.Bundle> getBundleCache()
Gets the static Bundle cache map- Returns:
- The static Bundle cache map
-
getConfiguration
public static sailpoint.object.Configuration getConfiguration(String nameOrId)
Gets the Configuration object (cached or newly loaded) that corresponds to the given name or ID- Parameters:
nameOrId
- The name or ID- Returns:
- the Configuration object
-
getConfigurationCache
public static CacheMap<String,sailpoint.object.Configuration> getConfigurationCache()
Gets the static Configuration cache map created on startup- Returns:
- The static Configuration cache map
-
getCustom
public static sailpoint.object.Custom getCustom(String nameOrId)
Gets the Custom (cached or newly loaded) that corresponds to the given name or ID- Parameters:
nameOrId
- The name or ID- Returns:
- the Custom object
-
getCustomCacheMap
public static CacheMap<String,sailpoint.object.Custom> getCustomCacheMap()
Gets the static Custom cache map created on startup- Returns:
- The static Custom cache map created on startup
-
getDefaultTimeoutSeconds
public static int getDefaultTimeoutSeconds(Class<? extends sailpoint.object.SailPointObject> type)
Returns the configured cache timeout in seconds.This will consult the following configuration keys in SystemConfiguration:
IIQCommon.Caches.(type).Timeout IIQCommon.Caches.Default.Timeout
If none are present, or if both are less than 1, the default of 60 seconds is used.
- Returns:
- The timeout in seconds, with a default of 60
-
-