public List getAll() { return super.getAllResources(); }
public List getAll() { return super.getAllResources(); }
public List getAll() { return super.getAllResources(); }
public List getAll(int first, int last) { return super.getAllResources(first, last); }
public List getAll(String target) { List all = super.getAllResources(); // pick out from all those that are for this target List found = new Vector(); for (Iterator iAll = all.iterator(); iAll.hasNext();) { BaseAliasEdit a = (BaseAliasEdit) iAll.next(); if (a.getTarget().equals(target)) found.add(a); } return found; }
public List getAll(String target, int first, int last) { List all = super.getAllResources(); // pick out from all those that are for this target List found = new Vector(); for (Iterator iAll = all.iterator(); iAll.hasNext();) { BaseAliasEdit a = (BaseAliasEdit) iAll.next(); if (a.getTarget().equals(target)) found.add(a); } // sort for position check Collections.sort(found); // subset by position if (first < 1) first = 1; if (last >= found.size()) last = found.size(); found = found.subList(first - 1, last); return found; }
/** * Get a Set of all the notifications that are interested in this Event function. Note: instead of this looking, we could have an additional "key" in storage of the event... -ggolen * * @param function * The Event function * @return The Set (Notification) of all the notifications that are interested in this Event function. */ public List getAll(String function) { List rv = new Vector(); if (function == null) return rv; List all = super.getAllResources(); for (Iterator it = all.iterator(); it.hasNext();) { Notification notification = (Notification) it.next(); if (notification.containsFunction(function)) { rv.add(notification); } } return rv; }
/** * Count all the aliases with id or target matching criteria. * * @param criteria * The search criteria. * @return The count of all aliases with id or target matching criteria. */ public int countSearch(String criteria) { List all = super.getAllResources(); Vector rv = new Vector(); for (Iterator i = all.iterator(); i.hasNext();) { Alias a = (Alias) i.next(); if (StringUtil.containsIgnoreCase(a.getId(), criteria) || StringUtil.containsIgnoreCase(a.getTarget(), criteria)) { rv.add(a); } } return rv.size(); }
/** * Search for aliases with id or target matching criteria, in range. * * @param criteria * The search criteria. * @param first * The first record position to return. * @param last * The last record position to return. * @return The List (BaseAliasEdit) of all alias. */ public List search(String criteria, int first, int last) { List all = super.getAllResources(); List rv = new Vector(); for (Iterator i = all.iterator(); i.hasNext();) { Alias a = (Alias) i.next(); if (StringUtil.containsIgnoreCase(a.getId(), criteria) || StringUtil.containsIgnoreCase(a.getTarget(), criteria)) { rv.add(a); } } Collections.sort(rv); // subset by position if (first < 1) first = 1; if (last >= rv.size()) last = rv.size(); rv = rv.subList(first - 1, last); return rv; }