1 /*****************************************************************
2 * Licensed to the Apache Software Foundation (ASF) under one *
3 * or more contributor license agreements. See the NOTICE file *
4 * distributed with this work for additional information *
5 * regarding copyright ownership. The ASF licenses this file *
6 * to you under the Apache License, Version 2.0 (the *
7 * "License"); you may not use this file except in compliance *
8 * with the License. You may obtain a copy of the License at *
9 * *
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 ****************************************************************/
19
20 package org.apache.james.nntpserver.repository;
21
22 import java.io.OutputStream;
23
24 /***
25 * Contract exposed by a NewsGroup Article
26 */
27 public interface NNTPArticle {
28
29 /***
30 * Gets the group containing this article.
31 *
32 * @return the group
33 */
34 NNTPGroup getGroup();
35
36 /***
37 * Gets the article number for this article.
38 *
39 * @return the article number
40 */
41 int getArticleNumber();
42
43 /***
44 * Gets the unique message id for this article.
45 *
46 * @return the message id
47 */
48 String getUniqueID();
49
50 /***
51 * Writes the whole article to a writer.
52 *
53 * @param wrt the OutputStream to which the article is written.
54 */
55 void writeArticle(OutputStream wrt);
56
57 /***
58 * Writes the article headers to a writer.
59 *
60 * @param wrt the OutputStream to which the article is written.
61 */
62 void writeHead(OutputStream wrt);
63
64 /***
65 * Writes the article body to a writer.
66 *
67 * @param wrt the OutputStream to which the article is written.
68 */
69 void writeBody(OutputStream wrt);
70
71 /***
72 * Writes the article overview to a writer.
73 *
74 * @param wrt the OutputStream to which the article is written.
75 */
76 void writeOverview(OutputStream wrt);
77
78 /***
79 * Gets the header with the specified headerName. Returns null
80 * if the header doesn't exist.
81 *
82 * @param headerName the name of the header being retrieved.
83 */
84 String getHeader(String headerName);
85 }