use of org.codice.ddf.admin.query.dev.system.fields.BundleField in project admin-console-beta by connexta.
the class BundleUtils method populateServices.
private void populateServices(Bundle bundle, BundleField toPopulate) {
Optional<BlueprintContainer> blueprintContainer = getBlueprintContainer(bundle);
if (blueprintContainer.isPresent()) {
List<ComponentMetadata> cmpMetas = blueprintContainer.get().getComponentIds().stream().map(id -> blueprintContainer.get().getComponentMetadata(id)).collect(Collectors.toList());
for (ComponentMetadata meta : cmpMetas) {
if (meta instanceof ReferenceListMetadata) {
populateServiceRefLists((ReferenceListMetadata) meta, bundle, toPopulate);
} else if (meta instanceof ReferenceMetadata) {
populateServiceRef((ReferenceMetadata) meta, bundle, toPopulate);
} else if (meta instanceof BeanMetadata || meta instanceof ServiceMetadata || meta instanceof PassThroughMetadata) {
continue;
} else {
LOGGER.warn("Unable to handle blueprint metadata of type {} for bundle {}.", meta.getClass(), bundle.getSymbolicName());
}
}
getRegisteredServices(bundle).forEach(ref -> toPopulate.addService(createServiceField(ref)));
}
}
use of org.codice.ddf.admin.query.dev.system.fields.BundleField in project admin-console-beta by connexta.
the class FeatureUtils method featureToField.
private FeatureField featureToField(Feature feat, Map<String, BundleField> bundlesByLocation) {
List<String> featDeps = feat.getDependencies().stream().map(Dependency::getName).collect(Collectors.toList());
List<BundleField> bundleDepLocations = feat.getBundles().stream().map(BundleInfo::getLocation).map(loc -> createBundleFromLocation(loc, bundlesByLocation)).collect(Collectors.toList());
return new FeatureField().name(feat.getName()).featDescription(feat.getDescription()).state(feat.getInstall()).id(feat.getId()).repoUrl(feat.getRepositoryUrl()).addFeatureDeps(featDeps).addBundleDeps(bundleDepLocations);
}
use of org.codice.ddf.admin.query.dev.system.fields.BundleField in project admin-console-beta by connexta.
the class BundleUtils method getBundles.
public List<BundleField> getBundles(List<Integer> bundleIds) {
List<BundleField> bundlesFields = new ArrayList<>();
List<Bundle> bundles = getAllBundles();
if (CollectionUtils.isNotEmpty(bundleIds)) {
bundles = bundles.stream().filter(bundle -> bundleIds.contains(((Long) bundle.getBundleId()).intValue())).collect(Collectors.toList());
}
for (Bundle bundle : bundles) {
BundleField newBundleField = new BundleField().bundleName(bundle.getSymbolicName()).id(Math.toIntExact(bundle.getBundleId())).location(bundle.getLocation()).state(bundle.getState());
populatePackages(bundle, newBundleField);
populateServices(bundle, newBundleField);
bundlesFields.add(newBundleField);
}
return bundlesFields;
}
use of org.codice.ddf.admin.query.dev.system.fields.BundleField in project admin-console-beta by connexta.
the class CreatePackageDependencyGraph method createPkgDependencyGraph.
private DirectedGraph<BundleField, DependencyEdge<PackageField>> createPkgDependencyGraph() {
DirectedGraph graph = new DirectedPseudograph<>(ServiceReferenceField.class);
List<BundleField> allBundles = bundleUtils.getAllBundleFields();
allBundles.forEach(graph::addVertex);
allBundles.forEach(bundle -> createEdgesFromPkgs(bundle, graph, allBundles));
return graph;
}
Aggregations