com.sun.mail.imap
クラス IMAPStore

java.lang.Object
  上位を拡張 javax.mail.Service
      上位を拡張 javax.mail.Store
          上位を拡張 com.sun.mail.imap.IMAPStore
すべての実装されたインタフェース:
com.sun.mail.iap.ResponseHandler
直系の既知のサブクラス:
IMAPSSLStore

public class IMAPStore
extends Store
implements com.sun.mail.iap.ResponseHandler

このクラスは IMAP メッセージストアへのアクセスを提供します。

Applications that need to make use of IMAP-specific features may cast a Store object to an IMAPStore object and use the methods on this class. The getQuota and setQuota methods support the IMAP QUOTA extension. Refer to RFC 2087 for more information.

See the com.sun.mail.imap package documentation for further information on the IMAP protocol provider.

WARNING: The APIs unique to this class should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.


フィールドの概要
 
クラス javax.mail.Service から継承されたフィールド
session, url
 
コンストラクタの概要
IMAPStore(Session session, URLName url)
          Constructor that takes a Session object and a URLName that represents a specific IMAP server.
IMAPStore(Session session, URLName url, String name, int defaultPort, boolean isSSL)
          Constructor used by this class and by IMAPSSLStore subclass.
 
メソッドの概要
 void close()
          この Store を閉じます。
protected  void finalize()
          キューがガベージコレクト可能になるように、イベントディスパッチャスレッドを停止します。
 Folder getDefaultFolder()
          Get the default folder, representing the root of this user's namespace.
 Folder getFolder(String name)
          Get named folder.
 Folder getFolder(URLName url)
          Get named folder.
 Folder[] getPersonalNamespaces()
          Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Personal namespaces.
 Quota[] getQuota(String root)
          Get the quotas for the named quota root.
 Folder[] getSharedNamespaces()
          Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Shared namespaces.
 Folder[] getUserNamespaces(String user)
          Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the User's namespaces.
 void handleResponse(com.sun.mail.iap.Response r)
          レスポンスハンドラメソッドです。
 boolean hasCapability(String capability)
          指定された CAPABILITY 文字列がサーバーがアナウンスした CAPABILITY のリストの場合、true を返します。
 boolean isConnected()
          Check whether this store is connected.
protected  boolean protocolConnect(String host, int pport, String user, String password)
          protocolConnect() の実装です。
 void setPassword(String password)
          この Store が最初に接続された(例えば Folderを開く為に接続を作成する時)後にその後の接続に使用されるパスワードを設定します。
 void setQuota(Quota quota)
          Set the quotas for the quota root specified in the quota argument.
 void setUsername(String user)
          この Store が最初に接続された(例えば Folder を開く為に接続を作成する時)後にその後の接続に使用されるユーザ名を設定します。
 
クラス javax.mail.Store から継承されたメソッド
addFolderListener, addStoreListener, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
 
クラス javax.mail.Service から継承されたメソッド
addConnectionListener, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
 
クラス java.lang.Object から継承されたメソッド
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

IMAPStore

public IMAPStore(Session session,
                 URLName url)
Constructor that takes a Session object and a URLName that represents a specific IMAP server.


IMAPStore

public IMAPStore(Session session,
                 URLName url,
                 String name,
                 int defaultPort,
                 boolean isSSL)
Constructor used by this class and by IMAPSSLStore subclass.

メソッドの詳細

protocolConnect

protected boolean protocolConnect(String host,
                                  int pport,
                                  String user,
                                  String password)
                           throws MessagingException
protocolConnect() の実装です。

オーバーライド:
クラス Service 内の protocolConnect
パラメータ:
host - 接続先のホスト名
pport - 使用するポート (-1 はデフォルトポートの使用を意味する)
user - ログインするユーザ名
password - ユーザのパスワード
戻り値:
接続が成功した場合は true、認証が失敗した場合は false
例外:
AuthenticationFailedException - 認証の障害の場合
MessagingException - 認証以外の障害の場合

setUsername

public void setUsername(String user)
この Store が最初に接続された(例えば Folder を開く為に接続を作成する時)後にその後の接続に使用されるユーザ名を設定します。 この値は Store の connect メソッドへのどの様な呼出しでもオーバーライドします。

幾つかの IMAP サーバは今後の接続の為に、より効率的な認証に使用する事ができるIDを認証に提供する可能性があります。 ここで説明されなかったサーバ特有の方法でこの認証IDを提供します。

殆どのアプリケーションは、このメソッドを使用する必要はありません。

導入されたバージョン:
JavaMail 1.3.3

setPassword

public void setPassword(String password)
この Store が最初に接続された(例えば Folderを開く為に接続を作成する時)後にその後の接続に使用されるパスワードを設定します。 この値は Store の connect メソッドへのどの様な呼出しでもオーバーライドします。 殆どのアプリケーションは、このメソッドを使用する必要はありません。

導入されたバージョン:
JavaMail 1.3.3

hasCapability

public boolean hasCapability(String capability)
                      throws MessagingException
指定された CAPABILITY 文字列がサーバーがアナウンスした CAPABILITY のリストの場合、true を返します。

例外:
MessagingException
導入されたバージョン:
JavaMail 1.3.3

isConnected

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

オーバーライド:
クラス Service 内の isConnected
戻り値:
サービスが接続されている場合は true、接続されていない場合は false

close

public final void close()
                 throws MessagingException
この Store を閉じます。

オーバーライド:
クラス Service 内の close
例外:
MessagingException - クローズ中のエラーの場合
関連項目:
ConnectionEvent

finalize

protected final void finalize()
                       throws Throwable
クラス Service の記述:
キューがガベージコレクト可能になるように、イベントディスパッチャスレッドを停止します。

オーバーライド:
クラス Service 内の finalize
例外:
Throwable

getDefaultFolder

public final Folder getDefaultFolder()
                              throws MessagingException
Get the default folder, representing the root of this user's namespace. Returns a closed DefaultFolder object.

定義:
クラス Store 内の getDefaultFolder
戻り値:
ルート Folder
例外:
MessagingException

getFolder

public final Folder getFolder(String name)
                       throws MessagingException
Get named folder. Returns a new, closed IMAPFolder.

定義:
クラス Store 内の getFolder
パラメータ:
name - Folder の名前。 一部の Store において、名前が階層区切り文字で始まる場合、絶対パスとなることがあります。 そうでない場合は、名前はこの名前空間の 'ルート' への相対名と解釈されます。
戻り値:
Folder オブジェクト
例外:
MessagingException
関連項目:
Folder.exists(), Folder.create(int)

getFolder

public final Folder getFolder(URLName url)
                       throws MessagingException
Get named folder. Returns a new, closed IMAPFolder.

定義:
クラス Store 内の getFolder
パラメータ:
url - フォルダを示す URLName
戻り値:
Folder オブジェクト
例外:
MessagingException
関連項目:
URLName

getPersonalNamespaces

public final Folder[] getPersonalNamespaces()
                                     throws MessagingException
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Personal namespaces.

オーバーライド:
クラス Store 内の getPersonalNamespaces
戻り値:
Folder オブジェクトの配列
例外:
MessagingException

getUserNamespaces

public final Folder[] getUserNamespaces(String user)
                                 throws MessagingException
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the User's namespaces.

オーバーライド:
クラス Store 内の getUserNamespaces
戻り値:
Folder オブジェクトの配列
例外:
MessagingException

getSharedNamespaces

public final Folder[] getSharedNamespaces()
                                   throws MessagingException
Using the IMAP NAMESPACE command (RFC 2342), return a set of folders representing the Shared namespaces.

オーバーライド:
クラス Store 内の getSharedNamespaces
戻り値:
Folder オブジェクトの配列
例外:
MessagingException

getQuota

public final Quota[] getQuota(String root)
                       throws MessagingException
Get the quotas for the named quota root. Quotas are controlled on the basis of a quota root, not (necessarily) a folder. The relationship between folders and quota roots depends on the IMAP server. Some servers might implement a single quota root for all folders owned by a user. Other servers might implement a separate quota root for each folder. A single folder can even have multiple quota roots, perhaps controlling quotas for different resources.

パラメータ:
root - クオータルートの名前
戻り値:
Quota オブジェクトの配列
例外:
MessagingException - サーバが QUOTA 拡張をサポートしない場合

setQuota

public void setQuota(Quota quota)
              throws MessagingException
Set the quotas for the quota root specified in the quota argument. Typically this will be one of the quota roots obtained from the getQuota method, but it need not be.

パラメータ:
quota - the quota to set
例外:
MessagingException - if the server doesn't support the QUOTA extension

handleResponse

public final void handleResponse(com.sun.mail.iap.Response r)
レスポンスハンドラメソッドです。

定義:
インタフェース com.sun.mail.iap.ResponseHandler 内の handleResponse