@Override public StringList getDictionary(IntegerList wordIds, MALInteraction interaction) throws MALInteractionException, MALException { StringList output = new StringList(); for (Integer wordId : wordIds) { String word; try { word = dictionary.getWord(wordId); } catch (Exception ex) { word = null; Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } output.add(word); } return output; }
@Override public StringList getListOfPackages() throws IOException { // Go to the folder that contains the Packages and return the list of files! if (!folderWithPackages.exists()) { // The folder does not exist // Then create a new folder with a default name Logger.getLogger(NMFPackagePMBackend.class.getName()).log(Level.INFO, "The packages folder does not exist. It will be created in path: {0}", folderWithPackages.getCanonicalPath()); folderWithPackages.mkdir(); } File[] files = folderWithPackages.listFiles(); StringList packageNames = new StringList(files.length); // Cycle them and find the ones with the .nmfpack extension for (File file : files) { String name = file.getName(); // Check if the package ends with the expected suffix if (name.endsWith(HelperNMF.NMF_PACKAGE_SUFFIX)) { packageNames.add(name); } } // Return the filtered list return packageNames; }
private static StringList getAvailableTransports(AddressDetailsList addresses) { StringList transports = new StringList(); // List of transport names for (AddressDetails address : addresses) { // The name of the transport is always before ":" String[] parts = address.getServiceURI().toString().split(":"); transports.add(parts[0]); } return transports; }
public synchronized void init() { // Retrieve all the ids and providerURIs from the Database dbBackend.createEntityManager(); // Get All the providerURIs available Query query = dbBackend.getEM().createQuery(QUERY_SELECT_PROVIDERURI); List resultList = query.getResultList(); ArrayList<ProviderURIHolderEntity> providerURIHolderEntities = new ArrayList<ProviderURIHolderEntity>(); providerURIHolderEntities.addAll(resultList); dbBackend.closeEntityManager(); final IntegerList ids = new IntegerList(); final StringList providerURIs = new StringList(); // From the list of Entities to separate lists of ids and providerURIs for (int i = 0; i < providerURIHolderEntities.size(); i++) { ids.add(providerURIHolderEntities.get(i).getId()); providerURIs.add(providerURIHolderEntities.get(i).getProviderURIString()); } int max = 0; // Populate the variables on this class for (int i = 0; i < ids.size(); i++) { this.fastID.put(providerURIs.get(i), ids.get(i)); this.fastIDreverse.put(ids.get(i), providerURIs.get(i)); if (ids.get(i) > max) { // Get the maximum value max = ids.get(i); } } uniqueId = new AtomicInteger(max); }
hdrlst.add(new UpdateHeader(timestamp, connection.getConnectionDetails().getProviderURI(), UpdateType.UPDATE, ekey)); outputList.add(outputText); publisher.publish(hdrlst, outputList); } catch (IllegalArgumentException ex) {
String publicKey = backend.getPublicKey(packageName.getValue()); integrities.add(integrity); publicKeys.add(publicKey);