Search in sources :

Example 1 with ServiceReferenceListField

use of org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceListField in project admin-console-beta by connexta.

the class CreateServiceDependencyGraph method populateGraphWithServices.

private void populateGraphWithServices(BundleField bundle, DirectedGraph graph, List<BundleField> allBundles) {
    bundle.serviceRefs().forEach(ref -> createEdgeFromServiceRef(bundle, ref, graph, allBundles));
    for (ServiceReferenceListField refList : bundle.serviceRefLists()) {
        for (ServiceField service : refList.services()) {
            ServiceReferenceField tempServRef = new ServiceReferenceField().serviceInterface(refList.referenceListInterface()).filter(refList.filter()).resolution(refList.resolution()).service(service);
            createEdgeFromServiceRef(bundle, tempServRef, graph, allBundles);
        }
    }
}
Also used : ServiceReferenceListField(org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceListField) ServiceReferenceField(org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceField) ServiceField(org.codice.ddf.admin.query.dev.system.fields.ServiceField)

Example 2 with ServiceReferenceListField

use of org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceListField in project admin-console-beta by connexta.

the class BundleUtils method populateServiceRefLists.

private void populateServiceRefLists(ReferenceListMetadata refListMeta, Bundle bundle, BundleField toPopulate) {
    ServiceReferenceListField refListF = new ServiceReferenceListField();
    String searchFilter = formatFilter(refListMeta.getFilter());
    refListF.filter(searchFilter).referenceListInterface(refListMeta.getInterface()).resolution(refListMeta.getAvailability());
    List<ServiceReference> refs = new ArrayList<>();
    try {
        refs.addAll(getServiceReferences(refListMeta.getInterface(), searchFilter));
    } catch (InvalidSyntaxException e) {
        LOGGER.warn("Failed to parse filter for bundle {} during service reference look up. Filter was {}.", bundle.getSymbolicName(), searchFilter);
    }
    refs.forEach(ref -> refListF.addService(createServiceField(ref)));
    toPopulate.addServiceRefList(refListF);
}
Also used : ServiceReferenceListField(org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceListField) ArrayList(java.util.ArrayList) InvalidSyntaxException(org.osgi.framework.InvalidSyntaxException) ServiceReference(org.osgi.framework.ServiceReference)

Aggregations

ServiceReferenceListField (org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceListField)2 ArrayList (java.util.ArrayList)1 ServiceField (org.codice.ddf.admin.query.dev.system.fields.ServiceField)1 ServiceReferenceField (org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceField)1 InvalidSyntaxException (org.osgi.framework.InvalidSyntaxException)1 ServiceReference (org.osgi.framework.ServiceReference)1