KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > imapserver > ImapRequestImpl


1 /***********************************************************************
2  * Copyright (c) 2000-2004 The Apache Software Foundation. *
3  * All rights reserved. *
4  * ------------------------------------------------------------------- *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you *
6  * may not use this file except in compliance with the License. You *
7  * may obtain a copy of the License at: *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
14  * implied. See the License for the specific language governing *
15  * permissions and limitations under the License. *
16  ***********************************************************************/

17
18 package org.apache.james.imapserver;
19
20 import java.util.StringTokenizer JavaDoc;
21
22 /**
23  * An single client request to an IMAP server, with necessary details for
24  * command processing
25  *
26  * @version 0.2 on 04 Aug 2002
27  */

28 public class ImapRequestImpl implements ImapRequest
29 {
30
31     private String JavaDoc _command;
32     private StringTokenizer JavaDoc commandLine;
33     private boolean useUIDs;
34     private ACLMailbox currentMailbox;
35     private String JavaDoc commandRaw;
36     private String JavaDoc tag;
37     private SingleThreadedConnectionHandler caller;
38     private String JavaDoc currentFolder;
39
40     public ImapRequestImpl(SingleThreadedConnectionHandler handler,
41                            String JavaDoc command ) {
42         caller = handler;
43         _command = command;
44     }
45     
46     public String JavaDoc getCommand()
47     {
48         return _command;
49     }
50     
51     public void setCommand( String JavaDoc command )
52     {
53         _command = command;
54     }
55
56     public SingleThreadedConnectionHandler getCaller() {
57         return caller;
58     }
59
60     public void setCommandLine(StringTokenizer JavaDoc st) {
61         commandLine = st;
62     }
63
64     public StringTokenizer JavaDoc getCommandLine() {
65         //return new java.util.StringTokenizer(this.getCommandRaw());
66
return commandLine;
67     }
68
69     public int arguments()
70     {
71         return commandLine.countTokens();
72     }
73
74     public void setUseUIDs(boolean state) {
75         useUIDs = state;
76     }
77
78     public boolean useUIDs() {
79         return useUIDs;
80     }
81
82     public void setCurrentMailbox(ACLMailbox mbox) {
83         currentMailbox = mbox;
84     }
85
86     public ACLMailbox getCurrentMailbox() {
87         return currentMailbox;
88     }
89
90     public void setCommandRaw(String JavaDoc raw) {
91         commandRaw = raw;
92     }
93
94     public String JavaDoc getCommandRaw() {
95         return commandRaw;
96     }
97
98     public void setTag(String JavaDoc t) {
99         tag = t;
100     }
101
102     public String JavaDoc getTag() {
103         return tag;
104     }
105
106     public void setCurrentFolder(String JavaDoc f) {
107         currentFolder = f;
108     }
109
110     public String JavaDoc getCurrentFolder() {
111         return currentFolder;
112     }
113 }
114
Popular Tags