/** * Gets the app definition properties. These properties are passed into a running app. * * @return the unmodifiable map of app properties */ public Map<String, String> getProperties() { return this.appDefinition.getProperties(); }
/** * Return the name from the {@link AppDefinition}. * * @return the name from the {@link AppDefinition} */ public String getName() { return this.appDefinition.getName(); }
public RuntimeEnvironmentInfo build() { return new RuntimeEnvironmentInfo(spiClass, implementationName, implementationVersion, platformType, platformApiVersion, platformClientVersion, platformHostVersion, platformSpecificInfo); } }
@Override public String launch(AppDeploymentRequest request) { String launchId = wrapped.launch(request); deployedApps.add(request.getDefinition().getName()); launchedTasks.add(launchId); return launchId; }
private String deduceAppId(AppDeploymentRequest request) { String groupId = request.getDeploymentProperties().get(GROUP_PROPERTY_KEY); String name = request.getDefinition().getName(); if (groupId != null) { return "/" + groupId + "/" + name; } else { return "/" + name; } }
protected int configureExternalPort(final AppDeploymentRequest request) { int externalPort = 8080; Map<String, String> parameters = request.getDefinition().getProperties(); if (parameters.containsKey(SERVER_PORT_KEY)) { externalPort = Integer.valueOf(parameters.get(SERVER_PORT_KEY)); } return externalPort; }
@Override public String toString() { return "StreamAppDefinition [streamName=" + streamName + ", name=" + this.appDefinition.getName() + ", type=" + getApplicationType()+", registeredAppName=" + getRegisteredAppName() + ", properties=" + this.appDefinition.getProperties() + "]"; }
private String getName(AppDeploymentRequest request) { if (request.getDeploymentProperties() .containsKey(AppDeployer.PREFIX + ThinJarLauncher.THIN_NAME)) { return request.getDeploymentProperties() .get(AppDeployer.PREFIX + ThinJarLauncher.THIN_NAME); } return this.name; }
@Override public String launch(AppDeploymentRequest request) { String launchId = wrapped.launch(request); deployedApps.add(request.getDefinition().getName()); launchedTasks.add(launchId); return launchId; }
protected String createDeploymentId(AppDeploymentRequest request) { String groupId = request.getDeploymentProperties().get(AppDeployer.GROUP_PROPERTY_KEY); String deploymentId; if (groupId == null) { deploymentId = String.format("%s", request.getDefinition().getName()); } else { deploymentId = String.format("%s-%s", groupId, request.getDefinition().getName()); } // Kubernetes does not allow . in the name and does not allow uppercase in the name return deploymentId.replace('.', '-').toLowerCase(); }
private boolean isDynamicPort(AppDeploymentRequest request) { boolean isServerPortKeyonArgs = isServerPortKeyPresentOnArgs(request) != null; return !request.getDefinition().getProperties().containsKey(SERVER_PORT_KEY) && !isServerPortKeyonArgs; }
/** * Return the name from the {@link AppDefinition}. * * @return the name from the {@link AppDefinition} */ public String getName() { return this.appDefinition.getName(); }
/** * Gets the app definition properties. These properties are passed into a running app. * * @return the unmodifiable map of app properties */ public Map<String, String> getProperties() { return this.appDefinition.getProperties(); }
public RuntimeEnvironmentInfo build() { return new RuntimeEnvironmentInfo(spiClass, implementationName, implementationVersion, platformType, platformApiVersion, platformClientVersion, platformHostVersion, platformSpecificInfo); } }
public void validateAppVersionIsRegistered(StreamDefinition streamDefinition, AppDeploymentRequest appDeploymentRequest, String appVersion) { String registeredAppName = getRegisteredName(streamDefinition, appDeploymentRequest.getDefinition().getName()); this.validateAppVersionIsRegistered(registeredAppName, appDeploymentRequest, appVersion); }
protected boolean useSpringApplicationJson(AppDeploymentRequest request) { return request.getDefinition().getProperties().containsKey(USE_SPRING_APPLICATION_JSON_KEY) || this.properties.isUseSpringApplicationJson(); }
public void validateAppVersionIsRegistered(StreamDefinition streamDefinition, AppDeploymentRequest appDeploymentRequest, String appVersion) { String registeredAppName = getRegisteredName(streamDefinition, appDeploymentRequest.getDefinition().getName()); this.validateAppVersionIsRegistered(registeredAppName, appDeploymentRequest, appVersion); }
protected String createDeploymentId(AppDeploymentRequest request) { String name = request.getDefinition().getName(); Hashids hashids = new Hashids(name); String hashid = hashids.encode(System.currentTimeMillis()); return name + "-" + hashid; }
private Mono<String> launchTask(SummaryApplicationResponse application, AppDeploymentRequest request) { return requestCreateTask(application.getId(), getCommand(application, request), memory(request), request.getDefinition().getName()) .map(CreateTaskResponse::getId); }
private Mono<AbstractApplicationSummary> deployApplication(AppDeploymentRequest request) { String name = request.getDefinition().getName(); return pushApplication(name, request) .then(requestStopApplication(name)) .then(requestGetApplication(name)) .cast(AbstractApplicationSummary.class); }