vre-modeler/src/org/gcube/vremanagement/vremodeler/test/ModelerTest.java

45 lines
2.0 KiB
Java
Raw Normal View History

package org.gcube.vremanagement.vremodeler.test;
import java.util.List;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
import org.gcube.common.core.contexts.GHNContext;
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.scope.GCUBEScope;
import org.gcube.common.core.types.VOID;
import org.gcube.vremanagement.vremodeler.stubs.ModelerFactoryPortType;
import org.gcube.vremanagement.vremodeler.stubs.ModelerServicePortType;
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerFactoryServiceAddressingLocator;
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerServiceAddressingLocator;
public class ModelerTest {
public static void main(String[] args) throws Exception{
ISClient client = GHNContext.getImplementation(ISClient.class);
GCUBERIQuery riquery= client.getQuery(GCUBERIQuery.class);
riquery.addAtomicConditions(new AtomicCondition("//ServiceName", "VREModeler"));
List<GCUBERunningInstance> results=client.execute(riquery, GCUBEScope.getScope("/gcube/devsec"));
ModelerFactoryServiceAddressingLocator mfal =new ModelerFactoryServiceAddressingLocator();
EndpointReferenceType epr= results.get(0).getAccessPoint().getEndpoint("gcube/vremanagement/vremodeler/ModelFactoryService");
System.out.println(epr);
ModelerFactoryPortType mfptp= mfal.getModelerFactoryPortTypePort(epr);
mfptp = GCUBERemotePortTypeContext.getProxy(mfptp, GCUBEScope.getScope("/gcube/devsec"));
ModelerServiceAddressingLocator msal=new ModelerServiceAddressingLocator();
ModelerServicePortType msptp=msal.getModelerServicePortTypePort(mfptp.createResource(new VOID()));
msptp =GCUBERemotePortTypeContext.getProxy(msptp, GCUBEScope.getScope("/gcube/devsec"));
System.out.println(msptp.getGHNs(new VOID()));
}
}