@Transactional public class DefaultStreamService extends Object implements StreamService
StreamDeploymentRequest.
The StreamService deployer is agnostic. For deploying streams on
Skipper use the DefaultStreamService.
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.cloud.dataflow.audit.service.AuditRecordService |
auditRecordService |
protected org.springframework.cloud.dataflow.audit.service.AuditServiceUtils |
auditServiceUtils |
static String |
DEFAULT_SKIPPER_PACKAGE_VERSION |
protected StreamDefinitionRepository |
streamDefinitionRepository
The repository this controller will use for stream CRUD operations.
|
protected StreamValidationService |
streamValidationService |
| Constructor and Description |
|---|
DefaultStreamService(StreamDefinitionRepository streamDefinitionRepository,
SkipperStreamDeployer skipperStreamDeployer,
AppDeploymentRequestCreator appDeploymentRequestCreator,
StreamValidationService streamValidationService,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService) |
| Modifier and Type | Method and Description |
|---|---|
StreamDefinition |
createStream(String streamName,
String dsl,
String description,
boolean deploy)
Create a new stream.
|
StreamDefinition |
createStreamDefinition(String streamName,
String dsl,
String description) |
void |
deleteAll()
Delete all streams, including undeploying.
|
void |
deleteStream(String streamName)
Delete the stream, including undeloying.
|
void |
deployStream(String streamName,
Map<String,String> deploymentProperties)
Deploys the stream with the user provided deployment properties.
|
org.springframework.cloud.deployer.spi.app.DeploymentState |
doCalculateStreamState(String name) |
void |
doDeployStream(StreamDefinition streamDefinition,
Map<String,String> deploymentProperties)
Deploy a stream as defined by its stream name and optional deployment properties.
|
org.springframework.data.domain.Page<StreamDefinition> |
findDefinitionByNameContains(org.springframework.data.domain.Pageable pageable,
String search)
Find stream definitions where the findByTaskNameContains parameter
|
StreamDefinition |
findOne(String streamDefinitionName)
Find a stream definition by name.
|
List<StreamDefinition> |
findRelatedStreams(String streamName,
boolean nested)
Find streams related to the given stream name.
|
Collection<org.springframework.cloud.skipper.domain.Release> |
history(String releaseName)
Get stream's deployment history
|
StreamDeployment |
info(String streamName)
Get stream information including the deployment properties etc.
|
String |
manifest(String name,
int version)
Return a manifest info of a release version.
|
Collection<org.springframework.cloud.skipper.domain.Deployer> |
platformList() |
void |
rollbackStream(String streamName,
int releaseVersion)
Rollback the stream to the previous or a specific version of the stream.
|
Map<StreamDefinition,org.springframework.cloud.deployer.spi.app.DeploymentState> |
state(List<StreamDefinition> streamDefinitions)
Retrieve the deployment state for list of stream definitions.
|
void |
undeployStream(String streamName)
Un-deploys the stream identified by the given stream name.
|
void |
updateStream(String streamName,
String releaseName,
org.springframework.cloud.skipper.domain.PackageIdentifier packageIdentifier,
Map<String,String> updateProperties,
boolean force,
List<String> appNames) |
void |
updateStream(String streamName,
UpdateStreamRequest updateStreamRequest)
Update the stream using the UpdateStreamRequest.
|
ValidationStatus |
validateStream(String name)
Verifies that all apps in the stream are valid.
|
public static final String DEFAULT_SKIPPER_PACKAGE_VERSION
protected final StreamDefinitionRepository streamDefinitionRepository
protected final org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService
protected final org.springframework.cloud.dataflow.audit.service.AuditServiceUtils auditServiceUtils
protected final StreamValidationService streamValidationService
public DefaultStreamService(StreamDefinitionRepository streamDefinitionRepository, SkipperStreamDeployer skipperStreamDeployer, AppDeploymentRequestCreator appDeploymentRequestCreator, StreamValidationService streamValidationService, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService)
public void doDeployStream(StreamDefinition streamDefinition, Map<String,String> deploymentProperties)
streamDefinition - the stream definition to deploydeploymentProperties - the deployment properties for the streampublic org.springframework.cloud.deployer.spi.app.DeploymentState doCalculateStreamState(String name)
public void undeployStream(String streamName)
StreamServiceundeployStream in interface StreamServicestreamName - the name of the stream to un-deploypublic void updateStream(String streamName, UpdateStreamRequest updateStreamRequest)
StreamServiceupdateStream in interface StreamServicestreamName - the name of the stream to updateupdateStreamRequest - the UpdateStreamRequest to use during the updatepublic void updateStream(String streamName, String releaseName, org.springframework.cloud.skipper.domain.PackageIdentifier packageIdentifier, Map<String,String> updateProperties, boolean force, List<String> appNames)
public void rollbackStream(String streamName, int releaseVersion)
StreamServicerollbackStream in interface StreamServicestreamName - the name of the stream to rollbackreleaseVersion - the version to rollback to (if not specified, rollback to the previous deleted/deployed
release version of the stream.public Map<StreamDefinition,org.springframework.cloud.deployer.spi.app.DeploymentState> state(List<StreamDefinition> streamDefinitions)
StreamServicestate in interface StreamServicestreamDefinitions - the list of Stream definitions to calculate the deployment states.public String manifest(String name, int version)
StreamServicemanifest in interface StreamServicename - the release nameversion - the release versionpublic Collection<org.springframework.cloud.skipper.domain.Release> history(String releaseName)
StreamServicehistory in interface StreamServicereleaseName - Stream release namepublic Collection<org.springframework.cloud.skipper.domain.Deployer> platformList()
platformList in interface StreamServicepublic StreamDeployment info(String streamName)
StreamServiceinfo in interface StreamServicestreamName - the name of the streampublic StreamDefinition createStream(String streamName, String dsl, String description, boolean deploy)
createStream in interface StreamServicestreamName - stream namedsl - DSL definition for streamdescription - description of the stream definitiondeploy - if true, the stream is deployed upon creation (default is
false)InvalidStreamDefinitionException - if there are errors in parsing the stream DSL,
resolving the name, or type of applications in the streampublic StreamDefinition createStreamDefinition(String streamName, String dsl, String description)
public void deployStream(String streamName, Map<String,String> deploymentProperties)
deployStream in interface StreamServicestreamName - the name of the streamdeploymentProperties - deployment properties to use as passed in from the client.public void deleteStream(String streamName)
deleteStream in interface StreamServicestreamName - the name of the stream to deletepublic void deleteAll()
deleteAll in interface StreamServicepublic List<StreamDefinition> findRelatedStreams(String streamName, boolean nested)
findRelatedStreams in interface StreamServicestreamName - name of the streamnested - if should recursively findByTaskNameContains for related stream definitionspublic org.springframework.data.domain.Page<StreamDefinition> findDefinitionByNameContains(org.springframework.data.domain.Pageable pageable, String search)
findDefinitionByNameContains in interface StreamServicepageable - Pagination informationsearch - the findByTaskNameContains parameter to usepublic StreamDefinition findOne(String streamDefinitionName)
findOne in interface StreamServicestreamDefinitionName - the name of the stream definitionNoSuchStreamDefinitionException - if the definition can not be found.public ValidationStatus validateStream(String name)
validateStream in interface StreamServicename - the name of the definitionValidationStatus for a stream.Copyright © 2019 Pivotal Software, Inc.. All rights reserved.