Class SystemObjectCache
- java.lang.Object
-
- com.evolveum.midpoint.repo.common.SystemObjectCache
-
- All Implemented Interfaces:
Cache,CacheInvalidationListener
@Component public class SystemObjectCache extends Object implements Cache
Cache for system object such as SystemConfigurationType. This is a global cache, independent of the request. It will store the system configuration in memory. It will check for system configuration updates in regular interval using the getVersion() method.This supplements the RepositoryCache. RepositoryCache works on per-request (per-operation) basis. The SystemObjectCache is global. Its goal is to reduce the number of getObject(SystemConfiguration) and the getVersion(SystemConfiguration) calls.
In the future: May be used for more objects that are often used and seldom changed, e.g. object templates.
TODO: use real repo instead of repo cache
- Author:
- semancik
-
-
Constructor Summary
Constructors Constructor Description SystemObjectCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddumpContent()SearchResultList<PrismObject<ArchetypeType>>getAllArchetypes(OperationResult result)PrismObject<ArchetypeType>getArchetype(String oid, OperationResult result)ExpressionProfilegetExpressionProfile(String identifier, OperationResult result)PrismObject<SecurityPolicyType>getSecurityPolicy()@NotNull Collection<SingleCacheStateInformationType>getStateInformation()@Nullable PrismObject<SystemConfigurationType>getSystemConfiguration(OperationResult result)@Nullable SystemConfigurationTypegetSystemConfigurationBean(OperationResult result)voidinvalidate(Class<?> type, String oid, CacheInvalidationContext context)voidinvalidateCaches()voidregister()voidunregister()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.repo.api.Cache
getEventSpecifications, invalidate
-
-
-
-
Method Detail
-
register
@PostConstruct public void register()
-
unregister
@PreDestroy public void unregister()
-
getSystemConfigurationBean
@Nullable public @Nullable SystemConfigurationType getSystemConfigurationBean(OperationResult result) throws SchemaException
- Throws:
SchemaException
-
getSystemConfiguration
@Nullable public @Nullable PrismObject<SystemConfigurationType> getSystemConfiguration(OperationResult result) throws SchemaException
- Throws:
SchemaException
-
getSecurityPolicy
public PrismObject<SecurityPolicyType> getSecurityPolicy() throws SchemaException
- Throws:
SchemaException
-
invalidateCaches
public void invalidateCaches()
-
getArchetype
public PrismObject<ArchetypeType> getArchetype(String oid, OperationResult result) throws ObjectNotFoundException, SchemaException
-
getAllArchetypes
public SearchResultList<PrismObject<ArchetypeType>> getAllArchetypes(OperationResult result) throws SchemaException
- Throws:
SchemaException
-
getExpressionProfile
public ExpressionProfile getExpressionProfile(String identifier, OperationResult result) throws SchemaException
- Throws:
SchemaException
-
invalidate
public void invalidate(Class<?> type, String oid, CacheInvalidationContext context)
- Specified by:
invalidatein interfaceCache
-
getStateInformation
@NotNull public @NotNull Collection<SingleCacheStateInformationType> getStateInformation()
- Specified by:
getStateInformationin interfaceCache
-
dumpContent
public void dumpContent()
- Specified by:
dumpContentin interfaceCache
-
-