01: /****************************************************************
02: * Licensed to the Apache Software Foundation (ASF) under one *
03: * or more contributor license agreements. See the NOTICE file *
04: * distributed with this work for additional information *
05: * regarding copyright ownership. The ASF licenses this file *
06: * to you under the Apache License, Version 2.0 (the *
07: * "License"); you may not use this file except in compliance *
08: * with the License. You may obtain a copy of the License at *
09: * *
10: * http://www.apache.org/licenses/LICENSE-2.0 *
11: * *
12: * Unless required by applicable law or agreed to in writing, *
13: * software distributed under the License is distributed on an *
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15: * KIND, either express or implied. See the License for the *
16: * specific language governing permissions and limitations *
17: * under the License. *
18: ****************************************************************/package org.apache.james.nntpserver.repository;
19:
20: import java.io.OutputStream;
21:
22: /**
23: * Contract exposed by a NewsGroup Article
24: */
25: public interface NNTPArticle {
26:
27: /**
28: * Gets the group containing this article.
29: *
30: * @return the group
31: */
32: NNTPGroup getGroup();
33:
34: /**
35: * Gets the article number for this article.
36: *
37: * @return the article number
38: */
39: int getArticleNumber();
40:
41: /**
42: * Gets the unique message id for this article.
43: *
44: * @return the message id
45: */
46: String getUniqueID();
47:
48: /**
49: * Writes the whole article to a writer.
50: *
51: * @param wrt the OutputStream to which the article is written.
52: */
53: void writeArticle(OutputStream wrt);
54:
55: /**
56: * Writes the article headers to a writer.
57: *
58: * @param wrt the OutputStream to which the article is written.
59: */
60: void writeHead(OutputStream wrt);
61:
62: /**
63: * Writes the article body to a writer.
64: *
65: * @param wrt the OutputStream to which the article is written.
66: */
67: void writeBody(OutputStream wrt);
68:
69: /**
70: * Writes the article overview to a writer.
71: *
72: * @param wrt the OutputStream to which the article is written.
73: */
74: void writeOverview(OutputStream wrt);
75:
76: /**
77: * Gets the header with the specified headerName. Returns null
78: * if the header doesn't exist.
79: *
80: * @param headerName the name of the header being retrieved.
81: */
82: String getHeader(String headerName);
83: }
|