Examples of FlagTerm


Examples of javax.mail.search.FlagTerm

        flags = new Flags( Flags.Flag.SEEN );
      } else {
        throw( new XPathException(this, "Invalid flag: " + flag + ", for term with type: " + ((Element)terms).getAttribute( "type" ) ) );
      }
       
      st = new FlagTerm( flags, value.equalsIgnoreCase( "true" ) );
    } else {
      throw( new XPathException(this, "flag attribute must be specified for term with type: " + ((Element)terms).getAttribute( "type" ) ) );
    }
   
    return( st );
View Full Code Here

Examples of javax.mail.search.FlagTerm

            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)));
View Full Code Here

Examples of javax.mail.search.FlagTerm

            case KEYWORD:
                seekStrategy = new BodyTerm(value);
                LOG.debug("Fetching emails containing the keyword \"" + value + "\"");
                break;
            case UNREAD:
                seekStrategy = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
                LOG.debug("Fetching all unread emails");
                break;
        }
        try {
            final List<GmailMessage> found = new ArrayList<GmailMessage>();
View Full Code Here

Examples of javax.mail.search.FlagTerm

        try {
            final Store store = openGmailStore();
            folder = getFolder(this.srcFolder, store);
            folder.open(Folder.READ_WRITE);
            for (final Message message : folder.search(new FlagTerm(
                    new Flags(Flags.Flag.SEEN), false))) {
                message.setFlag(Flags.Flag.SEEN, true);
            }
        } catch (Exception e) {
            throw new GmailException("ImapGmailClient failed marking"
View Full Code Here

Examples of javax.mail.search.FlagTerm

        try {
            final List<GmailMessage> priorityMessages = new ArrayList<GmailMessage>();
            final Store store = openGmailStore();
            Folder folder = getFolder(ImapGmailLabel.IMPORTANT.getName(),store);
            folder.open(Folder.READ_ONLY);
            for (final Message msg : folder.search(new FlagTerm(
                    new Flags(Flags.Flag.SEEN), !unreadOnly))) {
                priorityMessages.add(new JavaMailGmailMessage(msg));
            }
           
            return priorityMessages;
View Full Code Here

Examples of javax.mail.search.FlagTerm

            if (count > 0) {
                Message[] messages;

                // should we process all messages or only unseen messages
                if (endpoint.getConfiguration().isProcessOnlyUnseenMessages()) {
                    messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
                } else {
                    messages = folder.getMessages();
                }

                processMessages(messages);
View Full Code Here

Examples of javax.mail.search.FlagTerm

            case KEYWORD:
                seekStrategy = new BodyTerm(value);
                LOG.debug("Fetching emails containing the keyword \"" + value + "\"");
                break;
            case UNREAD:
                seekStrategy = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
                LOG.debug("Fetching all unread emails");
                break;
        }
        try {
            final GmailMessageList found = new GmailMessageList();
View Full Code Here

Examples of javax.mail.search.FlagTerm

        try {
            final Store store = openGmailStore();
            folder = getFolder(this.srcFolder, store);
            folder.open(Folder.READ_WRITE);
            for (final Message message : folder.search(new FlagTerm(
                    new Flags(Flags.Flag.SEEN), false))) {
                message.setFlag(Flags.Flag.SEEN, true);
            }
        } catch (Exception e) {
            throw new GmailException("ImapGmailClient failed marking"
View Full Code Here

Examples of javax.mail.search.FlagTerm

        try {
            final List<GmailMessage> priorityMessages = new ArrayList<GmailMessage>();
            final Store store = openGmailStore();
            Folder folder = getFolder(ImapGmailLabel.IMPORTANT.getName(),store);
            folder.open(Folder.READ_ONLY);
            for (final Message msg : folder.search(new FlagTerm(
                    new Flags(Flags.Flag.SEEN), !unreadOnly))) {
                priorityMessages.add(new JavaMailGmailMessage(msg));
            }
           
            return priorityMessages;
View Full Code Here

Examples of javax.mail.search.FlagTerm

                        matchedEmails.add(message);
                    }
                    break;
                case UNREAD:
                    if (((JavaMailGmailMessage)message).getMessage()
                            .match(new FlagTerm(new Flags(Flags.Flag.SEEN), false))) {
                        matchedEmails.add(message);
                    }
                    break;
            }
            LOG.debug("Processing record: " + counter + " of " + total + "  "
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.