001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    package org.apache.geronimo.javamail.store.imap.connection;
019    import java.util.ArrayList;
020    import java.util.List;
021    
022    import javax.mail.MessagingException;
023    
024    /**
025     * Util class to represent an untagged response from a IMAP server
026     *
027     * @version $Rev: 594520 $ $Date: 2007-11-13 07:57:39 -0500 (Tue, 13 Nov 2007) $
028     */
029    public class IMAPOkResponse extends IMAPUntaggedResponse {
030        // the response status value 
031        protected List status; 
032        // any message following the response 
033        protected String message; 
034    
035        /**
036         * Create a reply object from a server response line (normally, untagged).  This includes
037         * doing the parsing of the response line.
038         *
039         * @param response The response line used to create the reply object.
040         */
041        public IMAPOkResponse(String keyword, List status, String message, byte [] response) {
042            super(keyword, response); 
043            this.status = status; 
044            this.message = message; 
045        }
046        
047        /**
048         * Get the response code included with the OK 
049         * response. 
050         * 
051         * @return The string name of the response code.
052         */
053        public String getResponseCode() {
054            return getKeyword(); 
055        }
056    
057        /**
058         * Return the status argument values associated with
059         * this status response.
060         * 
061         * @return The status value information, as a list of tokens.
062         */
063        public List getStatus() {
064            return status; 
065        }
066        
067        /**
068         * Get any trailing message associated with this 
069         * status response. 
070         * 
071         * @return 
072         */
073        public String getMessage() {
074            return message; 
075        }
076    }
077    
078