@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,
StreamDefinitionService streamDefinitionService) |
Modifier and Type | Method and Description |
---|---|
StreamDefinition |
createStream(String streamName,
String dsl,
String description,
boolean deploy,
Map<String,String> deploymentProperties)
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) |
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.
|
void |
scaleApplicationInstances(String streamName,
String appName,
int count,
Map<String,String> properties)
Scale application instances in a deployed 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, StreamDefinitionService streamDefinitionService)
public org.springframework.cloud.deployer.spi.app.DeploymentState doCalculateStreamState(String name)
public void undeployStream(String streamName)
StreamService
undeployStream
in interface StreamService
streamName
- the name of the stream to un-deploypublic void scaleApplicationInstances(String streamName, String appName, int count, Map<String,String> properties)
StreamService
scaleApplicationInstances
in interface StreamService
streamName
- the name of an existing stream definition (required)appName
- in stream application name to scale (required)count
- number of instances for the selected stream application (required)properties
- scale deployment specific properties (optional)public void updateStream(String streamName, UpdateStreamRequest updateStreamRequest)
StreamService
updateStream
in interface StreamService
streamName
- 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)
StreamService
rollbackStream
in interface StreamService
streamName
- 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)
StreamService
state
in interface StreamService
streamDefinitions
- the list of Stream definitions to calculate the deployment states.public String manifest(String name, int version)
StreamService
manifest
in interface StreamService
name
- the release nameversion
- the release versionpublic Collection<org.springframework.cloud.skipper.domain.Release> history(String releaseName)
StreamService
history
in interface StreamService
releaseName
- Stream release namepublic Collection<org.springframework.cloud.skipper.domain.Deployer> platformList()
platformList
in interface StreamService
public StreamDeployment info(String streamName)
StreamService
info
in interface StreamService
streamName
- the name of the streampublic StreamDefinition createStream(String streamName, String dsl, String description, boolean deploy, Map<String,String> deploymentProperties)
StreamService
createStream
in interface StreamService
streamName
- stream namedsl
- DSL definition for streamdescription
- description of the stream definitiondeploy
- if true
, the stream is deployed upon creation (default is
false
)deploymentProperties
- the optional deployment properties to use when the stream is deployed upon creationpublic StreamDefinition createStreamDefinition(String streamName, String dsl, String description)
public void deployStream(String streamName, Map<String,String> deploymentProperties)
deployStream
in interface StreamService
streamName
- the name of the streamdeploymentProperties
- deployment properties to use as passed in from the client.public void deleteStream(String streamName)
deleteStream
in interface StreamService
streamName
- the name of the stream to deletepublic void deleteAll()
deleteAll
in interface StreamService
public List<StreamDefinition> findRelatedStreams(String streamName, boolean nested)
findRelatedStreams
in interface StreamService
streamName
- 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 StreamService
pageable
- Pagination informationsearch
- the findByTaskNameContains parameter to usepublic StreamDefinition findOne(String streamDefinitionName)
findOne
in interface StreamService
streamDefinitionName
- the name of the stream definitionNoSuchStreamDefinitionException
- if the definition can not be found.public ValidationStatus validateStream(String name)
validateStream
in interface StreamService
name
- the name of the definitionValidationStatus
for a stream.Copyright © 2023 Pivotal Software, Inc.. All rights reserved.