You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2007/07/25 22:46:16 UTC
svn commit: r559599 - in
/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response:
./ imap4rev1/ imap4rev1/messagedata/
Author: rdonkin
Date: Wed Jul 25 13:46:14 2007
New Revision: 559599
URL: http://svn.apache.org/viewvc?view=rev&rev=559599
Log:
First cut at a model of the fetch response based on the specification. Extensive use of the visitor pattern: perhaps too much, I think. Time will tell. Changes very likely.
Added:
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/AddressVisitor.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Addresses.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Flags.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Literal.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/LiteralSink.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Body.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtension.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtensionVisitor.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldExtension.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldParam.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFields.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyVisitor.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Envelope.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/FetchMessageData.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageAttributeVisitor.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageData.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageDataVisitor.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MultipartBodyFieldExtension.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Section.java
james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/SectionVisitor.java
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/AddressVisitor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/AddressVisitor.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/AddressVisitor.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/AddressVisitor.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,39 @@
+/****************************************************************
+ * 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.api.imap.message.response;
+
+public interface AddressVisitor {
+ /**
+ * <p>
+ * An RFC2060 <code>address</code>.
+ * </p>
+ * @param addressName <code>addr_name</code> phrase from RFC822 <code>mailbox</code,
+ * or null if the header is not present in the message
+ * @param addressAdl <code>addr_adl</code> phrase from RFC822 <code>route-addr</code>,
+ * or null if the header is not present in the message
+ * @param addressMailbox null to indicate the end of the RFC822 group.
+ * When not null: if <code>addressHost</> is null, this holds
+ * the RFC822 group name otherwise, the RFC822 <code>local-part</code>
+ * @param addressHost null indicates RFC822 group syntax.
+ * Not null holds RFC822 domain name
+ */
+ public void address(CharSequence addressName, CharSequence addressAdl,
+ CharSequence addressMailbox, CharSequence addressHost);
+}
\ No newline at end of file
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Addresses.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Addresses.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Addresses.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Addresses.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,24 @@
+/****************************************************************
+ * 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.api.imap.message.response;
+
+public interface Addresses {
+ public void accept(AddressVisitor visitor);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Flags.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Flags.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Flags.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Flags.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,76 @@
+/****************************************************************
+ * 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.api.imap.message.response;
+
+/**
+ * RFC2060 flags for a message.
+ * Defined in 2.3.2.
+ */
+public interface Flags {
+
+ /**
+ * RFC2060 <code>Seen</code> flag.
+ * @return true if the <code>Seen</code> flag is set,
+ * false otherwise
+ */
+ public boolean seen();
+
+ /**
+ * RFC2060 <code>Answered</code> flag.
+ * @return true if the <code>Answered</code> flag is set,
+ * false otherwise
+ */
+ public boolean answered();
+
+ /**
+ * RFC2060 <code>Flagged</code> flag.
+ * @return true if the <code>Flagged</code> flag is set,
+ * false otherwise
+ */
+ public boolean flagged();
+
+ /**
+ * RFC2060 <code>Deleted</code> flag.
+ * @return true if the <code>Deleted</code> flag is set,
+ * false otherwise
+ */
+ public boolean deleted();
+
+ /**
+ * RFC2060 <code>Draft</code> flag.
+ * @return true if the <code>Draft</code> flag is set,
+ * false otherwise
+ */
+ public boolean draft();
+
+ /**
+ * RFC2060 <code>Recent</code> flag.
+ * @return true if the <code>Recent</code> flag is set,
+ * false otherwise
+ */
+ public boolean recent();
+
+ /**
+ * RFC2060 flag_keywords.
+ * @return <code>CharSequence</code>,
+ * or null if there are no keywords set
+ */
+ public CharSequence[] keywords();
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Literal.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Literal.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Literal.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/Literal.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,53 @@
+/****************************************************************
+ * 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.api.imap.message.response;
+
+import java.io.IOException;
+
+/**
+ * <p>
+ * <strong>Note</strong> that implementations
+ * may not support multiple calls to {@link #writeAll(LiteralSink)}.
+ * See {@link #isConsumed()}.
+ * </p>
+ */
+public interface Literal {
+
+ /**
+ * Is this literal consumed?
+ *
+ * @return true if this literal can be written out again,
+ * false otherwise
+ */
+ public boolean isConsumed();
+
+ /**
+ * Gets the total number of bytes contained in this literal.
+ * @return byte count
+ */
+ public int getByteCount() throws IOException;
+
+ /**
+ * Writes all the contents of this literal into the given sink.
+ *
+ * @param <code>LiteralSink</code>, not null
+ */
+ public void writeAll(LiteralSink sink) throws IOException;
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/LiteralSink.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/LiteralSink.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/LiteralSink.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/LiteralSink.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,29 @@
+/****************************************************************
+ * 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.api.imap.message.response;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+public interface LiteralSink {
+
+ public void write(ByteBuffer buffer) throws IOException;
+ public void write(ByteBuffer[] buffer) throws IOException;
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Body.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Body.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Body.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Body.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,24 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface Body {
+ public void accept(BodyVisitor visitor);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtension.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtension.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtension.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtension.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,24 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface BodyExtension {
+ public void accept(BodyExtensionVisitor visitor);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtensionVisitor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtensionVisitor.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtensionVisitor.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyExtensionVisitor.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,26 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface BodyExtensionVisitor {
+ public void visitBodyExtension(int number);
+ public void visitBodyExtension(CharSequence text);
+ public void visitBodyExtension(BodyExtension extension);
+}
\ No newline at end of file
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldExtension.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldExtension.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldExtension.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldExtension.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,53 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface BodyFieldExtension {
+
+ /**
+ * The RFC 1864 MD5 value of the body.
+ * @return md5 sum, otherwise null
+ */
+ public CharSequence getMd5();
+
+ /**
+ * Disposition type part of RFC2060 body_fld_dsp.
+ * @return disposition type, otherwise null
+ */
+ public CharSequence getDispostion();
+
+ /**
+ * Gets disposition attribute/value pairs.
+ * @return disposition parameters, otherwise null
+ */
+ public BodyFieldParam[] getDispositionParams();
+
+ /**
+ * RFC 1766 language tags.
+ * @return one or more langauge tags, otherwise null
+ */
+ public CharSequence[] getLanguage();
+
+ /**
+ *
+ * @return <code>BodyExtension</code>, otherwise null
+ */
+ public BodyExtension getBodyExtension();
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldParam.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldParam.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldParam.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFieldParam.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,38 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+/**
+ * RFC2060 <code>body_flg_param</code>.
+ *
+ */
+public interface BodyFieldParam {
+ /**
+ * RFC2060 body_fld_param attribute name.
+ * @return <code>CharSequence</code>, not null
+ */
+ CharSequence getAttribute();
+
+ /**
+ * RFC2060 body_fld_param value.
+ * @return <code>CharSequence</code>, not null
+ */
+ CharSequence getValue();
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFields.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFields.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFields.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyFields.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,68 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface BodyFields {
+
+ public static final class Encoding {
+ public static final Encoding ENC_7BIT = new Encoding("7BIT");
+ public static final Encoding ENC_8BIT = new Encoding("8BIT");
+ public static final Encoding ENC_BINARY = new Encoding("BINARY");
+ public static final Encoding ENC_BASE64 = new Encoding("BASE64");
+ public static final Encoding ENC_QUOTED_PRINTABLE = new Encoding("QUOTED_PRINTABLE");
+
+ private final CharSequence encoding;
+ public Encoding(final CharSequence encoding) {
+ this.encoding = encoding;
+ }
+ public final CharSequence getEncoding() {
+ return encoding;
+ }
+
+ public int hashCode() {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((encoding == null) ? 0 : encoding.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final Encoding other = (Encoding) obj;
+ if (encoding == null) {
+ if (other.encoding != null)
+ return false;
+ } else if (!encoding.equals(other.encoding))
+ return false;
+ return true;
+ }
+ }
+
+ public BodyFieldParam[] getContentTypeParameters();
+ public CharSequence getContentId();
+ public CharSequence getContentDescription();
+ public Encoding getContentEncoding();
+ public long getBodySize();
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyVisitor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyVisitor.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyVisitor.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/BodyVisitor.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,75 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface BodyVisitor {
+
+ /**
+ * RFC2060 body_type_basic for MIME type <code>AUDIO</code>.
+ * @param mediaSubType RFC2045 MIME media sub type
+ * @param bodyFields <code>BodyFields</code>, not null
+ */
+ public void basicMessageAudio(CharSequence mediaSubType, BodyFields bodyFields, BodyFieldExtension extension);
+
+ /**
+ * RFC2060 body_type_basic for MIME type <code>MESSAGE</code>.
+ * @param mediaSubType RFC2045 MIME media sub type, not <code>RFC822<code>
+ * @param bodyFields <code>BodyFields</code>, not null
+ */
+ public void basicMessageBody(CharSequence mediaSubType, BodyFields bodyFields, BodyFieldExtension extension);
+
+ /**
+ * RFC2060 body_type_basic for MIME type <code>VIDEO</code>.
+ * @param mediaSubType RFC2045 MIME media sub type
+ * @param bodyFields <code>BodyFields</code>, not null
+ */
+ public void basicVideoBody(CharSequence mediaSubType, BodyFields bodyFields, BodyFieldExtension extension);
+
+ /**
+ * RFC2060 body_type_basic for MIME type <code>IMAGE</code>.
+ * @param mediaSubType RFC2045 MIME media sub type
+ * @param bodyFields <code>BodyFields</code>, not null
+ */
+ public void basicImageBody(CharSequence mediaSubType, BodyFields bodyFields, BodyFieldExtension extension);
+
+ /**
+ * RFC2060 body_type_basic for MIME type <code>APPLICATION</code>.
+ * @param mediaSubType RFC2045 MIME media sub type
+ * @param bodyFields <code>BodyFields</code>, not null
+ */
+ public void basicApplicationBody(CharSequence mediaSubType, BodyFields bodyFields, BodyFieldExtension extension);
+
+ /**
+ * RFC2060 body_type_basic for extension MIME media types.
+ * @param mediaType extension MIME media type, not <code>APPLICATION</code>,
+ * <code>IMAGE</code>, <code>VIDEO</code>, <code>AUDIO</code>, <code>MESSAGE</code>
+ * @param mediaSubType RFC2045 MIME media sub type
+ * @param bodyFields <code>BodyFields</code>, not null
+ */
+ public void basicOtherBody(CharSequence mediaType, CharSequence mediaSubType, BodyFields bodyFields, BodyFieldExtension extension);
+
+ public void textBody(CharSequence mediaSubType, BodyFields bodyFields, int bodyFieldLines, BodyFieldExtension extension);
+
+ public void startMessageBody(BodyFields bodyFields, Envelope envelope);
+ public void endMessageBody(int bodyFieldLines, BodyFieldExtension extension);
+
+ public void startMultipartBody();
+ public void endMultipartBody(CharSequence mediaSubType, MultipartBodyFieldExtension extension);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Envelope.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Envelope.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Envelope.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Envelope.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,115 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+import org.apache.james.api.imap.message.response.Addresses;
+
+/**
+ * <p>Envelope structure defined by RFC2060.</p>
+ *
+ */
+public interface Envelope {
+
+ /**
+ * Gets the date header in RFC882 format.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>date</code>
+ * header
+ */
+ public CharSequence getDate();
+
+ /**
+ * Gets the <code>subject</code> header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>subject</code>
+ * header
+ */
+ public CharSequence getSubject();
+
+ /**
+ * Gets the addresses comprising the <code>from</code>
+ * header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>from</code>
+ * header
+ */
+ public Addresses getFrom();
+
+ /**
+ * Gets the addresses comprising the <code>sender</code>
+ * header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>sender</code>
+ * header
+ */
+ public Addresses getSender();
+
+ /**
+ * Gets the addresses comprising the <code>reply-to</code>
+ * header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>reply-to</code>
+ * header
+ */
+ public Addresses getReplyTo();
+
+ /**
+ * Gets the addresses comprising the <code>to</code>
+ * header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>to</code>
+ * header
+ */
+ public Addresses getTo();
+
+ /**
+ * Gets the addresses comprising the <code>cc</code>
+ * header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>cc</code>
+ * header
+ */
+ public Addresses getCc();
+
+ /**
+ * Gets the addresses comprising the <code>bcc</code>
+ * header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>bcc</code>
+ * header
+ */
+ public Addresses getBcc();
+
+ /**
+ * Gets the <code>in-reply-to</code> header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>in-reply-to</code>
+ * header
+ */
+ public CharSequence getInReplyTo();
+
+ /**
+ * Gets the <code>message-id</code> header value.
+ * @return <code>CharSequence</code>,
+ * or null if this message does not have a <code>message-id</code>
+ * header
+ */
+ public CharSequence getMessageId();
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/FetchMessageData.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/FetchMessageData.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/FetchMessageData.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/FetchMessageData.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,27 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+/**
+ * <p><code>RFC6060</code> <code>FETCH</code> message data type.</p>
+ */
+public interface FetchMessageData {
+ public void accept(MessageAttributeVisitor visitor);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageAttributeVisitor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageAttributeVisitor.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageAttributeVisitor.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageAttributeVisitor.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,129 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+import java.util.Date;
+
+import org.apache.james.api.imap.message.response.Flags;
+import org.apache.james.api.imap.message.response.Literal;
+
+/**
+ * Visits RFC2060 msg_att.
+ *
+ */
+public interface MessageAttributeVisitor {
+ /**
+ * RFC2060 envelope data.
+ * @param envelope, <code>Envelope</code> describing
+ * the message, not null
+ */
+ public void visitEnvelope(Envelope envelope);
+
+ /**
+ * RFC2060 flag data.
+ * @param flags <code>Flags</code>, not null
+ */
+ public void visitFlags(Flags flags);
+
+ /**
+ * RFC2060 internal date message attribute.
+ * This is the internal server date and time stamp.
+ * Defined by section 2.3.3.
+ * @param date <code>Date</code>, not null
+ */
+ public void visitInternalDate(Date date);
+
+ /**
+ * RFC2060 complete RFC822 message data.
+ * @param message <code>Literal</code> message data,
+ * not null
+ */
+ public void visitRfc822(Literal message);
+
+ /**
+ * RFC2060 header data.
+ * @param message <code>Literal</code> header data,
+ * not null
+ */
+ public void visitRfc822Header(Literal headers);
+
+ /**
+ * RFC2060 message text data.
+ * @param message <code>Literal</code> message text,
+ * not null
+ */
+ public void visitRfc822Text(Literal text);
+
+ /**
+ * RFC2060 message size.
+ * @param messageSize the size of the message as defined in
+ * RFC822
+ */
+ public void visitRfc822Size(long messageSize);
+
+ /**
+ * RFC body section message data for complete message.
+ * @param sectionContents <code>Literal</code> contents,
+ * not null
+ */
+ public void visitBodySection(Literal sectionContents);
+
+ /**
+ * RFC body section message data a part of the complete message.
+ * @param originOctet the data starts at the this byte count
+ * @param sectionContents <code>Literal</code> contents,
+ * not null
+ */
+ public void visitBodySection(long originOctet, Literal sectionContents);
+
+
+ /**
+ * RFC body section message data for given section.
+ * @param section <code>Section</code>, not null
+ * @param sectionContents <code>Literal</code> contents,
+ * not null
+ */
+ public void visitBodySection(Section section, Literal sectionContents);
+
+ /**
+ * RFC body section message data for given section
+ * with given origin octet.
+ * @param section <code>Section</code>, not null
+ * @param originOctet the data starts at the this byte count
+ * @param sectionContents <code>Literal</code> contents,
+ * not null
+ */
+ public void visitBodySection(Section section, long originOctet, Literal sectionContents);
+
+ /**
+ * The unique indentifier for the message.
+ * @param uid unique identifier for the message. This is
+ * an unsigned 32 bit integer represented as a signed 32 bit
+ * integer
+ */
+ public void visitUid(int uid);
+
+ /**
+ * RFC2060 <code>body</code>.
+ * @param body <code>Body</code>, not null
+ * @param structure true if the body contains structure data
+ */
+ public void visitBody(Body body, boolean structure);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageData.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageData.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageData.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageData.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+/**
+ * <p>RFC2060 <code>message_data</code></p>
+ *
+ */
+public interface MessageData {
+ /**
+ * Gets the message sequence number for the data passed.
+ * @return message sequence number, see RFC2060
+ */
+ public abstract int getMessageSequenceNumber();
+
+ public void accept(MessageDataVisitor visitor);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageDataVisitor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageDataVisitor.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageDataVisitor.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MessageDataVisitor.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,25 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface MessageDataVisitor {
+ public void expunge();
+ public void fetch(FetchMessageData fetchMessage);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MultipartBodyFieldExtension.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MultipartBodyFieldExtension.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MultipartBodyFieldExtension.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/MultipartBodyFieldExtension.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,28 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface MultipartBodyFieldExtension extends BodyFieldExtension {
+ /**
+ * Gets body parameter attribute/value pairs.
+ * @return body parameters, otherwise null
+ */
+ public BodyFieldParam[] getBodyParameters();
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Section.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Section.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Section.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/Section.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,29 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+public interface Section {
+
+ /**
+ * Traverses the section.
+ * @param visitor <code>SectionVisitor</code>, not null
+ */
+ public void accept(SectionVisitor visitor);
+}
Added: james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/SectionVisitor.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/SectionVisitor.java?view=auto&rev=559599
==============================================================================
--- james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/SectionVisitor.java (added)
+++ james/server/trunk/imap-api/src/main/java/org/apache/james/api/imap/message/response/imap4rev1/messagedata/SectionVisitor.java Wed Jul 25 13:46:14 2007
@@ -0,0 +1,59 @@
+/****************************************************************
+ * 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.api.imap.message.response.imap4rev1.messagedata;
+
+/**
+ * Visits elements of an RFC2060 <code>section</code>.
+ */
+public interface SectionVisitor {
+
+ /**
+ * Section number.
+ * @param number section number
+ */
+ public void sectionNumber(int number);
+
+ /**
+ * Header section text.
+ */
+ public void header();
+
+ /**
+ * Header fields section contents.
+ * @param names names of the header fields
+ */
+ public void headerFields(CharSequence[] names);
+
+ /**
+ * Not header fields section contents.
+ * @param names names of the header fields
+ */
+ public void notHeaderFields(CharSequence[] names);
+
+ /**
+ * Text section contents.
+ */
+ public void text();
+
+ /**
+ * MIME section contents.
+ */
+ public void mime();
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org