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 void
dumpContent()
SearchResultList<PrismObject<ArchetypeType>>
getAllArchetypes(OperationResult result)
PrismObject<ArchetypeType>
getArchetype(String oid, OperationResult result)
ExpressionProfile
getExpressionProfile(String identifier, OperationResult result)
PrismObject<SecurityPolicyType>
getSecurityPolicy()
@NotNull Collection<SingleCacheStateInformationType>
getStateInformation()
@Nullable PrismObject<SystemConfigurationType>
getSystemConfiguration(OperationResult result)
@Nullable SystemConfigurationType
getSystemConfigurationBean(OperationResult result)
void
invalidate(Class<?> type, String oid, CacheInvalidationContext context)
void
invalidateCaches()
void
register()
void
unregister()
-
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:
invalidate
in interfaceCache
-
getStateInformation
@NotNull public @NotNull Collection<SingleCacheStateInformationType> getStateInformation()
- Specified by:
getStateInformation
in interfaceCache
-
dumpContent
public void dumpContent()
- Specified by:
dumpContent
in interfaceCache
-
-