// Path: brooklyn-tosca-transformer/src/main/java/io/cloudsoft/tosca/a4c/brooklyn/spec/EntitySpecModifier.java
// public interface EntitySpecModifier {
// 
//     void apply(EntitySpec<?> entitySpec, String nodeId, ToscaApplication toscaApplication);
// 
// }


import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
import javax.inject.Inject;
import org.apache.brooklyn.api.entity.Application;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.entity.EntityInitializer;
import org.apache.brooklyn.api.entity.EntitySpec;
import org.apache.brooklyn.api.mgmt.ManagementContext;
import org.apache.brooklyn.api.objs.BrooklynObjectType;
import org.apache.brooklyn.api.typereg.RegisteredType;
import org.apache.brooklyn.camp.brooklyn.BrooklynCampConstants;
import org.apache.brooklyn.camp.brooklyn.BrooklynCampReservedKeys;
import org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynEntityDecorationResolver;
import org.apache.brooklyn.core.typereg.RegisteredTypes;
import org.apache.brooklyn.entity.software.base.SoftwareProcess;
import org.apache.brooklyn.util.collections.MutableMap;
import org.apache.brooklyn.util.collections.MutableSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.google.common.base.Optional;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import alien4cloud.model.topology.GenericPolicy;
import alien4cloud.model.topology.NodeGroup;
import io.cloudsoft.tosca.a4c.brooklyn.spec.EntitySpecFactory;
import io.cloudsoft.tosca.a4c.brooklyn.spec.EntitySpecModifier;
package io.cloudsoft.tosca.a4c.brooklyn;







@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class Alien4CloudApplicationSpecsBuilder implements ApplicationSpecsBuilder<Alien4CloudApplication> {

    private static final Logger LOG = LoggerFactory.getLogger(ApplicationSpecsBuilder.class);

    // Beans
    @SuppressWarnings("rawtypes")
    private EntitySpecFactory entitySpecFactory;
    private Collection<EntitySpecModifier> specModifiers;

    // State
    private Map<String, String> parents = MutableMap.of();
    private Multimap<String, String> children = ArrayListMultimap.create();
    private Map<String, EntitySpec<?>> cachedSpecs;
    private ManagementContext mgmt;
    private ToscaFacade<Alien4CloudApplication> alien4CloudFacade;

    @Inject
// Path: brooklyn-tosca-transformer/src/main/java/io/cloudsoft/tosca/a4c/brooklyn/spec/EntitySpecModifier.java
// public interface EntitySpecModifier {
// 
//     void apply(EntitySpec<?> entitySpec, String nodeId, ToscaApplication toscaApplication);
// 
// }


// Path: brooklyn-tosca-transformer/src/main/java/io/cloudsoft/tosca/a4c/brooklyn/Alien4CloudApplicationSpecsBuilder.java
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
import javax.inject.Inject;
import org.apache.brooklyn.api.entity.Application;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.entity.EntityInitializer;
import org.apache.brooklyn.api.entity.EntitySpec;
import org.apache.brooklyn.api.mgmt.ManagementContext;
import org.apache.brooklyn.api.objs.BrooklynObjectType;
import org.apache.brooklyn.api.typereg.RegisteredType;
import org.apache.brooklyn.camp.brooklyn.BrooklynCampConstants;
import org.apache.brooklyn.camp.brooklyn.BrooklynCampReservedKeys;
import org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynEntityDecorationResolver;
import org.apache.brooklyn.core.typereg.RegisteredTypes;
import org.apache.brooklyn.entity.software.base.SoftwareProcess;
import org.apache.brooklyn.util.collections.MutableMap;
import org.apache.brooklyn.util.collections.MutableSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.google.common.base.Optional;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import alien4cloud.model.topology.GenericPolicy;
import alien4cloud.model.topology.NodeGroup;
import io.cloudsoft.tosca.a4c.brooklyn.spec.EntitySpecFactory;
import io.cloudsoft.tosca.a4c.brooklyn.spec.EntitySpecModifier;

package io.cloudsoft.tosca.a4c.brooklyn;







@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class Alien4CloudApplicationSpecsBuilder implements ApplicationSpecsBuilder<Alien4CloudApplication> {

    private static final Logger LOG = LoggerFactory.getLogger(ApplicationSpecsBuilder.class);

    // Beans
    @SuppressWarnings("rawtypes")
    private EntitySpecFactory entitySpecFactory;
    private Collection<EntitySpecModifier> specModifiers;

    // State
    private Map<String, String> parents = MutableMap.of();
    private Multimap<String, String> children = ArrayListMultimap.create();
    private Map<String, EntitySpec<?>> cachedSpecs;
    private ManagementContext mgmt;
    private ToscaFacade<Alien4CloudApplication> alien4CloudFacade;

    @Inject
    public Alien4CloudApplicationSpecsBuilder(ManagementContext managementContext, EntitySpecFactory<?> entitySpecFactory, Collection<EntitySpecModifier> specModifiers, ToscaFacade<Alien4CloudApplication> alien4CloudFacade) {