public void reset(){ setCurrentModel(null); alreadyDeployed=new ComponentInstanceGroup<ComponentInstance<? extends Component>>(); alreadyStarted=new ComponentInstanceGroup<ComponentInstance<? extends Component>>(); }
public ComponentInstanceGroup<T> hosting(InternalComponentInstance component) { final ComponentInstanceGroup<T> selected = new ComponentInstanceGroup<T>(); for (T instance: this) { if (instance.isHosting(component)) { selected.add(instance); } } return selected; }
public ComponentInstanceGroup<T> ofType(String typeName) { final ComponentInstanceGroup<T> selected = new ComponentInstanceGroup<T>(); for (T instance: this) { if (instance.getType().isNamed(typeName)) { selected.add(instance); } } return selected; }
/** * Convert a list of ExternalCOmpnents model from CloudMl in a format * compatible with MODAClouds Monitoring Platform's APIs * * @param addedECs the list */ public static Model fromCloudmlToModaMP(List<ExternalComponentInstance<? extends org.cloudml.core.ExternalComponent>> addedECs, List<InternalComponentInstance> addedICs) { //create a new list for avoid changes in the original one ComponentInstanceGroup supportList = new ComponentInstanceGroup(); supportList.addAll(addedECs); supportList.addAll(addedICs); //call the actual translator return getModelUpdates(supportList, null); }
public final ComponentInstanceGroup<ComponentInstance<? extends Component>> instances() { if (owner.isUndefined()) { return new ComponentInstanceGroup<ComponentInstance<? extends Component>>(); } return getDeployment().getComponentInstances().ofType(getName()); }
ComponentInstanceGroup supportList = new ComponentInstanceGroup(); supportList.addAll(removedECs); VMInstanceGroup removedVMs = supportList.onlyVMs();
/** * Convert a Deployment model from CloudMl in a format * compatible with MODAClouds Monitoring Platform's APIs * * @param deployment the deployment model to convert */ public static Model fromCloudmlToModaMP(Deployment deployment) { //get the relevant part of the model //create a new list for avoid changes in the original one ComponentInstanceGroup instances = new ComponentInstanceGroup(); instances.addAll(deployment.getComponentInstances()); ProviderGroup providers = new ProviderGroup(); providers.addAll(deployment.getProviders()); //call the actual translator return getModelUpdates(instances, providers); }
prepareComponents(new ComponentInstanceGroup(diff.getAddedComponents()), targetModel.getRelationshipInstances()); configureWithRelationships(new RelationshipInstanceGroup(diff.getAddedRelationships())); configureSaas(new ComponentInstanceGroup<InternalComponentInstance>(diff.getAddedComponents())); configureWithPuppet(targetModel.getComponentInstances().onlyInternals()); generatePuppetManifestAndConfigure();
prepareComponents(new ComponentInstanceGroup(diff.getAddedComponents()), targetModel.getRelationshipInstances()); configureWithRelationships(new RelationshipInstanceGroup(diff.getAddedRelationships())); configureSaas(new ComponentInstanceGroup<InternalComponentInstance>(diff.getAddedComponents())); configureWithPuppet(targetModel.getComponentInstances().onlyInternals()); generatePuppetManifestAndConfigure();