BaseMeta(final ComponentFamilyMeta parent, final String name, final String icon, final int version, final Class<?> type, final List<ParameterMeta> parameterMetas, final MigrationHandler migrationHandler, final Function<Map<String, String>, T> instantiator, final boolean validated) { this.parent = parent; this.name = name; this.icon = icon; this.version = version; this.packageName = ofNullable(type.getPackage()).map(Package::getName).orElse(""); this.parameterMetas = parameterMetas; this.migrationHandler = migrationHandler; this.type = type; this.instantiator = instantiator; this.validated = validated; this.id = IdGenerator.get(parent.getPlugin(), parent.getName(), name); }
.build(); final Optional<Container> plugin = manager.findPlugin(meta.getPlugin()); if (!plugin.isPresent()) { return Response .status(Response.Status.NOT_FOUND) .entity(new ErrorPayload(ErrorDictionary.PLUGIN_MISSING, "No plugin '" + meta.getPlugin() + "' for identifier: " + id)) .type(APPLICATION_JSON_TYPE) .build();
final Optional<Container> plugin = manager.findPlugin(meta.getParent().getPlugin()); if (!plugin.isPresent()) { return Response .status(Response.Status.NOT_FOUND) .entity(new ErrorPayload(ErrorDictionary.PLUGIN_MISSING, "No plugin '" + meta.getParent().getPlugin() + "' for identifier: " + id)) .type(APPLICATION_JSON_TYPE) .build();
private ComponentId createMetaId(final Container container, final ComponentFamilyMeta.BaseMeta<Object> meta) { return new ComponentId(meta.getId(), meta.getParent().getId(), meta.getParent().getPlugin(), ofNullable(container.get(ComponentManager.OriginalId.class)) .map(ComponentManager.OriginalId::getValue) .orElse(container.getId()), meta.getParent().getName(), meta.getName()); }
.flatMap(this::flatten) .filter(RepositoryModelBuilder::isConfiguration) .map(p -> createConfig(familyMeta.getPlugin(), services, p, familyMeta.getName(), familyMeta.getIcon(), migrationHandlerFactory)) .collect(toMap(c -> c.getMeta().getJavaType(), identity(), (config1, config2) -> config1,
file = componentManagerService .manager() .findPlugin(component.getParent().getPlugin()) .orElseThrow(() -> new WebApplicationException(Response .status(Response.Status.NOT_FOUND)
final Container container = ofNullable(componentDao.findById(id)) .map(meta -> manager .findPlugin(meta.getParent().getPlugin()) .orElseThrow(() -> new WebApplicationException(Response .status(NOT_FOUND) .entity(new ErrorPayload(ErrorDictionary.PLUGIN_MISSING, "No plugin '" + meta.getParent().getPlugin() + "'")) .build()))) .orElseThrow(() -> new WebApplicationException(Response
.map(id -> componentDao.findById(id)) .collect(toMap(ComponentFamilyMeta.BaseMeta::getId, meta -> componentManagerService.manager().findPlugin(meta.getParent().getPlugin()).map(c -> { ComponentExtension.ComponentContext context = c.get(ComponentContexts.class).getContexts().get(meta.getType());