@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof ProvidedExecutionPlatformInstance) { ProvidedExecutionPlatformInstance otherNode = (ProvidedExecutionPlatformInstance) other; return getName().equals(otherNode.getName()) && this.getOwner().equals(otherNode.getOwner()); } return false; }
public ComponentInstance<? extends Component> getHost() { return getProvidedEnd().getOwner().get(); }
public boolean isHostedBy(ComponentInstance<? extends Component> host) { return getProvidedEnd().getOwner().get().equals(host); }
private void addExecutes(){ addedExecutes = new ArrayList<ExecuteInstance>(targetDM.getExecuteInstances()); addedExecutes.removeAll(matchingExecutes.values()); for (ExecuteInstance ei : addedExecutes) { int i = currentDM.getComponentInstances().toList().indexOf(ei.getRequiredEnd().getOwner().get()); if (i >= 0) { ComponentInstance a = currentDM.getComponentInstances().toList().get(i); ei.setRequiredEnd(((InternalComponentInstance) a).getRequiredExecutionPlatform()); } i = currentDM.getComponentInstances().toList().indexOf(ei.getProvidedEnd().getOwner().get()); if (i >= 0) { ComponentInstance a = currentDM.getComponentInstances().toList().get(i); int j = a.getProvidedExecutionPlatforms().toList().indexOf(ei.getProvidedEnd()); List<ProvidedExecutionPlatformInstance> l = a.getProvidedExecutionPlatforms().toList(); ei.setProvidedEnd(l.get(j)); } } }
private ProvidedExecutionPlatformInstance initProvidedExecutionPlatformInstance(net.cloudml.core.ProvidedExecutionPlatformInstance kpepi, ComponentInstance ai) { if (kpepi != null) { ProvidedExecutionPlatform pepType = null; for (ProvidedExecutionPlatform pep: ai.getType().getProvidedExecutionPlatforms()) { if (pep.getName().equals(kpepi.getType().getName())) { pepType = pep; } } ProvidedExecutionPlatformInstance pepi = new ProvidedExecutionPlatformInstance(kpepi.getName(), pepType); pepi.getOwner().set(ai); convertProperties(kpepi, pepi); convertResources(kpepi, pepi); providedExecutionPlatformInstances.put(pepi.getName(), pepi); return pepi; } return null; }
public boolean isBetween(String demanderName, String demandName, String providerName, String providedName) { return this.getRequiredEnd().getOwner().get().isNamed(demanderName) && this.getRequiredEnd().isNamed(demandName) && this.getProvidedEnd().getOwner().get().isNamed(providerName) && this.getProvidedEnd().isNamed(providedName); }