@Override public PagedResources<AppRegistrationResource> list(ApplicationType type) { String uri = uriTemplate + "?size=2000" + ((type == null) ? "" : "&type=" + type.name()); return restTemplate.getForObject(uri, AppRegistrationResource.Page.class); }
@Override public AppRegistryCommands.QualifiedApplicationName convertFromText(String value, Class<?> targetType, String optionContext) { int colonIndex = value.indexOf(':'); if (colonIndex == -1) { throw new ShellException("Incorrect syntax. Valid syntax is '<ApplicationType>:<ApplicationName>'."); } ApplicationType applicationType = ApplicationType.valueOf(value.substring(0, colonIndex)); return new AppRegistryCommands.QualifiedApplicationName(value.substring(colonIndex + 1), applicationType); }
@Override public int compareTo(AppRegistration that) { int i = this.type.compareTo(that.type); if (i == 0) { i = this.name.compareTo(that.name); } if (i == 0) { i = this.version.compareTo(that.version); } return i; } }
private List<AppRegistrationResource> findAllAppsByNameAndType(String appName, ApplicationType appType) { return appRegistryOperations().list().getContent().stream() .filter(a -> a.getName().equals(appName)) .filter(a -> a.getType().equals(appType.toString())) .collect(Collectors.toList()); }
ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (streamAppDefinition.getName().startsWith(appName) && !applicationType.equals(ApplicationType.sink)) { collector.add(proposals.withSuffix(streamAppDefinition.getName()));
private List<AppRegistrationResource> findAllAppsByNameAndType(String appName, ApplicationType appType) { return appRegistryOperations().list().getContent().stream() .filter(a -> a.getName().equals(appName)) .filter(a -> a.getType().equals(appType.toString())) .collect(Collectors.toList()); }
ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (streamAppDefinition.getName().startsWith(appName) && !applicationType.equals(ApplicationType.sink)) { collector.add(proposals.withSuffix(streamAppDefinition.getName()));
@Override public PagedResources<AppRegistrationResource> list(ApplicationType type) { String uri = appsLink.getHref() + "?size=2000" + ((type == null) ? "" : "&type=" + type.name()); return restTemplate.getForObject(uri, AppRegistrationResource.Page.class); }
@Override public AbstractAppRegistryCommands.QualifiedApplicationName convertFromText(String value, Class<?> targetType, String optionContext) { int colonIndex = value.indexOf(':'); if (colonIndex == -1) { throw new ShellException("Incorrect syntax. Valid syntax is '<ApplicationType>:<ApplicationName>'."); } ApplicationType applicationType = ApplicationType.valueOf(value.substring(0, colonIndex)); return new AbstractAppRegistryCommands.QualifiedApplicationName(value.substring(colonIndex + 1), applicationType); }
this.whitelistProperties.qualifyProperties(appUpdateTimeProperties, metadataResource); expandedAppUpdateTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, type.toString()); AppDefinition appDefinition = new AppDefinition(currentApp.getName(), expandedAppUpdateTimeProperties);
@Override public int compareTo(AppRegistration that) { int i = this.getType().compareTo(that.getType()); if (i == 0) { i = this.getName().compareTo(that.getName()); } if (i == 0) { i = this.getVersion().compareTo(that.getVersion()); } return i; } }
@Override public void unregister(String name, ApplicationType applicationType) { String uri = appsLink.getHref() + "/{type}/{name}"; restTemplate.delete(uri, applicationType.name(), name); }
@Override public Stream<AppRegistration> toValidAppRegistration(Map.Entry<String, URI> kv, URI metadataURI) { String key = kv.getKey(); String[] tokens = key.split("\\."); if (tokens.length == 2) { String name = tokens[1]; ApplicationType type = ApplicationType.valueOf(tokens[0]); URI appURI = warnOnMalformedURI(key, kv.getValue()); return Stream.of(new AppRegistration(name, type, "none", appURI, metadataURI)); } else { Assert.isTrue(tokens.length == 3 && METADATA_KEY_SUFFIX.equals(tokens[2]), "Invalid format for app key '" + key + "'in file. Must be <type>.<name> or <type>.<name>" + ".metadata"); return Stream.empty(); } }
this.whitelistProperties.qualifyProperties(appUpdateTimeProperties, metadataResource); expandedAppUpdateTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, type.toString()); AppDefinition appDefinition = new AppDefinition(currentApp.getName(), expandedAppUpdateTimeProperties);
@Override public void unregister(String name, ApplicationType applicationType, String version) { String uri = appsLink.getHref() + "/{type}/{name}/{version}"; restTemplate.delete(uri, applicationType.name(), name, version); }
private void validateAppVersionIsRegistered(String registeredAppName, AppDeploymentRequest appDeploymentRequest, String appVersion) { String appTypeString = appDeploymentRequest.getDefinition().getProperties() .get(DataFlowPropertyKeys.STREAM_APP_TYPE); ApplicationType applicationType = ApplicationType.valueOf(appTypeString); if (!this.appRegistryService.appExist(registeredAppName, applicationType, appVersion)) { throw new IllegalStateException(String.format("The %s:%s:%s app is not registered!", registeredAppName, appTypeString, appVersion)); } }
appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, currentApp.getApplicationType().toString()); StringBuilder sb = new StringBuilder().append(currentApp.getStreamName()).append(".") .append(currentApp.getName()).append(".").append("${spring.cloud.application.guid}");
@Override public void unregister(String name, ApplicationType applicationType) { String uri = uriTemplate.toString() + "/{type}/{name}"; restTemplate.delete(uri, applicationType.name(), name); }