com.nttdocomo.io
インタフェース HttpConnection

すべてのスーパーインタフェース:
javax.microedition.io.Connection, javax.microedition.io.ContentConnection, javax.microedition.io.InputConnection, javax.microedition.io.OutputConnection, javax.microedition.io.StreamConnection

public interface HttpConnection
extends javax.microedition.io.ContentConnection

HTTP プロトコルでのネットワークへの接続を定義する。


フィールドの概要
static java.lang.String GET
          HTTP リクエストメソッドの"GET"を表す文字列。
static java.lang.String HEAD
          HTTP リクエストメソッドの"HEAD"を表す文字列。
static int HTTP_ACCEDPTED
          HTTPレスポンスのgenerally OK系のステータスコード(=202)。
static int HTTP_BAD_GATEWAY
          HTTPレスポンスのserver error系のステータスコード(=502)。
static int HTTP_BAD_METHOD
          HTTPレスポンスのclient error系のステータスコード(=405)。
static int HTTP_BAD_REQUEST
          HTTPレスポンスのclient error系のステータスコード(=400)。
static int HTTP_CLIENT_TIMEOUT
          HTTPレスポンスのclient error系のステータスコード(=408)。
static int HTTP_CONFLICT
          HTTPレスポンスのclient error系のステータスコード(=409)。
static int HTTP_CREATED
          HTTPレスポンスのgenerally OK系のステータスコード(=201)。
static int HTTP_ENTITY_TOO_LARGE
          HTTPレスポンスのclient error系のステータスコード(=413)。
static int HTTP_FORBIDDEN
          HTTPレスポンスのclient error系のステータスコード(=403)。
static int HTTP_GATEWAY_TIMEOUT
          HTTPレスポンスのserver error系のステータスコード(=504)。
static int HTTP_GONE
          HTTPレスポンスのclient error系のステータスコード(=410)。
static int HTTP_INTERNAL_ERROR
          HTTPレスポンスのserver error系のステータスコード(=501)。
static int HTTP_LENGTH_REQUIRED
          HTTPレスポンスのclient error系のステータスコード(=411)。
static int HTTP_MOVED_PERM
          HTTPレスポンスのrelocation/redirect系のステータスコード(=301)。
static int HTTP_MOVED_TEMP
          HTTPレスポンスのrelocation/redirect系のステータスコード(=302)。
static int HTTP_MULT_CHOICE
          HTTPレスポンスのrelocation/redirect系のステータスコード(=300)。
static int HTTP_NO_CONTENT
          HTTPレスポンスのgenerally OK系のステータスコード(=204)。
static int HTTP_NOT_ACCEPTABLE
          HTTPレスポンスのclient error系のステータスコード(=406)。
static int HTTP_NOT_AUTHORITATIVE
          HTTPレスポンスのgenerally OK系のステータスコード(=203)。
static int HTTP_NOT_FOUND
          HTTPレスポンスのclient error系のステータスコード(=404)。
static int HTTP_NOT_MODIFIED
          HTTPレスポンスのrelocation/redirect系のステータスコード(=304)。
static int HTTP_OK
          HTTPレスポンスのgenerally OK系のステータスコード(=200)。
static int HTTP_PARTIAL
          HTTPレスポンスのgenerally OK系のステータスコード(=206)。
static int HTTP_PAYMENT_REQUIRED
          HTTPレスポンスのclient error系のステータスコード(=402)。
static int HTTP_PRECON_FAILED
          HTTPレスポンスのclient error系のステータスコード(=412)。
static int HTTP_PROXY_AUTH
          HTTPレスポンスのclient error系のステータスコード(=407)。
static int HTTP_REQ_TOO_LONG
          HTTPレスポンスのclient error系のステータスコード(=414)。
static int HTTP_RESET
          HTTPレスポンスのgenerally OK系のステータスコード(=205)。
static int HTTP_SEE_OTHER
          HTTPレスポンスのrelocation/redirect系のステータスコード(=303)。
static int HTTP_SERVER_ERROR
          HTTPレスポンスのserver error系のステータスコード(=500)。
static int HTTP_UNAUTHORIZED
          HTTPレスポンスのclient error系のステータスコード(=401)。
static int HTTP_UNAVAILABLE
          HTTPレスポンスのserver error系のステータスコード(=503)。
static int HTTP_UNSUPPORTED_TYPE
          HTTPレスポンスのclient error系のステータスコード(=415)。
static int HTTP_USE_PROXY
          HTTPレスポンスのrelocation/redirect系のステータスコード(=305)。
static int HTTP_VERSION
          HTTPレスポンスのserver error系のステータスコード(=505)。
static java.lang.String POST
          HTTP リクエストメソッドの"POST"を表す文字列。
 
メソッドの概要
 void close()
          接続を閉じて、リソースを開放する。
 void connect()
          HTTP で接続し、メッセージを送受信する。
 long getDate()
          メッセージの日付を取得する。
 java.lang.String getEncoding()
          コンテントのエンコードの形式の識別文字列を取得する。
 long getExpiration()
          メッセージの有効期限を取得する。
 java.lang.String getHeaderField(java.lang.String name)
          ヘッダ情報を取得する。
 long getLastModified()
          メッセージの更新時刻を取得する。
 long getLength()
          コンテンツの長さを返す。
 int getResponseCode()
          レスポンスコードを取得する。
 java.lang.String getResponseMessage()
          レスポンスメッセージを取得する。
 java.lang.String getType()
          コンテントのタイプの識別文字列を取得する。
 java.lang.String getURL()
          接続先のURL を取得する。
 java.io.InputStream openInputStream()
          入力ストリームを取得する。
 java.io.OutputStream openOutputStream()
          出力ストリームを取得する。
 void setIfModifiedSince(long ifmodifiedsince)
          “if-Modified-sice”ヘッダの値を設定する。
 void setRequestMethod(java.lang.String method)
          リクエストメソッドを設定する。
 void setRequestProperty(java.lang.String key, java.lang.String value)
          ヘッダのプロパティ値を設定する。
 
インタフェース javax.microedition.io.InputConnection から継承したメソッド
openDataInputStream
 
インタフェース javax.microedition.io.OutputConnection から継承したメソッド
openDataOutputStream
 

フィールドの詳細

HEAD

public static final java.lang.String HEAD
HTTP リクエストメソッドの"HEAD"を表す文字列。

GET

public static final java.lang.String GET
HTTP リクエストメソッドの"GET"を表す文字列。

POST

public static final java.lang.String POST
HTTP リクエストメソッドの"POST"を表す文字列。

HTTP_OK

public static final int HTTP_OK
HTTPレスポンスのgenerally OK系のステータスコード(=200)。

HTTP_CREATED

public static final int HTTP_CREATED
HTTPレスポンスのgenerally OK系のステータスコード(=201)。

HTTP_ACCEDPTED

public static final int HTTP_ACCEDPTED
HTTPレスポンスのgenerally OK系のステータスコード(=202)。

HTTP_NOT_AUTHORITATIVE

public static final int HTTP_NOT_AUTHORITATIVE
HTTPレスポンスのgenerally OK系のステータスコード(=203)。

HTTP_NO_CONTENT

public static final int HTTP_NO_CONTENT
HTTPレスポンスのgenerally OK系のステータスコード(=204)。

HTTP_RESET

public static final int HTTP_RESET
HTTPレスポンスのgenerally OK系のステータスコード(=205)。

HTTP_PARTIAL

public static final int HTTP_PARTIAL
HTTPレスポンスのgenerally OK系のステータスコード(=206)。

HTTP_MULT_CHOICE

public static final int HTTP_MULT_CHOICE
HTTPレスポンスのrelocation/redirect系のステータスコード(=300)。

HTTP_MOVED_PERM

public static final int HTTP_MOVED_PERM
HTTPレスポンスのrelocation/redirect系のステータスコード(=301)。

HTTP_MOVED_TEMP

public static final int HTTP_MOVED_TEMP
HTTPレスポンスのrelocation/redirect系のステータスコード(=302)。

HTTP_SEE_OTHER

public static final int HTTP_SEE_OTHER
HTTPレスポンスのrelocation/redirect系のステータスコード(=303)。

HTTP_NOT_MODIFIED

public static final int HTTP_NOT_MODIFIED
HTTPレスポンスのrelocation/redirect系のステータスコード(=304)。

HTTP_USE_PROXY

public static final int HTTP_USE_PROXY
HTTPレスポンスのrelocation/redirect系のステータスコード(=305)。

HTTP_BAD_REQUEST

public static final int HTTP_BAD_REQUEST
HTTPレスポンスのclient error系のステータスコード(=400)。

HTTP_UNAUTHORIZED

public static final int HTTP_UNAUTHORIZED
HTTPレスポンスのclient error系のステータスコード(=401)。

HTTP_PAYMENT_REQUIRED

public static final int HTTP_PAYMENT_REQUIRED
HTTPレスポンスのclient error系のステータスコード(=402)。

HTTP_FORBIDDEN

public static final int HTTP_FORBIDDEN
HTTPレスポンスのclient error系のステータスコード(=403)。

HTTP_NOT_FOUND

public static final int HTTP_NOT_FOUND
HTTPレスポンスのclient error系のステータスコード(=404)。

HTTP_BAD_METHOD

public static final int HTTP_BAD_METHOD
HTTPレスポンスのclient error系のステータスコード(=405)。

HTTP_NOT_ACCEPTABLE

public static final int HTTP_NOT_ACCEPTABLE
HTTPレスポンスのclient error系のステータスコード(=406)。

HTTP_PROXY_AUTH

public static final int HTTP_PROXY_AUTH
HTTPレスポンスのclient error系のステータスコード(=407)。

HTTP_CLIENT_TIMEOUT

public static final int HTTP_CLIENT_TIMEOUT
HTTPレスポンスのclient error系のステータスコード(=408)。

HTTP_CONFLICT

public static final int HTTP_CONFLICT
HTTPレスポンスのclient error系のステータスコード(=409)。

HTTP_GONE

public static final int HTTP_GONE
HTTPレスポンスのclient error系のステータスコード(=410)。

HTTP_LENGTH_REQUIRED

public static final int HTTP_LENGTH_REQUIRED
HTTPレスポンスのclient error系のステータスコード(=411)。

HTTP_PRECON_FAILED

public static final int HTTP_PRECON_FAILED
HTTPレスポンスのclient error系のステータスコード(=412)。

HTTP_ENTITY_TOO_LARGE

public static final int HTTP_ENTITY_TOO_LARGE
HTTPレスポンスのclient error系のステータスコード(=413)。

HTTP_REQ_TOO_LONG

public static final int HTTP_REQ_TOO_LONG
HTTPレスポンスのclient error系のステータスコード(=414)。

HTTP_UNSUPPORTED_TYPE

public static final int HTTP_UNSUPPORTED_TYPE
HTTPレスポンスのclient error系のステータスコード(=415)。

HTTP_SERVER_ERROR

public static final int HTTP_SERVER_ERROR
HTTPレスポンスのserver error系のステータスコード(=500)。

HTTP_INTERNAL_ERROR

public static final int HTTP_INTERNAL_ERROR
HTTPレスポンスのserver error系のステータスコード(=501)。

HTTP_BAD_GATEWAY

public static final int HTTP_BAD_GATEWAY
HTTPレスポンスのserver error系のステータスコード(=502)。

HTTP_UNAVAILABLE

public static final int HTTP_UNAVAILABLE
HTTPレスポンスのserver error系のステータスコード(=503)。

HTTP_GATEWAY_TIMEOUT

public static final int HTTP_GATEWAY_TIMEOUT
HTTPレスポンスのserver error系のステータスコード(=504)。

HTTP_VERSION

public static final int HTTP_VERSION
HTTPレスポンスのserver error系のステータスコード(=505)。
メソッドの詳細

connect

public void connect()
             throws java.io.IOException
HTTP で接続し、メッセージを送受信する。
例外:
java.io.IOException - エラーが発生した場合

close

public void close()
           throws java.io.IOException
接続を閉じて、リソースを開放する。
定義:
インタフェース javax.microedition.io.Connection 内の close
例外:
java.io.IOException - エラーが発生した場合

openInputStream

public java.io.InputStream openInputStream()
                                    throws java.io.IOException
入力ストリームを取得する。
定義:
インタフェース javax.microedition.io.InputConnection 内の openInputStream
戻り値:
inputStream InputStream オブジェクトのインスタンスへの参照
例外:
java.io.IOException - エラーが発生した場合

openOutputStream

public java.io.OutputStream openOutputStream()
                                      throws java.io.IOException
出力ストリームを取得する。
定義:
インタフェース javax.microedition.io.OutputConnection 内の openOutputStream
戻り値:
OutputStream OutputStream オブジェクトのインスタンスへの参照
例外:
java.io.IOException - エラーが発生した場合

getEncoding

public java.lang.String getEncoding()
コンテントのエンコードの形式の識別文字列を取得する。
定義:
インタフェース javax.microedition.io.ContentConnection 内の getEncoding
戻り値:
コンテントのエンコードの形式を表す文字列

getLength

public long getLength()
コンテンツの長さを返す。
定義:
インタフェース javax.microedition.io.ContentConnection 内の getLength
戻り値:
コンテンツの長さを表す整数値。

getType

public java.lang.String getType()
コンテントのタイプの識別文字列を取得する。
定義:
インタフェース javax.microedition.io.ContentConnection 内の getType
戻り値:
コンテントのタイプの識別文字列を表す文字列

getURL

public java.lang.String getURL()
接続先のURL を取得する。
戻り値:
URL を表す文字列。

setRequestMethod

public void setRequestMethod(java.lang.String method)
                      throws java.io.IOException,
                             java.lang.IllegalArgumentException
リクエストメソッドを設定する。
パラメータ:
method - メソッドを表す文字列
例外:
java.io.IOException - エラーが発生した場合
java.lang.IllegalArgumentException - 許可されていないメソッドが指定された場合

setRequestProperty

public void setRequestProperty(java.lang.String key,
                               java.lang.String value)
                        throws java.io.IOException
ヘッダのプロパティ値を設定する。
パラメータ:
key - プロパティを指定する文字列
value - 設定値
例外:
java.io.IOException - エラーが発生した場合

getResponseCode

public int getResponseCode()
                    throws java.io.IOException
レスポンスコードを取得する。
戻り値:
HTTP レスポンスのステータスラインのステータスコードを示す整数値
例外:
java.io.IOException - エラーが発生した場合

getResponseMessage

public java.lang.String getResponseMessage()
                                    throws java.io.IOException
レスポンスメッセージを取得する。
戻り値:
HTTP レスポンスメッセージを格納した文字列。
例外:
java.io.IOException - エラーが発生した場合

getHeaderField

public java.lang.String getHeaderField(java.lang.String name)
ヘッダ情報を取得する。
パラメータ:
name - ヘッダのキー値を表す文字列
戻り値:
ヘッダの値を表す文字列

getDate

public long getDate()
メッセージの日付を取得する。
戻り値:
日付を表す整数値

getExpiration

public long getExpiration()
メッセージの有効期限を取得する。
戻り値:
日付を表す整数値

getLastModified

public long getLastModified()
メッセージの更新時刻を取得する。
戻り値:
日付を表す整数値

setIfModifiedSince

public void setIfModifiedSince(long ifmodifiedsince)
“if-Modified-sice”ヘッダの値を設定する。
パラメータ:
ifmodifiedsince - 日付を表す整数値


本製品または文書は著作権法により保護されており、その使用、複製、再頒布および逆コンパイルを制限するライセンスのもとにおいて頒布されます。NTTドコモ(その他に許諾者がある場合は当該許諾者も含めて)の書面による事前の許可なく、本製品および関連する文書のいかなる部分も、いかなる方法によっても複製することが禁じられます。フォントを含む第三者のソフトウェアは、著作権法により保護されており、その提供者からライセンスを受けているものです。

Sun、Sun Microsystems、Java、J2MEおよびJ2SEは、米国およびその他の国における米国 Sun Microsystems,Inc.の商標または登録商標です。サンのロゴマークは、米国 Sun Microsystems, Inc.の登録商標です。

「i-mode/アイモード」はNTTドコモの登録商標、「iアプリ/iαppli/アイアプリ」はNTTドコモの商標です。