re base code
[sdc.git] / asdctool / src / main / java / org / openecomp / sdc / asdctool / impl / validator / executers / ServiceToscaArtifactsValidatorExecutor.java
1 package org.openecomp.sdc.asdctool.impl.validator.executers;
2
3 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
4 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
5 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
6 import org.openecomp.sdc.be.model.Component;
7 import org.openecomp.sdc.be.model.LifecycleStateEnum;
8
9 import java.util.HashMap;
10 import java.util.List;
11 import java.util.Map;
12
13 public class ServiceToscaArtifactsValidatorExecutor extends ArtifactValidatorExecuter implements IArtifactValidatorExecuter{
14          
15                 
16          public ServiceToscaArtifactsValidatorExecutor() {
17                 setName("SERVICE_TOSCA_ARTIFACTS");
18             }
19         @Override
20         public boolean executeValidations() {
21                 Map<GraphPropertyEnum, Object> hasProps = new HashMap<>();
22                 hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name());
23                 hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name());
24                 
25                 Map<String, List<Component>> vertices = getVerticesToValidate(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps);
26         return validate(vertices);
27         }
28
29         @Override
30         public String getName() {               
31                 return name;
32         }       
33         
34
35         public void setName(String name) {
36                 this.name = name;
37         }
38
39 }