private boolean matchDefault()

in src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMappedBundleFilter.java [124:148]


    private boolean matchDefault(Bundle bundle, Object serviceName, String subserviceName, String filter, ServiceReference ref) {
         if ( mapper.getServiceName(context.getBundle()).equals(serviceName) ) {
             try {
                 if (filter != null && context.createFilter(filter).match(ref)) {
                     for (Mapping mapping : mapper.getActiveMappings()) {
                         if (mapping.getServiceName().equals(mapper.getServiceName(bundle))) {
                             return false;
                         }
                     }
                     Iterable<String> principals = mapper.getServicePrincipalNamesInternal(bundle, subserviceName);
                     if (principals != null && principals.iterator().hasNext()) {
                         return true;
                     }
                     String user = mapper.getServiceUserIDInternal(bundle, subserviceName);
                     if (user != null && !user.isEmpty()) {
                         return true;
                     }
                 }
             } catch (InvalidSyntaxException e) {
                 // this shouldn't happen as the framework will have validated the filter already
                 throw new RuntimeException(e);
             }
         }
         return false;
    }