112113114115116117118119120121122
if (count > 0) { Message[] messages; // should we process all messages or only unseen messages if (getEndpoint().getConfiguration().isUnseen()) { messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false)); } else { messages = folder.getMessages(); } polledMessages = processBatch(CastUtils.cast(createExchanges(messages)));
300301302303304305306307308309310
folder.close(false); return; } // get all messages Message[] messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false)); FetchProfile profile = new FetchProfile(); profile.add(FetchProfile.Item.ENVELOPE); profile.add(FetchProfile.Item.FLAGS); profile.add("X-Mailer"); folder.fetch(messages, profile);
102103104105106107108109110111112
if (count > 0) { Message[] messages; // should we process all messages or only unseen messages if (endpoint.getConfiguration().isUnseen()) { messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false)); } else { messages = folder.getMessages(); } processBatch(CastUtils.cast(createExchanges(messages)));
100101102103104105106107108109110
if (count > 0) { Message[] messages; // should we process all messages or only unseen messages if (endpoint.getConfiguration().isUnseen()) { messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false)); } else { messages = folder.getMessages(); } Queue<Exchange> exchanges = createExchanges(messages);
105106107108109110111112113114115
111112113114115116117118119120121
747576777879808182
public SearchTermBuilder unseen() { return unseen(Op.and); } public SearchTermBuilder unseen(Op op) { SearchTerm st = new FlagTerm(new Flags(Flags.Flag.SEEN), false); addTerm(op, st); return this; }
134135136137138139140141142
public SearchTermBuilder flag(Flags flags, boolean set) { return flag(Op.and, flags, set); } public SearchTermBuilder flag(Op op, Flags flags, boolean set) { SearchTerm st = new FlagTerm(flags, set); addTerm(op, st); return this; }