use of de.fzj.unicore.uas.client.StorageFactoryClient in project airavata by apache.
the class StorageCreator method createStorage.
// The target site must have storage factory deployed with bes factory
public StorageClient createStorage() throws Exception {
if (factoryUrl == null) {
throw new Exception("Cannot create Storage Factory Url");
}
EndpointReferenceType sfEpr = WSUtilities.makeServiceEPR(factoryUrl, StorageFactory.SMF_PORT);
String dn = findServerName(factoryUrl, sfEpr);
WSUtilities.addServerIdentity(sfEpr, dn);
secProps.getETDSettings().setReceiver(new X500Principal(dn));
secProps.getETDSettings().setIssuerCertificateChain(secProps.getCredential().getCertificateChain());
// TODO: remove it afterwards
if (userName != null) {
secProps.getETDSettings().getRequestedUserAttributes2().put("xlogin", new String[] { userName });
}
StorageFactoryClient sfc = new StorageFactoryClient(sfEpr, secProps);
if (log.isDebugEnabled()) {
log.debug("Using storage factory at <" + sfc.getUrl() + ">");
}
StorageClient sc = null;
try {
sc = sfc.createSMS(getCreateSMSDocument());
String addr = sc.getEPR().getAddress().getStringValue();
log.info(addr);
} catch (Exception ex) {
log.error("Could not create storage", ex);
throw new Exception(ex);
}
return sc;
}
use of de.fzj.unicore.uas.client.StorageFactoryClient in project airavata by apache.
the class StorageCreator method createStorage.
// The target site must have storage factory deployed with bes factory
public StorageClient createStorage() throws Exception {
if (factoryUrl == null) {
throw new Exception("Cannot create Storage Factory Url");
}
EndpointReferenceType sfEpr = WSUtilities.makeServiceEPR(factoryUrl, StorageFactory.SMF_PORT);
String dn = findServerName(factoryUrl, sfEpr);
WSUtilities.addServerIdentity(sfEpr, dn);
secProps.getETDSettings().setReceiver(new X500Principal(dn));
secProps.getETDSettings().setIssuerCertificateChain(secProps.getCredential().getCertificateChain());
// TODO: remove it afterwards
if (userName != null) {
secProps.getETDSettings().getRequestedUserAttributes2().put("xlogin", new String[] { userName });
}
StorageFactoryClient sfc = new StorageFactoryClient(sfEpr, secProps);
if (log.isDebugEnabled()) {
log.debug("Using storage factory at <" + sfc.getUrl() + ">");
}
StorageClient sc = null;
try {
sc = sfc.createSMS(getCreateSMSDocument());
String addr = sc.getEPR().getAddress().getStringValue();
log.info(addr);
} catch (Exception ex) {
log.error("Could not create storage", ex);
throw new Exception(ex);
}
return sc;
}
Aggregations