All Packages This Package Class Hierarchy Class Search Index
Class grendel.storage.NNTPConnection
java.lang.Object | +----grendel.storage.NNTPConnection
class NNTPConnection extends java.lang.Object { // Fields 15 static final boolean DEBUG; public static final int DEFAULT_NNTP_PORT; protected boolean hasListSubscrExtension; protected boolean hasOverExtension; protected boolean hasSetGetExtension; protected boolean hasXpatTextExtension; String host; LineBufferingInputStream input; OutputStream output; String pass; protected NNTPDotTerminatedInputStream pending_dot_stream; int port; String selected_group; Socket socket; String user; // Constructors 1 NNTPConnection(); // Methods 29 synchronized InputStream ARTICLE(String) throws IOException; synchronized InputStream ARTICLE(String, long) throws IOException; synchronized InputStream BODY(String) throws IOException; synchronized InputStream BODY(String, long) throws IOException; synchronized String GET(String) throws IOException; synchronized int[] GROUP(String) throws IOException; synchronized NewsMessage HEAD(NewsFolder, String) throws IOException; synchronized NewsMessage HEAD(NewsFolder, long) throws IOException; protected synchronized String[] LIST_EXTENSIONS() throws IOException; synchronized void LIST_SEARCHES(); synchronized void LIST_SRCHFIELDS(); synchronized String[] LIST_SUBSCRIPTIONS() throws IOException; protected synchronized void MODE_READER() throws IOException; synchronized InputStream NEWGROUPS(Date) throws IOException; synchronized InputStream OVER(String, long, long) throws IOException; protected void checkString(String) throws NNTPException; synchronized void close(); synchronized boolean connect(String, int, String, String) throws UnknownHostException, IOException; synchronized void dotStreamFinished(NNTPDotTerminatedInputStream); protected void flushDotStream(); Enumeration getMessages(NewsFolder, long, long) throws IOException; protected synchronized NNTPDotTerminatedInputStream newDotStream(); NewsMessage parseOverviewLine(NewsFolder, byte[], int, int); private synchronized InternetHeaders readHeaders(String) throws IOException; protected synchronized String readLine() throws IOException; protected synchronized void readLine(ByteBuf) throws IOException; protected synchronized int readResponse(ByteBuf) throws IOException; protected synchronized void write(byte[], int, int) throws IOException; protected synchronized void write(String) throws IOException; }
Fields
DEBUG
static final boolean DEBUG
socket
Socket socket
input
LineBufferingInputStream input
output
OutputStream output
selected_group
String selected_group
host
String host
port
int port
user
String user
pass
String pass
pending_dot_stream
protected NNTPDotTerminatedInputStream pending_dot_stream
DEFAULT_NNTP_PORT
public static final int DEFAULT_NNTP_PORT
hasSetGetExtension
protected boolean hasSetGetExtension
hasOverExtension
protected boolean hasOverExtension
hasXpatTextExtension
protected boolean hasXpatTextExtension
hasListSubscrExtension
protected boolean hasListSubscrExtension
Constructors
NNTPConnection
NNTPConnection()
Methods
connect
synchronized boolean connect(String host, int port, String user, String password) throws UnknownHostException, IOException
close
synchronized void close()
write
protected synchronized void write(byte[] b, int start, int length) throws IOException
write
protected synchronized void write(String buf) throws IOException
readLine
protected synchronized void readLine(ByteBuf into_buf) throws IOException
readLine
protected synchronized String readLine() throws IOException
flushDotStream
protected void flushDotStream()
newDotStream
protected synchronized NNTPDotTerminatedInputStream newDotStream()
checkString
protected void checkString(String s) throws NNTPException
readResponse
protected synchronized int readResponse(ByteBuf into_buf) throws IOException
MODE_READER
protected synchronized void MODE_READER() throws IOException
LIST_EXTENSIONS
protected synchronized String[] LIST_EXTENSIONS() throws IOException
Returns an array of Strings, the names of extensions supported by this server. If no extensions are supported, returns null.
LIST_SEARCHES
synchronized void LIST_SEARCHES()
LIST_SRCHFIELDS
synchronized void LIST_SRCHFIELDS()
GET
synchronized String GET(String prop) throws IOException
LIST_SUBSCRIPTIONS
synchronized String[] LIST_SUBSCRIPTIONS() throws IOException
Returns an array of strings, the names of newsgroups to which new users of this server should be subscribed by default.
GROUP
synchronized int[] GROUP(String group_name) throws IOException
Returns array of int: [ nmessages low hi ]
readHeaders
private synchronized InternetHeaders readHeaders(String terminator) throws IOException
HEAD
synchronized NewsMessage HEAD(NewsFolder folder, String id) throws IOException
HEAD
synchronized NewsMessage HEAD(NewsFolder folder, long article) throws IOException
BODY
synchronized InputStream BODY(String id) throws IOException
Returns a stream of the message's body. This takes care of the dot termination for you. You must drain this stream before issuing another NNTP command.
BODY
synchronized InputStream BODY(String group, long article) throws IOException
ARTICLE
synchronized InputStream ARTICLE(String id) throws IOException
Returns a stream of the full message, including headers and body. This takes care of the dot termination for you. You must drain this stream before issuing another NNTP command.
ARTICLE
synchronized InputStream ARTICLE(String group, long article) throws IOException
NEWGROUPS
synchronized InputStream NEWGROUPS(Date since) throws IOException
Returns a stream listing the new newsgroups added since the given date. If the date is null, lists all of them. The stream lists the group names one per line, in no particular order.
OVER
synchronized InputStream OVER(String group, long from, long to) throws IOException
Sends the OVER or XOVER command, as appropriate, and returns a stream of the overview data. If neither OVER nor XOVER is supported, throws an NNTPException.
dotStreamFinished
synchronized void dotStreamFinished(NNTPDotTerminatedInputStream stream)
parseOverviewLine
NewsMessage parseOverviewLine(NewsFolder folder, byte[] line, int start, int length)
getMessages
Enumeration getMessages(NewsFolder folder, long from, long to) throws IOException
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4