@Test public void testGetSignedUris() throws Exception { List<URI> signedUris; testAddService_1(); signedUris = classUnderTest.getSignedUris(serviceId.getIdentifier().toASCIIString()); assertEquals(1, signedUris.size(), 0.0); }
protected List<URI> getSignedUris(String serviceId) throws NegotiationException { List <URI> uri = new ArrayList<URI>(); String uriStr; String host; String sig; List <String> filePath; Service s = getService(serviceId); if (s == null) { throw new NegotiationException("Service " + serviceId + " not found"); } host = s.getFileServerHost().toString(); filePath = s.getFiles(); for (int k = 0; k < filePath.size(); k++) { try { sig = signatureMgr.sign(filePath.get(k), groupMgr.getIdMgr().getThisNetworkNode()); } catch (DigsigException e) { LOG.error("Failed to sign file " + filePath.get(k) + " of service " + serviceId, e); throw new NegotiationException(e); } uriStr = uriForFileDownload(host, filePath.get(k), serviceId, sig); try { uri.add(new URI(uriStr)); } catch (URISyntaxException e) { throw new NegotiationException(e); } } return uri; }
ProviderServiceMgr implements INegotiationProviderServiceMgmt { protected List<URI> getSignedUris(String serviceId) throws NegotiationException { List <URI> uri = new ArrayList<URI>(); String uriStr; String host; String sig; List <String> filePath; Service s = getService(serviceId); if (s == null) { throw new NegotiationException("Service " + serviceId + " not found"); } host = s.getFileServerHost().toString(); filePath = s.getFiles(); for (int k = 0; k < filePath.size(); k++) { try { sig = signatureMgr.sign(filePath.get(k), groupMgr.getIdMgr().getThisNetworkNode()); } catch (DigsigException e) { LOG.error("Failed to sign file " + filePath.get(k) + " of service " + serviceId, e); throw new NegotiationException(e); } uriStr = uriForFileDownload(host, filePath.get(k), serviceId, sig); try { uri.add(new URI(uriStr)); } catch (URISyntaxException e) { throw new NegotiationException(e); } } return uri; } }
ProviderServiceMgr implements INegotiationProviderServiceMgmt { protected List<URI> getSignedUris(String serviceId) throws NegotiationException { List <URI> uri = new ArrayList<URI>(); String uriStr; String host; String sig; List <String> filePath; Service s = getService(serviceId); if (s == null) { throw new NegotiationException("Service " + serviceId + " not found"); } host = s.getFileServerHost().toString(); filePath = s.getFiles(); for (int k = 0; k < filePath.size(); k++) { try { sig = signatureMgr.sign(filePath.get(k), groupMgr.getIdMgr().getThisNetworkNode()); } catch (DigsigException e) { LOG.error("Failed to sign file " + filePath.get(k) + " of service " + serviceId, e); throw new NegotiationException(e); } uriStr = uriForFileDownload(host, filePath.get(k), serviceId, sig); try { uri.add(new URI(uriStr)); } catch (URISyntaxException e) { throw new NegotiationException(e); } } return uri; } ProviderServiceMgr(); }
ProviderServiceMgr implements INegotiationProviderServiceMgmt { protected List<URI> getSignedUris(String serviceId) throws NegotiationException { List <URI> uri = new ArrayList<URI>(); String uriStr; String host; String sig; List <String> filePath; Service s = getService(serviceId); if (s == null) { throw new NegotiationException("Service " + serviceId + " not found"); } host = s.getFileServerHost().toString(); filePath = s.getFiles(); for (int k = 0; k < filePath.size(); k++) { try { sig = signatureMgr.sign(filePath.get(k), groupMgr.getIdMgr().getThisNetworkNode()); } catch (DigsigException e) { LOG.error("Failed to sign file " + filePath.get(k) + " of service " + serviceId, e); throw new NegotiationException(e); } uriStr = uriForFileDownload(host, filePath.get(k), serviceId, sig); try { uri.add(new URI(uriStr)); } catch (URISyntaxException e) { throw new NegotiationException(e); } } return uri; } ProviderServiceMgr(); IClientJarServerRemote getClientJarServer(); void setClientJarServer(IClientJarServerRemote clientJarServer); ISignatureMgr getSignatureMgr(); void setSignatureMgr(ISignatureMgr signatureMgr); INegotiationProviderRemote getGroupMgr(); void setGroupMgr(INegotiationProviderRemote groupMgr); ServiceDao getServiceDao(); void setServiceDao(ServiceDao serviceDao); void init(); @Override void addService(ServiceResourceIdentifier serviceId, String slaXml, URI fileServer,
			URL[] fileUrls, INegotiationProviderSLMCallback callback); @Override void removeService(ServiceResourceIdentifier serviceId); }
ProviderServiceMgr implements INegotiationProviderServiceMgmt { protected List<URI> getSignedUris(String serviceId) throws NegotiationException { List <URI> uri = new ArrayList<URI>(); String uriStr; String host; String sig; List <String> filePath; Service s = getService(serviceId); if (s == null) { throw new NegotiationException("Service " + serviceId + " not found"); } host = s.getFileServerHost().toString(); filePath = s.getFiles(); for (int k = 0; k < filePath.size(); k++) { try { sig = signatureMgr.sign(filePath.get(k), groupMgr.getIdMgr().getThisNetworkNode()); } catch (DigsigException e) { LOG.error("Failed to sign file " + filePath.get(k) + " of service " + serviceId, e); throw new NegotiationException(e); } uriStr = uriForFileDownload(host, filePath.get(k), serviceId, sig); try { uri.add(new URI(uriStr)); } catch (URISyntaxException e) { throw new NegotiationException(e); } } return uri; } ProviderServiceMgr(); IClientJarServerRemote getClientJarServer(); void setClientJarServer(IClientJarServerRemote clientJarServer); ISignatureMgr getSignatureMgr(); void setSignatureMgr(ISignatureMgr signatureMgr); INegotiationProviderRemote getGroupMgr(); void setGroupMgr(INegotiationProviderRemote groupMgr); ServiceDao getServiceDao(); void setServiceDao(ServiceDao serviceDao); void init(); @Override void addService(ServiceResourceIdentifier serviceId, String slaXml, URI fileServer,
			URL[] fileUrls, INegotiationProviderSLMCallback callback); @Override void removeService(ServiceResourceIdentifier serviceId);  }