@Test public void removedOneCleanupPolicyFromRepositoryWithMultiPolicy() throws Exception { underTest.on(new OrientCleanupPolicyDeletedEvent(entityMetadata3)); verifyConfigurationUpdated(1); verifyContainsCleanupPolicies(attributes2, cleanupPolicy2.getName()); }
@Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } @Inject  CleanupPolicyEventHandler(final RepositoryManager repositoryManager); }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } @Inject  CleanupPolicyEventHandler(final RepositoryManager repositoryManager); @Subscribe @AllowConcurrentEvents void on(final CleanupPolicyDeletedEvent event); }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } @Inject  CleanupPolicyEventHandler(final RepositoryManager repositoryManager); @Subscribe @AllowConcurrentEvents void on(final CleanupPolicyDeletedEvent event);  }