@Override public int hashCode() { int hash = 5; hash = 31 * hash + (this.owner.isDefined() ? this.owner.get().hashCode() : 0); hash = 31 * hash + (this.providedPorts != null ? this.providedPorts.hashCode() : 0); hash = 31 * hash + (this.providedExecutionPlatforms != null ? this.providedExecutionPlatforms.hashCode() : 0); return hash; }
public String calculateExecutionPlatformIdentifier(ExecutionPlatformInstance<? extends ExecutionPlatform> epi) { return String.format("%s-%s", epi.getOwner().get().getName(), epi.getName()); }
@Override public Deployment getDeployment() { return getOwner().get(); }
public ComponentInstance<? extends Component> getHost() { return getProvidedEnd().getOwner().get(); }
@Override public Deployment getDeployment() { return getOwner().get(); }
public String getName() { return isDefined() ? this.get().getName() : NO_OWNER_MARK; } }
@Override public Deployment getDeployment() { return getOwner().get(); }
@Override public Deployment getDeployment() { return owner.get(); }
@Override public Deployment getDeployment() { return getOwner().get(); }
@Override public Deployment getDeployment() { return getOwner().get(); }
@Override public Deployment getDeployment() { return getOwner().get().getDeployment(); }
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); }
@Override public Deployment getDeployment() { return getOwner().get().getDeployment(); }
@Override public boolean equals(Object that) { if (that == null) { return false; } if (that instanceof Component) { Component other = (Component) that; if (other.getOwner().isDefined() && getOwner().isDefined()) { return other.getOwner().get().equals(getOwner().get()) && other.isNamed(getName()); } } return false; }
private void unconfigureWithIP(Resource r, PortInstance<? extends Port> i) { Connector jc; if (r != null) { VMInstance ownerVM = (VMInstance) getDestination(i.getOwner().get()); //TODO: generalize to PaaS VM n = ownerVM.getType(); jc = ConnectorFactory.createIaaSConnector(n.getProvider()); //jc=new JCloudsConnector(n.getProvider().getName(), n.getProvider().getLogin(), n.getProvider().getPasswd()); //jc.execCommand(ownerVM.getId(), r.getStopCommand(), "ubuntu", n.getPrivateKey()); executeCommand(ownerVM, jc, r.getStopCommand()); jc.closeConnection(); } }
public void retrieveIPandConfigure(Resource serverResource, Resource clientResource, PortInstance<? extends Port> server, PortInstance<? extends Port> client){ String destinationIpAddress = getDestination(server.getOwner().get()).getPublicAddress(); int destinationPortNumber = server.getType().getPortNumber(); String ipAddress = getDestination(client.getOwner().get()).getPublicAddress(); if(clientResource == null && serverResource == null) return; // ignore configuration if there is no resource at all configureWithIP(serverResource, clientResource, server, client, destinationIpAddress, ipAddress, destinationPortNumber); }
public WarXmlConfigValet(RelationshipInstance relationshipInstance, Resource configResource){ this.relationshipInstance = relationshipInstance; this.warCompInst = relationshipInstance.getRequiredEnd().getOwner().get(); this.configResource = configResource; }
private Boolean isPaaS2PaaS(RelationshipInstance bi){ if(bi.getRequiredEnd().getOwner().get().isInternal()){ if(bi.getProvidedEnd().getOwner().get().isInternal()){ if(!bi.getRequiredEnd().getOwner().get().asInternal().externalHost().isVM() && !bi.getProvidedEnd().getOwner().get().asInternal().externalHost().isVM()){ return true; } } } return false; }
@Override public final Deployment getDeployment() { return getOwner().get(); }
@Override public Deployment getDeployment() { return getOwner().get(); }