public abstract class AbstractInstancePersistingDeployer<D extends BaseDefinition,I extends BaseInstance<D>> extends AbstractDeployer<D>
instances
of a
definition
.Modifier and Type | Field and Description |
---|---|
protected DeploymentHandler |
deploymentHandler |
protected DomainRepository<I,java.lang.String> |
instanceRepository |
composedJobParser, definitionKind, parser
Modifier | Constructor and Description |
---|---|
protected |
AbstractInstancePersistingDeployer(ZooKeeperConnection zkConnection,
org.springframework.data.repository.PagingAndSortingRepository<D,java.lang.String> definitionRespository,
DomainRepository<I,java.lang.String> instanceRepository,
XDParser parser,
DeploymentHandler deploymentHandler,
ParsingContext definitionKind) |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeDelete(D definition)
Callback method that subclasses may override to get a chance to act on definitions that are about to be deleted.
|
void |
deleteAll()
Delete all the definitions
|
void |
deploy(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties)
Deploy a resource (job or stream).
|
BaseInstance<D> |
deploymentInfo(java.lang.String id)
Query deployment information about the definition whose ID is provided.
|
java.lang.Iterable<I> |
deploymentInfo(java.lang.String first,
java.lang.String last)
Query deployment information about definitions whose ids range from
first to last . |
protected void |
deployResource(java.lang.String deploymentUnitName)
Deploy the deployment unit with the given name.
|
protected abstract I |
makeInstance(D definition)
Create an running instance out of the given definition;
|
void |
undeploy(java.lang.String name) |
void |
undeployAll()
Undeploy all the deployed resources.
|
protected void |
undeployResource(java.lang.String deploymentUnitName)
Un-deploy the deployment unit with the given name
|
void |
validateBeforeDeploy(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties)
Validate before deploying.
|
void |
validateBeforeUndeploy(java.lang.String name)
Validate before un-deployment.
|
afterSave, basicDeploy, createDefinition, createModuleDefinitions, delete, findAll, findAll, findOne, getDefinitionRepository, getDeploymentPath, getZooKeeperConnection, save, throwAlreadyDeployedException, throwDefinitionAlreadyExistsException, throwDefinitionNotDeployable, throwNoSuchDefinitionException, throwNoSuchDefinitionException, throwNotDeployedException, validateBeforeDelete, validateBeforeSave
protected final DomainRepository<I extends BaseInstance<D>,java.lang.String> instanceRepository
protected final DeploymentHandler deploymentHandler
protected AbstractInstancePersistingDeployer(ZooKeeperConnection zkConnection, org.springframework.data.repository.PagingAndSortingRepository<D,java.lang.String> definitionRespository, DomainRepository<I,java.lang.String> instanceRepository, XDParser parser, DeploymentHandler deploymentHandler, ParsingContext definitionKind)
protected void beforeDelete(D definition)
AbstractDeployer
beforeDelete
in class AbstractDeployer<D extends BaseDefinition>
public void undeploy(java.lang.String name)
public void deploy(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)
ResourceDeployer
name
- name of the resourceproperties
- deployment properties to use (may not be null)public void undeployAll()
ResourceDeployer
public void deleteAll()
ResourceDeployer
deleteAll
in interface ResourceDeployer<D extends BaseDefinition>
deleteAll
in class AbstractDeployer<D extends BaseDefinition>
public java.lang.Iterable<I> deploymentInfo(java.lang.String first, java.lang.String last)
first
to last
.public BaseInstance<D> deploymentInfo(java.lang.String id)
protected abstract I makeInstance(D definition)
protected final void deployResource(java.lang.String deploymentUnitName)
deploymentUnitName
- the deployment unit nameprotected final void undeployResource(java.lang.String deploymentUnitName)
deploymentUnitName
- the deployment unit namepublic void validateBeforeUndeploy(java.lang.String name)
DeploymentValidator
name
- the deployment unit namepublic void validateBeforeDeploy(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)
DeploymentValidator
name
- the deployment unit name