|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.javamail.util.MailConnection org.apache.geronimo.javamail.transport.nntp.NNTPConnection
public class NNTPConnection
Simple implementation of NNTP transport. Just does plain RFC977-ish delivery.
Field Summary | |
---|---|
protected boolean |
authInfoSaslAllowed
|
protected boolean |
authInfoUserAllowed
|
protected static char |
CR
constants for EOL termination |
protected static int |
DEFAULT_NNTP_PORT
property keys for protocol properties. |
protected NNTPReply |
lastServerResponse
|
protected static char |
LF
|
protected boolean |
postingAllowed
|
protected BufferedReader |
reader
|
protected String |
welcomeString
|
protected PrintWriter |
writer
|
Constructor Summary | |
---|---|
NNTPConnection(ProtocolProperties props)
Normal constructor for an NNTPConnection() object. |
Method Summary | |
---|---|
void |
close()
Close the connection. |
String |
extensionParameter(String name)
Retrieve any argument information associated with a extension reported back by the server on the EHLO command. |
protected void |
getConnection()
Create a transport connection object and connect it to the target server. |
protected void |
getExtensions()
Ask the server what extensions it supports. |
String |
getLastServerResponse()
Retrieve the last response received from the NNTP server. |
NNTPReply |
getReply()
Get a reply line for an NNTP command. |
protected ClientAuthenticator |
getSaslAuthenticator()
Attempt to retrieve a SASL authenticator for this protocol. |
void |
getWelcome()
Get the servers welcome blob from the wire.... |
String |
getWelcomeString()
Retrieve the welcome string sent back from the server. |
boolean |
isPostingAllowed()
Indicate whether posting is allowed for a given server. |
protected void |
processAuthentication(int request)
Authenticate with the server, if necessary (or possible). |
protected void |
processAuthinfoSimple()
Process an AUTHINFO SIMPLE command. |
protected void |
processAuthinfoUser()
Process an AUTHINFO USER command. |
protected void |
processExtension(String extension)
Process an extension string passed back as the LIST EXTENSIONS response. |
protected boolean |
processLogin(ClientAuthenticator authenticator)
Process a login using the provided authenticator object. |
protected boolean |
processSaslAuthentication()
Process SASL-type authentication. |
boolean |
protocolConnect(String host,
int port,
String username,
String password)
Connect to the server and do the initial handshaking. |
String |
receiveLine()
Receives one line from the server. |
NNTPReply |
selectGroup(String name)
Tell the server to switch to a named group. |
NNTPReply |
sendAuthCommand(String data)
Send a command to the server, returning the first response line back as a reply. |
NNTPReply |
sendCommand(String data)
Send a command to the server, returning the first response line back as a reply. |
NNTPReply |
sendCommand(String command,
int success)
Issue a command and retrieve the response. |
void |
sendLine(String data)
Sends a message down the socket and terminates with the appropriate CRLF |
void |
sendPost(Message msg)
Sends the data in the message down the socket. |
void |
sendQuit()
Sends the QUIT message and receieves the response |
boolean |
supportsExtension(String name)
Tests whether the target server supports a named extension. |
String |
toString()
|
Methods inherited from class org.apache.geronimo.javamail.util.MailConnection |
---|
checkConnected, closeServerConnection, connect, debugOut, debugOut, getCapabilities, getConnectedSocket, getConnectedSSLSocket, getConnectedTLSSocket, getConnectionProperties, getConnectionStreams, getHost, getLocalHost, getLoginAuthenticator, getSaslMechanisms, getSASLRealm, getServerMechanisms, hasCapability, selectSaslMechanisms, setLocalHost, setSASLRealm, supportsMechanism |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final char CR
protected static final char LF
protected static final int DEFAULT_NNTP_PORT
protected boolean postingAllowed
protected boolean authInfoUserAllowed
protected boolean authInfoSaslAllowed
protected NNTPReply lastServerResponse
protected String welcomeString
protected BufferedReader reader
protected PrintWriter writer
Constructor Detail |
---|
public NNTPConnection(ProtocolProperties props)
props
- The property bundle for this protocol instance.Method Detail |
---|
public boolean protocolConnect(String host, int port, String username, String password) throws MessagingException
protocolConnect
in class MailConnection
host
- The target host name.port
- The target portusername
- The connection username (can be null)password
- The authentication password (can be null).
MessagingException
protected void getConnection() throws MessagingException
getConnection
in class MailConnection
MessagingException
public void close() throws MessagingException
MessagingException
public String toString()
toString
in class Object
public void getWelcome() throws MessagingException
MessagingException
public void sendQuit() throws MessagingException
MessagingException
public NNTPReply selectGroup(String name) throws MessagingException
name
- The name of the target group.
MessagingException
protected void getExtensions() throws MessagingException
MessagingException
protected void processExtension(String extension)
extension
- The string value of the extension (which will be of the form
"NAME arguments").public String extensionParameter(String name)
name
- The name of the target server extension.
public boolean supportsExtension(String name)
name
- The target extension name.
public void sendPost(Message msg) throws MessagingException
MessagingException
public NNTPReply sendCommand(String command, int success) throws MessagingException
command
- The command to issue.success
- The command reply that indicates additional data should be
retrieved.
MessagingException
public NNTPReply sendCommand(String data) throws MessagingException
data
- The data to send.
MessagingException
public NNTPReply sendAuthCommand(String data) throws MessagingException
data
- The data to send.
MessagingException
public void sendLine(String data) throws MessagingException
MessagingException
public NNTPReply getReply() throws MessagingException
MessagingException
public String getLastServerResponse()
public String receiveLine() throws MessagingException
MessagingException
protected void processAuthentication(int request) throws MessagingException
MessagingException
protected void processAuthinfoSimple() throws MessagingException
MessagingException
protected boolean processSaslAuthentication() throws MessagingException
MessagingException
protected ClientAuthenticator getSaslAuthenticator()
protected boolean processLogin(ClientAuthenticator authenticator) throws MessagingException
MessagingException
protected void processAuthinfoUser() throws MessagingException
MessagingException
public boolean isPostingAllowed()
public String getWelcomeString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |