added undeploy capability for Feature #852

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/aslvre@119308 82a268e6-3cf1-43bd-a215-b396298e98cf
master
Massimiliano Assante 9 years ago
parent fa2a847224
commit c9ce62e4da

@ -10,7 +10,7 @@
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslvre</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>5.2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>VRE Management ASL Extension</name>
<description>

@ -3,6 +3,7 @@ package org.gcube.application.framework.vremanagement.vremanagement;
import java.rmi.RemoteException;
import java.util.List;
import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.vremanagement.vremodel.cl.stubs.types.FunctionalityItem;
import org.gcube.vremanagement.vremodel.cl.stubs.types.FunctionalityNodes;
import org.gcube.vremanagement.vremodel.cl.stubs.types.GHN;
@ -94,5 +95,9 @@ public interface VREGeneratorInterface {
boolean isCloudSelected();
void removeVRE(ASLSession session, String id);
void undeployVRE(String id);
int getCloudVMSelected();
}

@ -126,14 +126,35 @@ protected static AtomicInteger vreId = new AtomicInteger(0);
* @param session the d4s session
* @param id the id of the VRE to be removed
*/
@Override
public void removeVRE(ASLSession session, String id) {
System.out.println("ID RECEIVED TO REMOVE:" + id);
log.info("ID RECEIVED TO REMOVE:" + id);
String currScope = ScopeProvider.instance.get();
ScopeProvider.instance.set(scope);
factory().build().removeVRE(id);
ScopeProvider.instance.set(currScope);
}
/**
* @param session the d4s session
* @param id the id of the VRE to be removed
*/
@Override
public void undeployVRE(String id) {
System.out.println("ID RECEIVED TO UNDEPLOY:" + id);
String currScope = ScopeProvider.instance.get();
ScopeProvider.instance.set(scope);
modelPortType = manager().at(factory().build().getEPRbyId(id)).build();
log.info("Trying UNDEPLOY:" + id + " name="+ modelPortType.getDescription().name());
modelPortType.undeployVRE();
ScopeProvider.instance.set(currScope);
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Override
public DeployReport checkVREStatus() throws RemoteException {
@ -276,7 +297,7 @@ protected static AtomicInteger vreId = new AtomicInteger(0);
*
*/
public boolean isCloudSelected() {
System.out.println("isCloudSelected()");
log.info("isCloudSelected()");
String currScope = ScopeProvider.instance.get();
ScopeProvider.instance.set(scope);
boolean toReturn = modelPortType.isUseCloud();

Loading…
Cancel
Save