01: package com.sun.xml.ws.encoding;
02:
03: import com.sun.istack.NotNull;
04: import com.sun.xml.ws.api.message.AttachmentSet;
05: import com.sun.xml.ws.api.message.Message;
06: import com.sun.xml.ws.api.message.Packet;
07: import com.sun.xml.ws.api.pipe.Codec;
08:
09: import java.io.IOException;
10: import java.io.InputStream;
11: import java.nio.channels.ReadableByteChannel;
12:
13: /**
14: * {@link Codec} that works only on the root part of the MIME/multipart.
15: * It doesn't work on the attachment parts, so it takes {@link AttachmentSet}
16: * as an argument and creates a corresponding {@link Message}. This enables
17: * attachments to be parsed lazily by wrapping the mimepull parser into an
18: * {@link AttachmentSet}
19: *
20: * @author Jitendra Kotamraju
21: */
22: public interface RootOnlyCodec extends Codec {
23:
24: /**
25: * Reads root part bytes from {@link InputStream} and constructs a {@link Message}
26: * along with the given attachments.
27: *
28: * @param in root part's data
29: *
30: * @param contentType root part's MIME content type (like "application/xml")
31: *
32: * @param packet the new created {@link Message} is set in this packet
33: *
34: * @param att attachments
35: *
36: * @throws IOException
37: * if {@link InputStream} throws an exception.
38: */
39: void decode(@NotNull
40: InputStream in, @NotNull
41: String contentType, @NotNull
42: Packet packet, @NotNull
43: AttachmentSet att) throws IOException;
44:
45: /**
46: *
47: * @see #decode(InputStream, String, Packet, AttachmentSet)
48: */
49: void decode(@NotNull
50: ReadableByteChannel in, @NotNull
51: String contentType, @NotNull
52: Packet packet, @NotNull
53: AttachmentSet att);
54: }
|