private void inspectForIndexerManager(final Event<?> evt) { RepositoryItemEvent ievt = (RepositoryItemEvent) evt; Repository repository = ievt.getRepository(); // should we sync at all if (repository != null && repository.isIndexable()) { try { if (ievt instanceof RepositoryItemEventCache || ievt instanceof RepositoryItemEventStore) { getIndexerManager().addItemToIndex(repository, ievt.getItem()); } else if (ievt instanceof RepositoryItemEventDelete) { getIndexerManager().removeItemFromIndex(repository, ievt.getItem()); } } catch (Exception e) // TODO be more specific { log.error("Could not maintain index for repository {}!", repository.getId(), e); } } }
private void inspectForIndexerManager( Event<?> evt ) { try { RepositoryItemEvent ievt = (RepositoryItemEvent) evt; // should we sync at all if ( ievt.getRepository().isIndexable() ) { if ( ievt instanceof RepositoryItemEventCache || ievt instanceof RepositoryItemEventStore ) { getIndexerManager().addItemToIndex( ievt.getRepository(), ievt.getItem() ); } else if ( ievt instanceof RepositoryItemEventDelete ) { getIndexerManager().removeItemFromIndex( ievt.getRepository(), ievt.getItem() ); } } } catch ( Exception e ) // TODO be more specific { getLogger().error( "Could not maintain index!", e ); } }