private StorageClient getHomeStorageClient(TSSClient tss, IUASSecurityProperties pSecurityProperties) { List<EndpointReferenceType> storageList = tss.getStorages(); if (storageList.size() < 1) { LOGGER.error("No home storage found at target system '" + tss.getTargetSystemName() + "'."); throw new RuntimeException("No home storage found at target system '" + tss.getTargetSystemName() + "'."); } if (storageList.size() > 1) { LOGGER.error("More than one home storage found at target system '" + tss.getTargetSystemName() + "'."); throw new RuntimeException("More than one home storage found at target system '" + tss.getTargetSystemName() + "'."); } EndpointReferenceType smsEpr = storageList.get(0); LOGGER.info("Create Storage Management Service (SMS) at '" + smsEpr.getAddress().getStringValue() + "'."); StorageClient client; try { client = new StorageClient(smsEpr.getAddress().getStringValue(), smsEpr, pSecurityProperties); } catch (Exception e) { LOGGER.error("Error during creation of Storage Management Service (SMS)."); throw new RuntimeException("Error during creation of Storage Management Service (SMS)."); } return client; }
/** * @param tss * @return * @throws Exception */ private StorageClient getHomeStorageClient(TSSClient tss, IUASSecurityProperties pSecurityProperties) throws ExceptionReport { try { List<EndpointReferenceType> storageList = tss.getStorages(); if (storageList.size() < 1) { LOGGER.error("No home storage found at target system '" + tss.getTargetSystemName() + "'."); throw new Exception("No home storage found at target system '" + tss.getTargetSystemName() + "'."); } if (storageList.size() > 1) { LOGGER.warn("More than one home storage found at target system '" + tss.getTargetSystemName() + "'."); } EndpointReferenceType smsEpr = storageList.get(0); LOGGER.info("Select Storage Management Service (SMS) at '" + smsEpr.getAddress().getStringValue() + "'."); StorageClient client = new StorageClient(smsEpr.getAddress().getStringValue(), smsEpr, pSecurityProperties); return client; } catch (Exception e) { LOGGER.error("Error while accessing home storage."); throw new ExceptionReport("Error while accessing home storage.", ExceptionReport.REMOTE_COMPUTATION_ERROR, e); } }
EndpointReferenceType eprt = (EndpointReferenceType) jobExecutionContext.getProperty(PROP_SMS_EPR); try { storageClient = new StorageClient(eprt, secProperties); } catch (Exception e) { throw new GFacHandlerException("Cannot create storage..", e);