addons/content-index/src/main/java/org/commonjava/indy/content/index/NFCContentListener.java
@CacheEntryRemoved
    public void removeIndex( final CacheEntryRemovedEvent<IndexedStorePath, IndexedStorePath> e )
    {
        if ( e.isPre() )
        {
            IndexedStorePath isp = e.getValue();
            final StoreKey key =
                    new StoreKey( isp.getPackageType(), isp.getStoreType(), isp.getStoreName() );
            // Only care about group level, as remote repo nfc is handled by remote timeout handler(see galley DownloadHandler),
            // and hosted is handled by DownloadManager
            if ( key.getType() == StoreType.group )
            {
                try
                {
                    final ArtifactStore store = storeDataManager.getArtifactStore( key );
                    final ConcreteResource r = new ConcreteResource( LocationUtils.toLocation( store ), isp.getPath() );
                    logger.debug( "Add NFC of resource {} in store {}", r, store );
                    if ( StoreType.hosted != key.getType() )
                    {
                        nfc.addMissing( r );
                    }
                }
                catch ( IndyDataException ex )
                {
                    logger.error( String.format(
                            "When add nfc missing for indexed artifact of path %s in store %s, failed to lookup store. Reason: %s",
                            isp.getPath(), key, ex.getMessage() ), ex );
                }
            }
        }
    }
@CacheEntryRemoved
    public void removeIndex( final CacheEntryRemovedEvent<IndexedStorePath, IndexedStorePath> e )
    {
        if ( e.isPre() )
        {
            IndexedStorePath isp = e.getValue();
            final StoreKey key =
                    new StoreKey( isp.getPackageType(), isp.getStoreType(), isp.getStoreName() );
            // Only care about group level, as remote repo nfc is handled by remote timeout handler(see galley DownloadHandler),
            // and hosted is handled by DownloadManager
            if ( key.getType() == StoreType.group )
            {
                try
                {
                    final ArtifactStore store = storeDataManager.getArtifactStore( key );
                    final ConcreteResource r = new ConcreteResource( LocationUtils.toLocation( store ), isp.getPath() );
                    logger.debug( "Add NFC of resource {} in store {}", r, store );
                    if ( StoreType.hosted != key.getType() )
                    {
                        nfc.addMissing( r );
                    }
                }
                catch ( IndyDataException ex )
                {
                    logger.error( String.format(
                            "When add nfc missing for indexed artifact of path %s in store %s, failed to lookup store. Reason: %s",
                            isp.getPath(), key, ex.getMessage() ), ex );
                }
            }
        }
    }
}