Search in sources :

Example 1 with PolicyMatchingCompositeModifier

use of org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.PolicyMatchingCompositeModifier in project alien4cloud by alien4cloud.

the class PolicyMatchingSubstitutionService method getModifierListWithSelectionAction.

private List<ITopologyModifier> getModifierListWithSelectionAction(SetMatchedPolicyModifier matchedModifier) {
    List<ITopologyModifier> modifierList = flowExecutor.getDefaultFlowModifiers();
    PolicyMatchingCompositeModifier matchingModifier = (PolicyMatchingCompositeModifier) modifierList.stream().filter(modifier -> modifier instanceof PolicyMatchingCompositeModifier).findFirst().orElseThrow(() -> new IllegalArgumentException("Unexpected exception in deployment flow to update node substitution; unable to find the master node matching modifier to inject selection action modifier."));
    // inject the SetMatchedNodeModifier into the nodeMatchingModifiers, just after policyMatchingConfigAutoSelectModifier
    matchingModifier.addModifierAfter(matchedModifier, policyMatchingConfigAutoSelectModifier);
    return modifierList;
}
Also used : PolicyMatchingCompositeModifier(org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.PolicyMatchingCompositeModifier) TopologyServiceCore(alien4cloud.topology.TopologyServiceCore) PolicyMatchingCompositeModifier(org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.PolicyMatchingCompositeModifier) PolicyMatchingConfigAutoSelectModifier(org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.PolicyMatchingConfigAutoSelectModifier) AlienUtils.safe(alien4cloud.utils.AlienUtils.safe) Inject(javax.inject.Inject) Service(org.springframework.stereotype.Service) Map(java.util.Map) Application(alien4cloud.model.application.Application) ApplicationService(alien4cloud.application.ApplicationService) OnDeploymentConfigCopyEvent(org.alien4cloud.alm.deployment.configuration.events.OnDeploymentConfigCopyEvent) ITopologyModifier(org.alien4cloud.alm.deployment.configuration.flow.ITopologyModifier) MapUtils(org.apache.commons.collections4.MapUtils) Csar(org.alien4cloud.tosca.model.Csar) ApplicationEnvironment(alien4cloud.model.application.ApplicationEnvironment) Set(java.util.Set) SetMatchedPolicyModifier(org.alien4cloud.alm.deployment.configuration.flow.modifiers.action.SetMatchedPolicyModifier) AbstractDeploymentConfig(org.alien4cloud.alm.deployment.configuration.model.AbstractDeploymentConfig) Collectors(java.util.stream.Collectors) Maps(com.google.common.collect.Maps) NotFoundException(alien4cloud.exception.NotFoundException) List(java.util.List) EnvironmentContext(org.alien4cloud.alm.deployment.configuration.flow.EnvironmentContext) FlowExecutor(org.alien4cloud.alm.deployment.configuration.flow.FlowExecutor) AbstractComposedModifier(org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.AbstractComposedModifier) DeploymentMatchingConfiguration(org.alien4cloud.alm.deployment.configuration.model.DeploymentMatchingConfiguration) FlowExecutionContext(org.alien4cloud.alm.deployment.configuration.flow.FlowExecutionContext) Topology(org.alien4cloud.tosca.model.templates.Topology) ITopologyModifier(org.alien4cloud.alm.deployment.configuration.flow.ITopologyModifier)

Aggregations

ApplicationService (alien4cloud.application.ApplicationService)1 NotFoundException (alien4cloud.exception.NotFoundException)1 Application (alien4cloud.model.application.Application)1 ApplicationEnvironment (alien4cloud.model.application.ApplicationEnvironment)1 TopologyServiceCore (alien4cloud.topology.TopologyServiceCore)1 AlienUtils.safe (alien4cloud.utils.AlienUtils.safe)1 Maps (com.google.common.collect.Maps)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 OnDeploymentConfigCopyEvent (org.alien4cloud.alm.deployment.configuration.events.OnDeploymentConfigCopyEvent)1 EnvironmentContext (org.alien4cloud.alm.deployment.configuration.flow.EnvironmentContext)1 FlowExecutionContext (org.alien4cloud.alm.deployment.configuration.flow.FlowExecutionContext)1 FlowExecutor (org.alien4cloud.alm.deployment.configuration.flow.FlowExecutor)1 ITopologyModifier (org.alien4cloud.alm.deployment.configuration.flow.ITopologyModifier)1 SetMatchedPolicyModifier (org.alien4cloud.alm.deployment.configuration.flow.modifiers.action.SetMatchedPolicyModifier)1 AbstractComposedModifier (org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.AbstractComposedModifier)1 PolicyMatchingCompositeModifier (org.alien4cloud.alm.deployment.configuration.flow.modifiers.matching.PolicyMatchingCompositeModifier)1