@CliCommand(value = UNREGISTER_APPLICATION, help = "Unregister an application") public String unregister( @CliOption(mandatory = true, key = { "", "name" }, help = "name of the application to unregister") String name, @CliOption(mandatory = true, key = { "type" }, help = "type of the application to unregister") ApplicationType type, @CliOption(key = { "version" }, help = "the version application to unregister") String version) { appRegistryOperations().unregister(name, type, version); List<AppRegistrationResource> appRegistrations = findAllAppsByNameAndType(name, type); Optional<AppRegistrationResource> defaultApp = appRegistrations.stream() .filter(a -> a.getDefaultVersion() == true).findFirst(); if (!CollectionUtils.isEmpty(appRegistrations) && !defaultApp.isPresent()) { String appVersions = appRegistrations.stream().map(app -> app.getVersion()) .collect(Collectors.joining(", ", "(", ")")); return String.format("Successfully unregistered application '%s' with type '%s'. " + "Please select new default version from: %s", name, type, appVersions); } return String.format("Successfully unregistered application '%s' with type '%s'.", name, type); }
@CliCommand(value = UNREGISTER_APPLICATION, help = "Unregister an application") public String unregister( @CliOption(mandatory = true, key = { "", "name" }, help = "name of the application to unregister") String name, @CliOption(mandatory = true, key = { "type" }, help = "type of the application to unregister") ApplicationType type, @CliOption(key = { "version" }, help = "the version application to unregister") String version) { appRegistryOperations().unregister(name, type, version); List<AppRegistrationResource> appRegistrations = findAllAppsByNameAndType(name, type); Optional<AppRegistrationResource> defaultApp = appRegistrations.stream() .filter(a -> a.getDefaultVersion() == true).findFirst(); if (!CollectionUtils.isEmpty(appRegistrations) && !defaultApp.isPresent()) { String appVersions = appRegistrations.stream().map(app -> app.getVersion()) .collect(Collectors.joining(", ", "(", ")")); return String.format("Successfully unregistered application '%s' with type '%s'. " + "Please select new default version from: %s", name, type, appVersions); } return String.format("Successfully unregistered application '%s' with type '%s'.", name, type); }
/** * Construct a {@code DetailedAppRegistrationResource} object based on the provided * {@link AppRegistrationResource}. * * @param resource {@code AppRegistrationResource} from which to obtain app registration * data */ public DetailedAppRegistrationResource(AppRegistrationResource resource) { super(resource.getName(), resource.getType(), resource.getVersion(), resource.getUri(), resource.getDefaultVersion()); }
/** * Construct a {@code DetailedAppRegistrationResource} object based on the provided * {@link AppRegistrationResource}. * * @param resource {@code AppRegistrationResource} from which to obtain app registration * data */ public DetailedAppRegistrationResource(AppRegistrationResource resource) { super(resource.getName(), resource.getType(), resource.getVersion(), resource.getUri(), resource.getDefaultVersion()); }
String version = StringUtils.isEmpty(appRegistration.getVersion()) ? "" : "-"+appRegistration.getVersion(); value = value + version; if (appRegistration.getDefaultVersion()) { value = String.format("> %s <", value);
String version = StringUtils.isEmpty(appRegistration.getVersion()) ? "" : "-"+appRegistration.getVersion(); value = value + version; if (appRegistration.getDefaultVersion()) { value = String.format("> %s <", value);