Search in sources :

Example 1 with ServiceReferenceField

use of org.codice.ddf.admin.query.dev.system.fields.ServiceReferenceField 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 ServiceReferenceField

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

the class BundleUtils method populateServiceRef.

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

Aggregations

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