2008-10-30 19:54:34 +01:00
|
|
|
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;
|
2008-11-04 17:36:08 +01:00
|
|
|
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerFactoryServiceAddressingLocator;
|
2008-10-30 19:54:34 +01:00
|
|
|
import org.gcube.vremanagement.vremodeler.stubs.service.ModelerServiceAddressingLocator;
|
|
|
|
|
2008-11-04 17:36:08 +01:00
|
|
|
|
2008-10-30 19:54:34 +01:00
|
|
|
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"));
|
|
|
|
|
2008-11-04 17:36:08 +01:00
|
|
|
ModelerFactoryServiceAddressingLocator mfal =new ModelerFactoryServiceAddressingLocator();
|
2008-10-30 19:54:34 +01:00
|
|
|
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()));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|