com.sun.mail.pop3
类 POP3Store

java.lang.Object
  继承者 javax.mail.Service
      继承者 javax.mail.Store
          继承者 com.sun.mail.pop3.POP3Store
直接已知子类:
POP3SSLStore

public class POP3Store
extends Store

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.

作者:
Bill Shannon, John Mani

字段摘要
 
从类 javax.mail.Service 继承的字段
debug, session, url
 
构造方法摘要
POP3Store(Session session, URLName url)
           
POP3Store(Session session, URLName url, String name, int defaultPort, boolean isSSL)
           
 
方法摘要
 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(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(String host, int portNum, String user, String passwd)
          The service implementation should override this method to perform the actual protocol-specific connection attempt.
 
从类 javax.mail.Store 继承的方法
addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
 
从类 javax.mail.Service 继承的方法
addConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
 
从类 java.lang.Object 继承的方法
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

POP3Store

public POP3Store(Session session,
                 URLName url)

POP3Store

public POP3Store(Session session,
                 URLName url,
                 String name,
                 int defaultPort,
                 boolean isSSL)
方法详细信息

protocolConnect

protected boolean protocolConnect(String host,
                                  int portNum,
                                  String user,
                                  String passwd)
                           throws MessagingException
从类 Service 复制的描述
The service implementation should override this method to perform the actual protocol-specific connection attempt. The default implementation of the 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.

覆盖:
Service 中的 protocolConnect
参数:
host - the name of the host to connect to
portNum - the port to use (-1 means use default port)
user - the name of the user to login as
passwd - the user's password
返回:
true if connection successful, false if authentication failed
抛出:
AuthenticationFailedException - for authentication failures
MessagingException - for non-authentication failures

isConnected

public boolean isConnected()
Check whether this store is connected. Override superclass method, to actually ping our server connection.

覆盖:
Service 中的 isConnected
返回:
true if the service is connected, false if it is not connected

close

public void close()
           throws MessagingException
从类 Service 复制的描述
Close this service and terminate its connection. A close ConnectionEvent is delivered to any ConnectionListeners. Any Messaging components (Folders, Messages, etc.) belonging to this service are invalid after this service is closed. Note that the service is closed even if this method terminates abnormally by throwing a MessagingException.

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.

覆盖:
Service 中的 close
抛出:
MessagingException - for errors while closing
另请参见:
ConnectionEvent

getDefaultFolder

public Folder getDefaultFolder()
                        throws MessagingException
从类 Store 复制的描述
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.

指定者:
Store 中的 getDefaultFolder
返回:
the root Folder
抛出:
MessagingException

getFolder

public Folder getFolder(String name)
                 throws MessagingException
Only the name "INBOX" is supported.

指定者:
Store 中的 getFolder
参数:
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.
返回:
Folder object
抛出:
MessagingException
另请参见:
Folder.exists(), Folder.create(int)

getFolder

public Folder getFolder(URLName url)
                 throws MessagingException
从类 Store 复制的描述
Return a closed Folder object, corresponding to the given URLName. The store specified in the given URLName should refer to this Store object.

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.

指定者:
Store 中的 getFolder
参数:
url - URLName that denotes a folder
返回:
Folder object
抛出:
MessagingException
另请参见:
URLName

finalize

protected void finalize()
                 throws Throwable
从类 Service 复制的描述
Stop the event dispatcher thread so the queue can be garbage collected.

覆盖:
Service 中的 finalize
抛出:
Throwable


Copyright © 2013. All Rights Reserved.