/** * Returns an Iterator for the users in the queue waiting to be routed to * an agent (QueueUser instances). * * @return an Iterator for the users waiting in the queue. */ public Iterator<QueueUser> getUsers() { if (users == null) { return new HashSet<QueueUser>().iterator(); } return Collections.unmodifiableSet(users).iterator(); }
public boolean isInOneOf(Set<?> allowedPrincipals) { Iterator<?> allowedIter = allowedPrincipals.iterator(); HashSet<?> userPrincipals = new HashSet<Object>(getPrincipals()); while (allowedIter.hasNext()) { Iterator<?> userIter = userPrincipals.iterator(); Object allowedPrincipal = allowedIter.next(); while (userIter.hasNext()) { if (allowedPrincipal.equals(userIter.next())) return true; } } return false; }
public java.util.Iterator getPorts() { if (ports == null) { ports = new java.util.HashSet(); ports.add(new javax.xml.namespace.QName("http://opennms.org/integration/otrs/ticketservice", "TicketServicePort")); } return ports.iterator(); }
private List<AllocNode> getMayAliasList(PointsToSetInternal pts) { List<AllocNode> list = new ArrayList<AllocNode>(); final HashSet<AllocNode> ret = new HashSet<AllocNode>(); pts.forall(new P2SetVisitor() { public void visit(Node n) { ret.add((AllocNode) n); } }); Iterator<AllocNode> it = ret.iterator(); while (it.hasNext()) { list.add(it.next()); } return list; }
public java.util.Iterator getPorts() { if (ports == null) { ports = new java.util.HashSet(); ports.add(new javax.xml.namespace.QName("urn:HPD_IncidentInterface_Create_WS", "HPD_IncidentInterface_Create_WSPortTypeSoap")); } return ports.iterator(); }
private static InputStream getConfigFileInputStream(String configFilePath) throws IOException { if (null == configFilePath) { throw new IOException( "Could not find config file, name not specified"); } HashSet<URL> resources = new HashSet<URL>(findResources(configFilePath)); if (resources.isEmpty()) { File configFile = new File(configFilePath); if (configFile.exists()) { return new FileInputStream(configFile); } } else if (resources.size() > 1) { throw new IOException( "Found multiple " + configFilePath + " resources. You're probably bundling the Storm jars with your topology jar. " + resources); } else { LOG.debug("Using " + configFilePath + " from resources"); URL resource = resources.iterator().next(); return resource.openStream(); } return null; }
private Iterator<Collector> includedCollectorIterator(Set<String> includedNames) { if (includedNames.isEmpty()) { return collectors().iterator(); } else { HashSet<Collector> collectors = new HashSet<Collector>(); synchronized (namesToCollectors) { for (Map.Entry<String, Collector> entry : namesToCollectors.entrySet()) { if (includedNames.contains(entry.getKey())) { collectors.add(entry.getValue()); } } } return collectors.iterator(); } }
@Override public HashSet<Column> getReferencedColumns(Table table) { HashSet<Column> columns = new HashSet<>(); expr.isEverything(ExpressionVisitor.getColumnsVisitor(columns)); for (Iterator<Column> it = columns.iterator(); it.hasNext();) { if (it.next().getTable() != table) { it.remove(); } } return columns; }
@Override public Set<String> keySet() { HashSet<String> stringSet = mdag.getAllStrings(); LinkedHashSet<String> keySet = new LinkedHashSet<String>(); Iterator<String> iterator = stringSet.iterator(); while (iterator.hasNext()) { String key = iterator.next(); keySet.add(key.substring(0, key.length() - 3)); } return keySet; }
public java.util.Iterator getPorts() { if (ports == null) { ports = new java.util.HashSet(); ports.add(new javax.xml.namespace.QName("HPD_IncidentInterface_WS", "HPD_IncidentInterface_WSPortTypeSoap")); } return ports.iterator(); }
public static InputStream getConfigFileInputStream(String configFilePath, boolean canMultiple) throws IOException { if (null == configFilePath) { throw new IOException("Could not find config file, name not specified"); } HashSet<URL> resources = new HashSet<>(findResources(configFilePath)); if (resources.isEmpty()) { File configFile = new File(configFilePath); if (configFile.exists()) { return new FileInputStream(configFile); } } else if (resources.size() > 1 && !canMultiple) { throw new IOException("Found multiple " + configFilePath + " resources. " + "You're probably bundling storm jars with your topology jar. " + resources); } else { LOG.debug("Using " + configFilePath + " from resources"); URL resource = resources.iterator().next(); return resource.openStream(); } return null; }