use of org.gridlab.gat.URI in project compss by bsc-wdc.
the class LfnFileCopy method main.
/**
* @param args
*/
public static void main(String[] args) throws Exception {
String lfnroot = "lfn:/grid/pvier/ceriel/";
// Create a new CertificateSecurityContext containing the globus certificates
// and the user password.
CertificateSecurityContext securityContext = new CertificateSecurityContext(new URI(System.getProperty("user.home") + "/.globus/userkey.pem"), new URI(System.getProperty("user.home") + "/.globus/usercert.pem"), getPassphrase());
// Store this SecurityContext in a GATContext
GATContext context = new GATContext();
context.addSecurityContext(securityContext);
context.addPreference("VirtualOrganisation", "pvier");
context.addPreference("vomsServerUrl", "voms.grid.sara.nl");
context.addPreference("vomsServerPort", "30000");
context.addPreference("vomsHostDN", "/O=dutchgrid/O=hosts/OU=sara.nl/CN=voms.grid.sara.nl");
context.addPreference("LfcServer", "lfc.grid.sara.nl");
context.addPreference("bdiiURI", "ldap://bdii.grid.sara.nl:2170");
// context.addPreference("ftp.connection.passive", "false");
// context.addPreference("ftp.server.noauthentication", "true");
// context.addPreference("gridftp.authenticate.retry", "5");
// context.addPreference("preferredSEID", "srm.grid.sara.nl");
GAT.setDefaultGATContext(context);
File exampleFile = GAT.createFile(lfnroot + "text.txt");
exampleFile.copy(new URI("localtext.txt"));
File exampleFile2 = GAT.createFile("localtext.txt");
exampleFile2.copy(new URI(lfnroot + "data"));
GAT.end();
}
use of org.gridlab.gat.URI in project compss by bsc-wdc.
the class RemoteCopy method main.
/**
* Copies a file over the grid.
*
* @param args
* the arguments. args[0] should contain the source, args[1] the
* destination
* @throws Exception
*/
public static void main(String[] args) throws Exception {
GAT.createFile(args[0]).copy(new URI(args[1]));
GAT.end();
}
use of org.gridlab.gat.URI in project compss by bsc-wdc.
the class SubmitRemoteJob method main.
public static void main(String[] args) throws Exception {
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/hostname");
File stdout = GAT.createFile("hostname.txt");
sd.setStdout(stdout);
JobDescription jd = new JobDescription(sd);
Preferences prefs = new Preferences();
/*
prefs.put("VirtualOrganisation", "pvier");
prefs.put("vomsServerURL", "voms.grid.sara.nl");
prefs.put("vomsServerPort", "30000");
prefs.put("vomsHostDN", "/O=dutchgrid/O=hosts/OU=sara.nl/CN=voms.grid.sara.nl");
*/
CertificateSecurityContext ctxt = new CertificateSecurityContext(new URI(System.getProperty("user.home") + "/.globus/userkey.pem"), new URI(System.getProperty("user.home") + "/.globus/usercert.pem"), getPassphrase());
GATContext context = new GATContext();
context.addPreferences(prefs);
context.addSecurityContext(ctxt);
ResourceBroker broker = GAT.createResourceBroker(context, new URI(args[0]));
Job job = broker.submitJob(jd);
while ((job.getState() != JobState.STOPPED) && (job.getState() != JobState.SUBMISSION_ERROR)) {
System.out.println("State: " + job.getState());
Thread.sleep(1000);
}
}
Aggregations