public void setAlertChannels ( Collection < AlertChannel > channels ) { for ( AlertChannel channel : channels ) { // Add the channel to any policies it is associated with List < Long > policyIds = channel . getLinks ( ) . getPolicyIds ( ) ; for ( long policyId : policyIds ) { AlertPolicy policy = policies . get ( policyId ) ; if ( policy != null ) alertChannels ( policyId ) . add ( channel ) ; else logger . severe ( String . format ( "Unable to find policy for channel '%s': %d" , channel . getName ( ) , policyId ) ) ; } } }
Sets the channels on the policies for the account .