/** * Returns true if the document referenced by this document operation is accepted by this selector * * @param op A document operation * @return True if the document is accepted. * @throws RuntimeException if the evaluation enters an illegal state */ public Result accepts(DocumentOperation op) { return accepts(new Context(op)); }
/** * Returns true if the entry matches the selection criteria given. */ public boolean match(Document doc, long timestamp) { if (timestamp < fromTimestamp) { return false; } if (timestamp > toTimestamp) { return false; } if (timestampSubset != null && !timestampSubset.contains(timestamp)) { return false; } if (documentSelection != null && doc != null && !documentSelection.accepts(new DocumentPut(doc)).equals(Result.TRUE)) { return false; } return true; }
return selector.accepts(((PutDocumentMessage)msg).getDocumentPut()) == Result.TRUE; return selector.accepts(((UpdateDocumentMessage)msg).getDocumentUpdate()) != Result.FALSE; return selector.accepts(removeMsg.getDocumentRemove()) != Result.FALSE; } else { return true; if (getMsg.getDocumentId().hasDocType()) { DocumentGet getOp = new DocumentGet(getMsg.getDocumentId()); return selector.accepts(getOp) != Result.FALSE; } else { return true;