@CliCommand(value = UNREGISTER_ALL, help = "Unregister all applications") public String unregisterAll() { appRegistryOperations().unregisterAll(); StringBuilder msg = new StringBuilder() .append("Successfully unregistered applications."); PagedResources<AppRegistrationResource> appRegistrationResources = appRegistryOperations().list(); if (!appRegistrationResources.getContent().isEmpty()) { msg.append(" The following were not unregistered as they are associated with an existing stream:"); for(AppRegistrationResource appRegistrationResource : appRegistrationResources) { msg.append(String.format(" [%s:%s:%s]", appRegistrationResource.getName(), appRegistrationResource.getType(), appRegistrationResource.getVersion())); } } return msg.toString(); }
@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 value = appRegistration.getName(); if (application != null) { String version = StringUtils.isEmpty(appRegistration.getVersion()) ? "" : "-"+appRegistration.getVersion(); value = value + version; if (appRegistration.getDefaultVersion()) {
String value = appRegistration.getName(); if (application != null) { String version = StringUtils.isEmpty(appRegistration.getVersion()) ? "" : "-"+appRegistration.getVersion(); value = value + version; if (appRegistration.getDefaultVersion()) {