Package javax.mail.search

Examples of javax.mail.search.SearchTerm


      System.out.println("calling SearchEntryPanel.getSearchTerm()");
  if (searchTerms.size() > 0) {
      if (Pooka.isDebug())
    System.out.println("SearchEntryPanel:  searchTerms.size() > 0.");
      SearchEntryPair pair = (SearchEntryPair) searchTerms.elementAt(0);
      SearchTerm term = pair.form.generateSearchTerm();
      if (Pooka.isDebug())
    System.out.println("SearchEntryPanel:  setting term to " + term);
      for (int i = 1; i < searchTerms.size(); i++) {
    SearchEntryPair newPair = (SearchEntryPair) searchTerms.elementAt(i);
    SearchTerm newTerm = newPair.form.generateSearchTerm();
    if (newPair.connector.getType() == AND) {
        term = new javax.mail.search.AndTerm(term, newTerm);
    } else if (newPair.connector.getType() == OR) {
        term = new javax.mail.search.OrTerm(term, newTerm);
    }
View Full Code Here


    Vector items = Pooka.getResources().getPropertyAsVector(property + ".value", "");
    for (int i = 0; i < items.size(); i++) {
      String subProperty = property + "." + (String) items.elementAt(i);
      Component currentIcon = loadImage(Pooka.getProperty(subProperty + ".icon", ""));
      if (currentIcon != null) {
  SearchTerm currentTerm = null;
  try {
    currentTerm = createSearchTerm(subProperty , manager);
  } catch (java.text.ParseException pe) {
   
  }
View Full Code Here

     * @throws MessagingException If message retrieval fails
     */
    private Message[] retrieveMessages() throws MessagingException {
        Message[] messages;
        final SortTerm[] sortTerm = getEndpoint().getSortTerm();
        final SearchTerm searchTerm = computeSearchTerm();
        if (sortTerm != null && serverCanSort) {
            final IMAPFolder imapFolder = (IMAPFolder) folder;
            if (searchTerm != null) {
                // Sort and search using server capability
                messages = imapFolder.getSortedMessages(sortTerm, searchTerm);
View Full Code Here

    protected Message[] searchForNewMessages(Folder folder) throws MessagingException {
        if (!folder.isOpen()) {
            return new Message[0];
        }
        Flags supportedFlags = folder.getPermanentFlags();
        SearchTerm searchTerm = null;
        if (supportedFlags != null) {
            if (supportedFlags.contains(Flags.Flag.RECENT)) {
                searchTerm = new FlagTerm(new Flags(Flags.Flag.RECENT), true);
            }
            if (supportedFlags.contains(Flags.Flag.ANSWERED)) {
View Full Code Here

            catch (InterruptedException e) {
                // Re-interrupt current thread, to allow other threads to react.
                Thread.currentThread().interrupt();
            }
            openFolder();
            SearchTerm searchTerm = new HeaderTerm(MailTransportConstants.HEADER_IN_REPLY_TO, requestMessageId);
            Message[] responses = folder.search(searchTerm);
            if (responses.length > 0) {
                if (responses.length > 1) {
                    logger.warn("Received more than one response for request with ID [" + requestMessageId + "]");
                }
View Full Code Here

                              ImapSession session,
                              boolean useUids )
            throws ProtocolException, MailboxException
    {
        // Parse the search term from the request
        SearchTerm searchTerm = parser.searchTerm( request );
        parser.endLine( request );

        ImapMailbox mailbox = session.getSelected();
        long[] uids = session.getHost().search( searchTerm, mailbox );
        StringBuffer idList = new StringBuffer();
View Full Code Here

                request.consume();
                next = request.nextChar();
            }

            // Return a search term that matches everything.
            return new SearchTerm()
            {
                public boolean match( Message message )
                {
                    return true;
                }
View Full Code Here

    public MessageIterator(Folder folder, int batchSize) {
      try {
        this.folder = folder;
        this.batchSize = batchSize;
        SearchTerm st = getSearchTerm();
        if (st != null) {
          doBatching = false;
          messagesInCurBatch = folder.search(st);
          totalInFolder = messagesInCurBatch.length;
          folder.fetch(messagesInCurBatch, fp);
View Full Code Here

    private SearchTerm getSearchTerm() {
      if (filters.size() == 0)
        return null;
      if (filters.size() == 1)
        return filters.get(0).getCustomSearch(folder);
      SearchTerm last = filters.get(0).getCustomSearch(folder);
      for (int i = 1; i < filters.size(); i++) {
        CustomFilter filter = filters.get(i);
        SearchTerm st = filter.getCustomSearch(folder);
        if (st != null) {
          last = new AndTerm(last, st);
        }
      }
      return last;
View Full Code Here

    public MessageIterator(Folder folder, int batchSize) {
      try {
        this.folder = folder;
        this.batchSize = batchSize;
        SearchTerm st = getSearchTerm();
        if (st != null) {
          doBatching = false;
          messagesInCurBatch = folder.search(st);
          totalInFolder = messagesInCurBatch.length;
          folder.fetch(messagesInCurBatch, fp);
View Full Code Here

TOP

Related Classes of javax.mail.search.SearchTerm

Copyright © 2018 www.massapicom. 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.