/** * * @param filterList - List of Filters that should be executed. * Also appends the FinalFilter, which makes the wsdl call, to the List */ public FilteredAWSService(ClientConfig config, List<Filter> filterList) { super(config); this.filterList = new LinkedList<Filter>(filterList); this.filterList.addLast(new FinalFilter(this)); Filter.linkFilters(this.filterList); }
/** * * @param filter - Removes the Filter from List of Filters, if it is remavable and found in the list * Throws RuntimeException if filter not found in list or not removable */ public void removeFilter(Filter filter) { if (!filter.isRemovable()) throw new RuntimeException("Filter cannot be removed" + filter); if (!this.filterList.remove(filter)) throw new RuntimeException("Filter not found in list" + filter); Filter.linkFilters(this.filterList); }
/** * Clears all filters which are removable from the List of Filters * */ public void clearFilters() { for (Iterator<Filter> iterator = filterList.iterator(); iterator.hasNext();) { Filter filter = iterator.next(); if (filter.isRemovable()) { iterator.remove(); } } Filter.linkFilters(this.filterList); }
public void testChangeReward() throws ServiceException { Filter filter = new CheckRewardFilter(); service.addFilter(filter); String hitId = service.createHIT(defaultHITTitle + unique, defaultHITDescription, defaultReward, RequesterService.getBasicFreeTextQuestion(defaultQuestion), defaultMaxAssignments).getHITId(); HIT hit = service.getHIT(hitId); assertEquals(hit.getReward().getAmount().doubleValue(), 0.05); service.removeFilter(filter); }
/** * * @param filter - Adds the Filter implementaion to head of the List of Filters */ public void addFilter(Filter filter) { this.filterList.addFirst(filter); Filter.linkFilters(this.filterList); }
public void appendFilter(Filter filter) { service.addFilter(filter); }
/** * Creates a new asynchronous request * * @param msg The request to send to the requester endpoint * @param f The first filter to invoke * @param callback (Optional) A callback handler to invoke when the work queue processed the request */ public AsyncRequest(Message msg, Filter f, AsyncCallback callback) { this.message = msg; this.firstFilter = f; this.cb = callback; }
/** * * @return - List of filters */public List<Filter> getFilterList() { return filterList; }