public void consolidate ( List targets ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "consolidate" , targets ) ; Iterator itr = targets . iterator ( ) ; // Reset the lists for this level levelUsersAllowedToSubscribe . clear ( ) ; levelUsersAllowedToPublish . clear ( ) ; levelGroupAllowedToSubscribe . clear ( ) ; levelGroupAllowedToPublish . clear ( ) ; while ( itr . hasNext ( ) ) { Object target = itr . next ( ) ; if ( target instanceof TopicAcl ) { // Extract the principal Principal principal = ( ( TopicAcl ) target ) . getPrincipal ( ) ; // Check the operation type if ( ( ( TopicAcl ) target ) . getOperationType ( ) == 1 ) { if ( principal == null ) { // This is an inheritance blocker accumUsersAllowedToPublish . clear ( ) ; accumGroupAllowedToPublish . clear ( ) ; } else if ( principal instanceof Group ) { levelGroupAllowedToPublish . add ( principal ) ; } else { levelUsersAllowedToPublish . add ( principal ) ; } } else { if ( principal == null ) { // This is an inheritance blocker accumUsersAllowedToSubscribe . clear ( ) ; accumGroupAllowedToSubscribe . clear ( ) ; } else if ( principal instanceof Group ) { levelGroupAllowedToSubscribe . add ( principal ) ; } else { levelUsersAllowedToSubscribe . add ( principal ) ; } } } } if ( ! levelUsersAllowedToSubscribe . isEmpty ( ) ) { accumUsersAllowedToSubscribe . addAll ( levelUsersAllowedToSubscribe ) ; } if ( ! levelUsersAllowedToPublish . isEmpty ( ) ) { accumUsersAllowedToPublish . addAll ( levelUsersAllowedToPublish ) ; } if ( ! levelGroupAllowedToSubscribe . isEmpty ( ) ) { accumGroupAllowedToSubscribe . addAll ( levelGroupAllowedToSubscribe ) ; } if ( ! levelGroupAllowedToPublish . isEmpty ( ) ) { accumGroupAllowedToPublish . addAll ( levelGroupAllowedToPublish ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "consolidate" ) ; }
Method consolidate Used to add a set of acls to the accumulated permission vectors