private void unconfigureBinding(BindingInstance b) { if(b.getClient().getType().getIsRemote()){ ClientPortInstance client=b.getClient(); ServerPortInstance server=b.getServer(); Resource clientResource=b.getType().getClientResource(); Resource serverResource=b.getType().getServerResource(); //client resources unconfigureWithIP(clientResource,client); //server resources unconfigureWithIP(serverResource,server); } }
kb.setServer(serverPorts.get(b.getServer().getName())); if (b.getClientResource() != null) { net.cloudml.core.Resource cr = factory.createResource(); cr.setName(b.getClientResource().getName()); if (b.getClientResource().getDeployingResourceCommand() != null) { cr.setDeployingCommand(b.getClientResource().getDeployingResourceCommand()); if (b.getClientResource().getRetrievingResourceCommand() != null) { cr.setRetrievingCommand(b.getClientResource().getRetrievingResourceCommand()); if (b.getClientResource().getConfigurationResourceCommand() != null) { cr.setConfigurationCommand(b.getClientResource().getConfigurationResourceCommand()); if (b.getClientResource().getStartResourceCommand() != null) { cr.setStartCommand(b.getClientResource().getStartResourceCommand()); if (b.getClientResource().getStopResourceCommand() != null) { cr.setStopCommand(b.getClientResource().getStopResourceCommand());
/** * Configure Artefacts according to the bindings * @param dm a deployment model * @throws MalformedURLException */ private void configureWithBindings(List<BindingInstance> bindings) { //Configure on the basis of the bindings //parameters transmitted to the configuration scripts are "ip ipDestination portDestination" for(BindingInstance bi : bindings){ if(bi.getClient().getType().getIsRemote()){ ClientPortInstance client=bi.getClient(); ServerPortInstance server=bi.getServer(); Resource clientResource=bi.getType().getClientResource(); Resource serverResource=bi.getType().getServerResource(); String destinationIpAddress=server.getOwner().getDestination().getPublicAddress(); int destinationPortNumber=server.getType().getPortNumber(); String ipAddress=client.getOwner().getDestination().getPublicAddress(); //client resources configureWithIP(clientResource,client,destinationIpAddress,ipAddress,destinationPortNumber); //server resources configureWithIP(serverResource,server,destinationIpAddress,ipAddress,destinationPortNumber); } } }