|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.mail.Service
public abstract class Service
| Field Summary | |
|---|---|
protected boolean |
debug
Debug flag for this service, set from the Session's debug flag. |
protected Session |
session
The session from which this service was created. |
protected URLName |
url
The URLName of this service |
| Constructor Summary | |
|---|---|
protected |
Service(Session session,
URLName url)
Construct a new Service. |
| Method Summary | |
|---|---|
void |
addConnectionListener(ConnectionListener listener)
|
void |
close()
Close this service and terminate its physical connection. |
void |
connect()
A generic connect method that takes no parameters allowing subclasses to implement an appropriate authentication scheme. |
void |
connect(String host,
int port,
String user,
String password)
Connect to the specified host at the specified port using a simple username/password authenticaion scheme. |
void |
connect(String user,
String password)
Connect to the specified host using a simple username/password authenticaion scheme and the default host and port. |
void |
connect(String host,
String user,
String password)
Connect to the specified host using a simple username/password authenticaion scheme and the default port. |
protected void |
finalize()
|
URLName |
getURLName()
Return a copy of the URLName representing this service with the password and file information removed. |
boolean |
isConnected()
Check if this service is currently connected. |
protected void |
notifyConnectionListeners(int type)
|
protected boolean |
protocolConnect(String host,
int port,
String user,
String password)
Attempt the protocol-specific connection; subclasses should override this to establish a connection in the appropriate manner. |
protected void |
queueEvent(MailEvent event,
Vector listeners)
|
void |
removeConnectionListener(ConnectionListener listener)
|
protected void |
setConnected(boolean connected)
Notification to subclasses that the connection state has changed. |
protected void |
setURLName(URLName url)
Set the url field. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Session session
protected URLName url
protected boolean debug
| Constructor Detail |
|---|
protected Service(Session session,
URLName url)
session - the session from which this service was createdurl - the URLName of this service| Method Detail |
|---|
public void connect()
throws MessagingException
connect(null, null, null)
AuthenticationFailedException - if authentication fails
MessagingException - for other failures
public void connect(String host,
String user,
String password)
throws MessagingException
connect(host, -1, user, password)
host - the host to connect touser - the user namepassword - the user's password
AuthenticationFailedException - if authentication fails
MessagingException - for other failures
public void connect(String user,
String password)
throws MessagingException
connect(host, -1, user, password)
user - the user namepassword - the user's password
AuthenticationFailedException - if authentication fails
MessagingException - for other failures
public void connect(String host,
int port,
String user,
String password)
throws MessagingException
host - the host to connect toport - the port to connect to; pass -1 to use the default for the protocoluser - the user namepassword - the user's password
AuthenticationFailedException - if authentication fails
MessagingException - for other failures
IllegalStateException - if this service is already connected
protected boolean protocolConnect(String host,
int port,
String user,
String password)
throws MessagingException
connect(String, int, String, String) method to
reattempt the connection after trying to obtain user and password information from the user.
Alternatively it may throw a AuthenticatedFailedException to abandon the conection attempt.
host - port - user - password -
AuthenticationFailedException - if authentication fails
MessagingException - for other failurespublic boolean isConnected()
protected void setConnected(boolean connected)
connected - the connection state
public void close()
throws MessagingException
MessagingException - if there were errors closing; the connection is still closedpublic URLName getURLName()
protected void setURLName(URLName url)
url - the new valuepublic void addConnectionListener(ConnectionListener listener)
public void removeConnectionListener(ConnectionListener listener)
protected void notifyConnectionListeners(int type)
public String toString()
toString in class Object
protected void queueEvent(MailEvent event,
Vector listeners)
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||