All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.james.imap.message.response.MailboxStatusResponse Maven / Gradle / Ivy

There is a newer version: 3.8.1
Show newest version
/****************************************************************
 * Licensed to the Apache Software Foundation (ASF) under one   *
 * or more contributor license agreements.  See the NOTICE file *
 * distributed with this work for additional information        *
 * regarding copyright ownership.  The ASF licenses this file   *
 * to you under the Apache License, Version 2.0 (the            *
 * "License"); you may not use this file except in compliance   *
 * with the License.  You may obtain a copy of the License at   *
 *                                                              *
 *   http://www.apache.org/licenses/LICENSE-2.0                 *
 *                                                              *
 * Unless required by applicable law or agreed to in writing,   *
 * software distributed under the License is distributed on an  *
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
 * KIND, either express or implied.  See the License for the    *
 * specific language governing permissions and limitations      *
 * under the License.                                           *
 ****************************************************************/

package org.apache.james.imap.message.response;

import org.apache.james.imap.api.message.response.ImapResponseMessage;

/**
 * Represents a STATUS response. See RFC3501 7.2.4.
 */
public class MailboxStatusResponse implements ImapResponseMessage {

    private final Long messages;

    private final Long recent;

    private final Long uidNext;

    private final Long uidValidity;

    private final Long unseen;

    private final String mailbox;

    private final Long highestModSeq;

    public MailboxStatusResponse(final Long messages, final Long recent, final Long uidNext, final Long highestModSeq, final Long uidValidity, final Long unseen, final String mailbox) {
        super();
        this.messages = messages;
        this.recent = recent;
        this.uidNext = uidNext;
        this.uidValidity = uidValidity;
        this.unseen = unseen;
        this.mailbox = mailbox;
        this.highestModSeq = highestModSeq;
    }
    

    /**
     * Gets the MESSAGES count for the mailbox.
     * 
     * @return the message count for the mailbox (if requested) or null (if not)
     */
    public final Long getMessages() {
        return messages;
    }

    /**
     * Gets the RECENT count for the mailbox.
     * 
     * @return the recent count (if requested) or null (if not)
     */
    public final Long getRecent() {
        return recent;
    }

    /**
     * Gets the mailbox UIDNEXT.
     * 
     * @return the mailbox uidNext (if requested) or null (if not)
     */
    public final Long getUidNext() {
        return uidNext;
    }

    /**
     * Gets the mailbox UIDVALIDITY.
     * 
     * @return the mailbox uidValidity (if requested) or null (if not)
     */
    public final Long getUidValidity() {
        return uidValidity;
    }

    /**
     * Gets the UNSEEN count for the mailbox.
     * 
     * @return the unseen count (if requested) or null (if not)
     */
    public final Long getUnseen() {
        return unseen;
    }

    /**
     * Gets the mailbox name.
     * 
     * @return the mailbox name, not null
     */
    public final String getMailbox() {
        return mailbox;
    }
    
    /**
     * Gets the mailbox HIGHESTMODSEQ.
     * 
     * @return the mailbox highestModSeq (if requested) or null (if not)
     */
    public final Long getHighestModSeq() {
        return highestModSeq;
    }

    public String toString() {
        return "Status response[mailbox='" + mailbox + "' messages=" + messages + " recent=" + recent + " uidnext=" + uidNext + " uidvalidity=" + uidValidity + " unseen=" + unseen + "]";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy