private CapabilityMatchingResult matchCapability ( Collection < ? extends ProvisioningFeatureDefinition > features ) { String capabilityString = esaResource . getProvisionCapability ( ) ; if ( capabilityString == null ) { CapabilityMatchingResult result = new CapabilityMatchingResult ( ) ; result . capabilitySatisfied = true ; result . features = Collections . emptyList ( ) ; return result ; } CapabilityMatchingResult result = new CapabilityMatchingResult ( ) ; result . capabilitySatisfied = true ; result . features = new ArrayList <> ( ) ; List < FeatureCapabilityInfo > capabilityMaps = createCapabilityMaps ( features ) ; for ( Filter filter : createFilterList ( ) ) { boolean matched = false ; for ( FeatureCapabilityInfo capabilityInfo : capabilityMaps ) { if ( filter . matches ( capabilityInfo . capabilities ) ) { matched = true ; result . features . add ( capabilityInfo . feature ) ; break ; } } // If any of the filters in the provision capability header don't match, we're not satisfied if ( ! matched ) { result . capabilitySatisfied = false ; } } return result ; }
Attempt to match the ProvisionCapability requirements against the given list of features