This commit is contained in:
Lucio Lelii 2008-11-04 16:14:06 +00:00
parent 827e2a6e98
commit 557e61e482
2 changed files with 70 additions and 4 deletions

View File

@ -18,7 +18,7 @@
<Class>VREManagement</Class>
<Name>VREModeler</Name>
</Service>
<Package>Stubs</Package>
<Package>VREModeler-stubs</Package>
<Version>1.0.0</Version>
<Scope level="GHN"/>
<Optional>false</Optional>

View File

@ -9,9 +9,19 @@ import java.util.List;
import javax.xml.rpc.ServiceException;
import org.gcube.common.core.contexts.GHNContext;
import org.gcube.common.core.faults.GCUBEFault;
import org.gcube.common.core.informationsystem.client.AtomicCondition;
import org.gcube.common.core.informationsystem.client.ISClient;
import org.gcube.common.core.informationsystem.client.queries.GCUBERIQuery;
import org.gcube.common.core.resources.GCUBERunningInstance;
import org.gcube.common.core.types.VOID;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.vremanagement.vremanager.stubs.vremanager.AddResourcesParameters;
import org.gcube.vremanagement.vremanager.stubs.vremanager.OptionsParameters;
import org.gcube.vremanagement.vremanager.stubs.vremanager.ResourceItem;
import org.gcube.vremanagement.vremanager.stubs.vremanager.ResourceList;
import org.gcube.vremanagement.vremanager.stubs.vremanager.ScopeOption;
import org.gcube.vremanagement.vremanager.stubs.vremanager.VREManagerPortType;
import org.gcube.vremanagement.vremanager.stubs.vremanager.service.VREManagerServiceAddressingLocator;
import org.gcube.vremanagement.vremodeler.db.DBInterface;
@ -445,12 +455,68 @@ public class ModelerService {
}
VREManagerServiceAddressingLocator vreManAL= new VREManagerServiceAddressingLocator();
VREManagerPortType vreManagerPT= null;
try {
VREManagerPortType vreManagerPT=vreManAL.getVREManagerPortTypePort();
ISClient client= GHNContext.getImplementation(ISClient.class);
GCUBERIQuery query=client.getQuery(GCUBERIQuery.class);
query.addAtomicConditions(new AtomicCondition("//ServiceName", "VREManager"));
query.addAtomicConditions(new AtomicCondition("//ServiceClass", "VREManagement"));
List<GCUBERunningInstance> ris= client.execute(query, ServiceContext.getContext().getScope());
for (GCUBERunningInstance ri: ris){
try{
vreManagerPT=vreManAL.getVREManagerPortTypePort(ri.getAccessPoint().getEndpoint("gcube/vremanagement/VREManager"));
OptionsParameters ops=new OptionsParameters();
ScopeOption[] scopeOptionList= new ScopeOption[6];
ScopeOption soDesigner= new ScopeOption();
soDesigner.setName("DESIGNER");
scopeOptionList[0]= soDesigner;
ScopeOption soCreator= new ScopeOption();
soCreator.setName("CREATOR");
scopeOptionList[1]= soCreator;
ScopeOption soEndtime= new ScopeOption();
soEndtime.setName("ENDTIME");
scopeOptionList[2]= soEndtime;
ScopeOption soStarttime= new ScopeOption();
soStarttime.setName("STARTTIME");
scopeOptionList[3]= soStarttime;
ScopeOption soDescription= new ScopeOption();
soDescription.setName("DESCRIPTION");
scopeOptionList[4]= soDescription;
ScopeOption soDisplayname= new ScopeOption();
soDisplayname.setName("DISPLAYNAME");
scopeOptionList[5]= soDisplayname;
ops.setScopeOptionList(scopeOptionList);
vreManagerPT.setScopeOptions(ops);
//ResourceItem resItem= new ResourceItem();
AddResourcesParameters addRParams= new AddResourcesParameters();
ResourceList rList= new ResourceList();
ResourceItem[] resItems=new ResourceItem[10];
ResourceItem resItem;
}catch(Exception e){logger.debug("trying next ri");}
}
} catch (ServiceException e) {
throw new GCUBEFault(e);
} catch (Exception e) {
throw new GCUBEFault("cannot retrieve VREManager");
}
/*