Skip to content

Commit

Permalink
MID-4451 cache clearing when function library is uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Feb 23, 2018
1 parent b278392 commit 22cd5e1
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
import com.evolveum.midpoint.repo.api.RepoAddOptions;
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.repo.cache.RepositoryCache;
import com.evolveum.midpoint.repo.common.CacheRegistry;
import com.evolveum.midpoint.repo.common.Cacheable;
import com.evolveum.midpoint.schema.*;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.internals.InternalsConfig;
Expand Down Expand Up @@ -147,6 +149,7 @@ public class ModelController implements ModelService, TaskService, WorkflowServi
@Autowired private ObjectMerger objectMerger;
@Autowired private SystemObjectCache systemObjectCache;
@Autowired private EmulatedSearchProvider emulatedSearchProvider;
@Autowired private CacheRegistry cacheRegistry;

@Autowired(required = true)
@Qualifier("cacheRepositoryService")
Expand Down Expand Up @@ -402,6 +405,13 @@ public Collection<ObjectDeltaOperation<? extends ObjectType>> executeChanges(fin
result1.muteLastSubresultError();
}
}

if (delta.getObjectTypeClass() == FunctionLibraryType.class) {
List<Cacheable> cacheableServices = cacheRegistry.getCacheableServices();
for (Cacheable cacheableService : cacheableServices) {
cacheableService.clearCache();
}
}

final boolean preAuthorized = ModelExecuteOptions.isPreAuthorized(options);
PrismObject objectToDetermineDetailsForAudit = null;
Expand Down

0 comments on commit 22cd5e1

Please sign in to comment.