addons/pkg-maven/common/src/main/java/org/commonjava/indy/pkg/maven/content/MetadataStoreListener.java
private void handleGroupMembersChanged(final ArtifactStore store,
                                           final Map<ArtifactStore, ArtifactStore> changeMap)
    {
        final StoreKey key = store.getKey();
        if ( StoreType.group == key.getType() )
        {
            final List<StoreKey> newMembers = ( (Group) store ).getConstituents();
            logger.trace( "New members of: {} are: {}", store.getKey(), newMembers );

            final Group group = (Group) changeMap.get( store );
            final List<StoreKey> oldMembers = group.getConstituents();
            logger.trace( "Old members of: {} are: {}", group.getName(), oldMembers );

            boolean membersChanged = false;

            if ( newMembers.size() != oldMembers.size() )
            {
                membersChanged = true;
            }
            else
            {
                for ( StoreKey storeKey : newMembers )
                {
                    if ( !oldMembers.contains( storeKey ) )
                    {
                        membersChanged = true;
                    }
                }
            }

            if ( membersChanged )
            {
                logger.trace( "Membership change confirmed. Clearing caches for group: {} and groups affected by it.", group.getKey() );
                clearGroupMetaCache( group, group );
                try
                {
                    storeManager.query().getGroupsAffectedBy( group.getKey() ).forEach( g -> clearGroupMetaCache( g, group ) );
                }
                catch ( IndyDataException e )
                {
                    logger.error( String.format( "Can not get affected groups of %s", group.getKey() ), e );
                }
            }
            else
            {
                logger.trace( "No members changed, no need to expunge merged metadata" );
            }
        }
    }
private void handleGroupMembersChanged(final ArtifactStore store,
                                           final Map<ArtifactStore, ArtifactStore> changeMap)
    {
        final StoreKey key = store.getKey();
        if ( StoreType.group == key.getType() )
        {
            final List<StoreKey> newMembers = ( (Group) store ).getConstituents();
            logger.trace( "New members of: {} are: {}", store.getKey(), newMembers );

            final Group group = (Group) changeMap.get( store );
            final List<StoreKey> oldMembers = group.getConstituents();
            logger.trace( "Old members of: {} are: {}", group.getName(), oldMembers );

            boolean membersChanged = false;

            if ( newMembers.size() != oldMembers.size() )
            {
                membersChanged = true;
            }
            else
            {
                for ( StoreKey storeKey : newMembers )
                {
                    if ( !oldMembers.contains( storeKey ) )
                    {
                        membersChanged = true;
                    }
                }
            }

            if ( membersChanged )
            {
                logger.trace( "Membership change confirmed. Clearing caches for group: {} and groups affected by it.", group.getKey() );
                clearGroupMetaCache( group, group );
                try
                {
                    storeManager.query().getGroupsAffectedBy( group.getKey() ).forEach( g -> clearGroupMetaCache( g, group ) );
                }
                catch ( IndyDataException e )
                {
                    logger.error( String.format( "Can not get affected groups of %s", group.getKey() ), e );
                }
            }
            else
            {
                logger.trace( "No members changed, no need to expunge merged metadata" );
            }
        }
    }
private void handleGroupMembersChanged ( final ArtifactStore store , final Map < ArtifactStore , ArtifactStore > changeMap ) { final StoreKey key = store . getKey ( ) ; if ( StoreType . group == key . getType ( ) ) { final List < StoreKey > newMembers = ( ( Group ) store ) . getConstituents ( ) ; logger . trace ( "New members of: {} are: {}" , store . getKey ( ) , newMembers ) ; final Group group = ( Group ) changeMap . get ( store ) ; final List < StoreKey > oldMembers = group . getConstituents ( ) ; logger . trace ( "Old members of: {} are: {}" , group . getName ( ) , oldMembers ) ; boolean membersChanged = false ; if ( newMembers . size ( ) != oldMembers . size ( ) ) { membersChanged = true ; } else { for ( StoreKey storeKey : newMembers ) { if ( ! oldMembers . contains ( storeKey ) ) { membersChanged = true ; } } } if ( membersChanged ) { logger . trace ( "Membership change confirmed. Clearing caches for group: {} and groups affected by it." , group . getKey ( ) ) ; clearGroupMetaCache ( group , group ) ; try { storeManager . query ( ) . getGroupsAffectedBy ( group . getKey ( ) ) . forEach ( g -> clearGroupMetaCache ( g , group ) ) ; } catch ( IndyDataException e ) { logger . error ( String . format ( "Can not get affected groups of %s" , group . getKey ( ) ) , e ) ; } } else { logger . trace ( "No members changed, no need to expunge merged metadata" ) ; } } }
If group members changed, should clear the cascading groups metadata cache
If group members changed should clear the cascading groups metadata cache