|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.mail.Service | +--javax.mail.Store | +--com.sun.mail.pop3.POP3Store
A POP3 Message Store. Contains only one folder, "INBOX". See the com.sun.mail.pop3 package documentation for further information on the POP3 protocol provider.
Fields inherited from class javax.mail.Service |
debug, session, url |
Constructor Summary | |
POP3Store(Session session,
URLName url)
|
|
POP3Store(Session session,
URLName url,
java.lang.String name,
int defaultPort,
boolean isSSL)
|
Method Summary | |
void |
close()
Close this service and terminate its connection. |
protected void |
finalize()
Stop the event dispatcher thread so the queue can be garbage collected. |
Folder |
getDefaultFolder()
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store. |
Folder |
getFolder(java.lang.String name)
Only the name "INBOX" is supported. |
Folder |
getFolder(URLName url)
Return a closed Folder object, corresponding to the given URLName. |
boolean |
isConnected()
Check whether this store is connected. |
protected boolean |
protocolConnect(java.lang.String host,
int portNum,
java.lang.String user,
java.lang.String passwd)
The service implementation should override this method to perform the actual protocol-specific connection attempt. |
Methods inherited from class javax.mail.Store |
addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener |
Methods inherited from class javax.mail.Service |
addConnectionListener, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public POP3Store(Session session, URLName url)
public POP3Store(Session session, URLName url, java.lang.String name, int defaultPort, boolean isSSL)
Method Detail |
protected boolean protocolConnect(java.lang.String host, int portNum, java.lang.String user, java.lang.String passwd) throws MessagingException
Service
connect
method
calls this method as needed.
The protocolConnect
method should return
false
if a user name or password is required
for authentication but the corresponding parameter is null;
the connect
method will prompt the user when
needed to supply missing information. This method may
also return false
if authentication fails for
the supplied user name or password. Alternatively, this method
may throw an AuthenticationFailedException when authentication
fails. This exception may include a String message with more
detail about the failure.
The protocolConnect
method should throw an
exception to report failures not related to authentication,
such as an invalid host name or port number, loss of a
connection during the authentication process, unavailability
of the server, etc.
protocolConnect
in class Service
javax.mail.Service
host
- the name of the host to connect toport
- the port to use (-1 means use default port)user
- the name of the user to login aspassword
- the user's passwordAuthenticationFailedException
- for authentication failuresMessagingException
- for non-authentication failurespublic boolean isConnected()
isConnected
in class Service
javax.mail.Service
public void close() throws MessagingException
Service
This implementation uses setConnected(false)
to set
this service's connected state to false
. It will then
send a close ConnectionEvent to any registered ConnectionListeners.
Subclasses overriding this method to do implementation specific
cleanup should call this method as a last step to insure event
notification, probably by including a call to super.close()
in a finally
clause.
close
in class Service
javax.mail.Service
MessagingException
- for errors while closingConnectionEvent
public Folder getDefaultFolder() throws MessagingException
Store
getDefaultFolder
in class Store
javax.mail.Store
IllegalStateException
- if this Store is not connected.public Folder getFolder(java.lang.String name) throws MessagingException
getFolder
in class Store
javax.mail.Store
name
- The name of the Folder. In some Stores, name can
be an absolute path if it starts with the
hierarchy delimiter. Else it is interpreted
relative to the 'root' of this namespace.IllegalStateException
- if this Store is not connected.Folder.exists()
,
Folder.create(int)
public Folder getFolder(URLName url) throws MessagingException
Store
Implementations of this method may obtain the name of the
actual folder using the getFile()
method on
URLName, and use that name to create the folder.
getFolder
in class Store
javax.mail.Store
url
- URLName that denotes a folderIllegalStateException
- if this Store is not connected.URLName
protected void finalize() throws java.lang.Throwable
Service
finalize
in class Service
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |