Hi all,
I got a problem concerning the staging file.
Googoling around it appears that in order to perform the "Delagation" it is
necessary to add the "-S" argument calling "globusrun-ws".
However how should the "delagation" be called from a java application? How must
I get the same behavior (the -S argument) within the RSL ?
Below I have attached the RSL utilized by the java application. How can I
introduce the "stagingCredentialEndpoint" in the RSL? How can the staging
operation be done ?
There is any further step to be done ?
RSL:<?xml version="1.0" encoding="UTF-8"?>
<job><executable>/home/scope/esempi2/esercizio_2/readwrite.out</executable><directory>/home/scope/esempi2/esercizio_2</directory><stdin>/dev/null</stdin>
<stdout>/home/scope/esempi2/stdout</stdout><stderr>/home/scope/esempi2/stderr</stderr>
<count>1</count><fileStageIn> <transfer>
<sourceUrl>gsiftp://job.submitting.host:2811/home/scope/esempi2/test.dat</sourceUrl>
<destinationUrl>file:///home/scope/esempi2/esercizio_2/test.dat</destinationUrl>
</transfer> </fileStageIn> <fileStageOut> <transfer>
<sourceUrl>file:///home/scope/esempi2/esercizio_2/test.dat</sourceUrl>
<destinationUrl>gsiftp://job.submitting.host:2811/home/scope/esempi2/test.dat</destinationUrl>
</transfer> </fileStageOut></job> -----------------------------------
//Java class that use GramJob to submit a job
//with a specified RSL :
package esercizio_2;
import javax.xml.namespace.QName;
import org.globus.exec.client.GramJob;
import org.globus.wsrf.impl.*;
import org.apache.axis.components.uuid.UUIDGen;
import org.apache.axis.components.uuid.UUIDGenFactory;
import org.apache.axis.message.addressing.ReferencePropertiesType;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.message.addressing.Address;
import org.globus.exec.client.GramJobListener;
import org.globus.exec.generated.StateEnumeration;
import org.globus.exec.utils.ManagedJobConstants;
import org.globus.wsrf.impl.security.authentication.Constants;
import org.globus.wsrf.impl.security.authorization.HostAuthorization;
import org.globus.wsrf.impl.security.authorization.Authorization;
import org.globus.wsrf.impl.SimpleResourceKey;
import java.lang.*;
import java.io.*;
public class Submitter2 {
/* -- Attributi -- */
private static Object waiter=new Object();
private Listener2 listener=new Listener2(waiter);
/* -- Metodi -- */
public void submitjob() throws Exception {
//[ .........................]
/* Creazione Endpoint del servizio */
EndpointReferenceType endpoint=new EndpointReferenceType();
endpoint.setAddress(new
Address("http://192.168.1.10:8080/wsrf/services"
+"/ManagedJobFactoryService"));
ReferencePropertiesType properties = new ReferencePropertiesType();
SimpleResourceKey key = new
SimpleResourceKey(ManagedJobConstants.RESOURCE_KEY_QNAME,"Fork");
properties.add(key.toSOAPElement());
endpoint.setProperties(properties);
/* Determinzione dell'RSL */
String rsl=new String();
rsl="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <job>\n"
+"<executable>/home/scope/esempi2/esercizio_2/readwrite.out</executable>\n"
+"<directory>/home/scope/esempi2/esercizio_2</directory>\n"
+"<stdin>/dev/null</stdin>\n
<stdout>/home/scope/esempi2/stdout</stdout>\n"
+"<stderr>/home/scope/esempi2/stderr</stderr>\n
<count>1</count>\n"
+"<fileStageIn>\n <transfer>\n <sourceUrl>"
+"gsiftp://192.168.1.10:2811/home/scope/esempi2/test.dat</sourceUrl>\n"
+"<destinationUrl>file://"
+"/home/scope/esempi2/esercizio_2/test.dat</destinationUrl>\n"
+"</transfer>\n </fileStageIn>\n <fileStageOut>\n
<transfer>\n <sourceUrl>"
+"file:///home/scope/esempi2/esercizio_2/test.dat"
+"</sourceUrl>\n <destinationUrl>"
+"gsiftp://192.168.1.10:2811/home/scope/esempi2/test.dat</destinationUrl>\n"
+"</transfer>\n </fileStageOut>\n"
+"</job>";
System.out.println("L'RSL usato é :\n"+rsl+"\n");
/* Sicurezza */
Authorization authz=HostAuthorization.getInstance();
Integer xmlSecurity=Constants.ENCRYPTION;
/* Generazione dell'id del job */
UUIDGen uuidgen=UUIDGenFactory.getUUIDGen();
String submissionID ="uuid:"+uuidgen.nextUUID();
System.out.println(submissionID);
/* Crerazione del job e sottomissione */
org.globus.exec.client.GramJob job=new
org.globus.exec.client.GramJob(rsl);
job.addListener(listener);
job.submit(endpoint, false,false,submissionID);
/* Attesa fine Job */
synchronized(waiter){waiter.wait();}
}
}
Thanks in advance
Andrea
_________________________________________________________________
Organizza le tue foto e condividile con i tuoi amici con Raccolta foto di
Windows Live!
http://www.windowslive.it