Back to Vassonic

SonicSessionConnection (sdk 3.0.0 API)

sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConnection.html

3.1.115.0 KB
Original Source

跳过导航链接

com.tencent.sonic.sdk

类 SonicSessionConnection


public abstract classSonicSessionConnectionextends java.lang.Object

The abstract class SonicSessionConnection is the superclass of all classes that represent a communications link between the application and a URL. Instances of this class can be used both to read from and to write to the resource referenced by the URL

嵌套类概要

嵌套类 | 限定符和类型 | 类和说明 | | --- | --- | | static class | SonicSessionConnection.SessionConnectionDefaultImpl |

字段概要

字段 | 限定符和类型 | 字段和说明 | | --- | --- | | static java.lang.String | CUSTOM_HEAD_FILED_ACCEPT_DIFF HTTP header:accept-diff. | | static java.lang.String | CUSTOM_HEAD_FILED_CACHE_OFFLINE HTTP header:cache-offline. | | static java.lang.String | CUSTOM_HEAD_FILED_DNS_PREFETCH HTTP Header:dns-prefetch. | | static java.lang.String | CUSTOM_HEAD_FILED_ETAG HTTP header:eTag. | | static java.lang.String | CUSTOM_HEAD_FILED_HTML_SHA1 HTTP header: . | | static java.lang.String | CUSTOM_HEAD_FILED_LINK HTTP Response Header: Link. | | static java.lang.String | CUSTOM_HEAD_FILED_SDK_VERSION HTTP Header:sdk_version. | | static java.lang.String | CUSTOM_HEAD_FILED_TEMPLATE_CHANGE HTTP header:template_change. | | static java.lang.String | CUSTOM_HEAD_FILED_TEMPLATE_TAG HTTP header:template_tag. | | static java.lang.String | DNS_PREFETCH_ADDRESS HTTP header:dns-prefetch-address
This header represents the ip address of the server. | | static java.lang.String | HTTP_HEAD_CSP HTTP Header:Content-Security-Policy. | | static java.lang.String | HTTP_HEAD_CSP_REPORT_ONLY HTTP Header:Content-Security-Policy-Report-Only. | | static java.lang.String | HTTP_HEAD_FIELD_CACHE_CONTROL HTTP Header : Cache-Control. | | static java.lang.String | HTTP_HEAD_FIELD_CONTENT_LENGTH HTTP Header : Content-Length. | | static java.lang.String | HTTP_HEAD_FIELD_CONTENT_TYPE HTTP Header : Content-Type. | | static java.lang.String | HTTP_HEAD_FIELD_COOKIE HTTP Request Header : Cookie. | | static java.lang.String | HTTP_HEAD_FIELD_EXPIRES HTTP Header : Expires. | | static java.lang.String | HTTP_HEAD_FIELD_PRAGMA HTTP 1.0 Header : Pragma. | | static java.lang.String | HTTP_HEAD_FILED_IF_NOT_MATCH | | static java.lang.String | HTTP_HEAD_FILED_SET_COOKIE HTTP Header:Set-Cookie. | | static java.lang.String | HTTP_HEAD_FILED_USER_AGENT HTTP Request Header:User-Agent. | | protected android.content.Intent | intent This intent saves all of the initialization param. | | protected java.io.BufferedInputStream | responseStream The input stream that reads from this open connection. | | protected SonicSession | session SonicSession Object used by SonicSessionConnection. |

构造器概要

构造器 | 构造器和说明 | | --- | | SonicSessionConnection(SonicSession session, android.content.Intent intent) Constructor |

方法概要

所有方法 实例方法 抽象方法 具体方法 | 限定符和类型 | 方法和说明 | | --- | --- | | int | connect() Opens a communications link to the resource referenced by Sonic session | | abstract void | disconnect() Disconnect the communications link to the resource referenced by Sonic session | | abstract int | getResponseCode() | | abstract java.lang.String | getResponseHeaderField(java.lang.String key) | | abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> | getResponseHeaderFields() | | java.io.BufferedInputStream | getResponseStream() | | protected abstract int | internalConnect() | | protected abstract java.io.BufferedInputStream | internalGetResponseStream() |

- 

从类继承的方法 java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

字段详细资料

- 

CUSTOM_HEAD_FILED_ETAG

public static final java.lang.String CUSTOM_HEAD_FILED_ETAG

HTTP header:eTag.
This header represents SHA1 value of the whole website, including template and data. 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_ACCEPT_DIFF

public static final java.lang.String CUSTOM_HEAD_FILED_ACCEPT_DIFF

HTTP header:accept-diff.
This header represents that client accepts data incremental scene updates or not. 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_TEMPLATE_TAG

public static final java.lang.String CUSTOM_HEAD_FILED_TEMPLATE_TAG

HTTP header:template_tag.
This header represents SHA1 value of the template file. 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_TEMPLATE_CHANGE

public static final java.lang.String CUSTOM_HEAD_FILED_TEMPLATE_CHANGE

HTTP header:template_change.
This header indicates whether the template file has changed or not. 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_CACHE_OFFLINE

public static final java.lang.String CUSTOM_HEAD_FILED_CACHE_OFFLINE

HTTP header:cache-offline.
This header indicates whether the website needs to be refreshed or not. 另请参阅:常量字段值

- 

DNS_PREFETCH_ADDRESS

public static final java.lang.String DNS_PREFETCH_ADDRESS

HTTP header:dns-prefetch-address
This header represents the ip address of the server.
Sonic Connection will use this ip to connect to server to avoid the cost time of DNS resolution. 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_SDK_VERSION

public static final java.lang.String CUSTOM_HEAD_FILED_SDK_VERSION

HTTP Header:sdk_version.
This header represents the version of SDK. 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_DNS_PREFETCH

public static final java.lang.String CUSTOM_HEAD_FILED_DNS_PREFETCH

HTTP Header:dns-prefetch.
This header indicates that Sonic connection has used the ip represented by DNS_PREFETCH_ADDRESS 另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_HTML_SHA1

public static final java.lang.String CUSTOM_HEAD_FILED_HTML_SHA1

HTTP header: .

另请参阅:常量字段值

- 

HTTP_HEAD_CSP

public static final java.lang.String HTTP_HEAD_CSP

HTTP Header:Content-Security-Policy.
This header represents the HTML CSP. 另请参阅:常量字段值

- 

HTTP_HEAD_CSP_REPORT_ONLY

public static final java.lang.String HTTP_HEAD_CSP_REPORT_ONLY

HTTP Header:Content-Security-Policy-Report-Only.
This header represents the HTML Content-Security-Policy-Report-Only. 另请参阅:常量字段值

- 

HTTP_HEAD_FILED_SET_COOKIE

public static final java.lang.String HTTP_HEAD_FILED_SET_COOKIE

HTTP Header:Set-Cookie.
This header represents the HTML Set-Cookie. 另请参阅:常量字段值

- 

HTTP_HEAD_FIELD_CACHE_CONTROL

public static final java.lang.String HTTP_HEAD_FIELD_CACHE_CONTROL

HTTP Header : Cache-Control.
This header represents the strategy of cache control. 另请参阅:常量字段值

- 

HTTP_HEAD_FIELD_EXPIRES

public static final java.lang.String HTTP_HEAD_FIELD_EXPIRES

HTTP Header : Expires.

另请参阅:常量字段值

- 

HTTP_HEAD_FIELD_PRAGMA

public static final java.lang.String HTTP_HEAD_FIELD_PRAGMA

HTTP 1.0 Header : Pragma.
This old header represents the old strategy of cache control. 另请参阅:常量字段值

- 

HTTP_HEAD_FIELD_CONTENT_TYPE

public static final java.lang.String HTTP_HEAD_FIELD_CONTENT_TYPE

HTTP Header : Content-Type.

另请参阅:常量字段值

- 

HTTP_HEAD_FIELD_CONTENT_LENGTH

public static final java.lang.String HTTP_HEAD_FIELD_CONTENT_LENGTH

HTTP Header : Content-Length.

另请参阅:常量字段值

- 

HTTP_HEAD_FIELD_COOKIE

public static final java.lang.String HTTP_HEAD_FIELD_COOKIE

HTTP Request Header : Cookie.

另请参阅:常量字段值

- 

HTTP_HEAD_FILED_USER_AGENT

public static final java.lang.String HTTP_HEAD_FILED_USER_AGENT

HTTP Request Header:User-Agent.

另请参阅:常量字段值

- 

HTTP_HEAD_FILED_IF_NOT_MATCH

public static final java.lang.String HTTP_HEAD_FILED_IF_NOT_MATCH

另请参阅:常量字段值

- 

CUSTOM_HEAD_FILED_LINK

public static final java.lang.String CUSTOM_HEAD_FILED_LINK

HTTP Response Header: Link.

另请参阅:常量字段值

- 

session

protected final[SonicSession](../../../../com/tencent/sonic/sdk/SonicSession.html "com.tencent.sonic.sdk中的类")session

SonicSession Object used by SonicSessionConnection.

- 

intent

protected final android.content.Intent intent

This intent saves all of the initialization param.

- 

responseStream

protected java.io.BufferedInputStream responseStream

The input stream that reads from this open connection.

构造器详细资料

- 

SonicSessionConnection

public SonicSessionConnection([SonicSession](../../../../com/tencent/sonic/sdk/SonicSession.html "com.tencent.sonic.sdk中的类")session,
                              android.content.Intent intent)

Constructor 参数:session - The SonicSession instanceintent - The intent

方法详细资料

- 

connect

public int connect()

Opens a communications link to the resource referenced by Sonic session 返回:Returns the response code of connection

- 

disconnect

public abstract void disconnect()

Disconnect the communications link to the resource referenced by Sonic session

- 

getResponseCode

public abstract int getResponseCode()
- 

getResponseHeaderFields

public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getResponseHeaderFields()
- 

getResponseHeaderField

public abstract java.lang.String getResponseHeaderField(java.lang.String key)

参数:key - the name of a header field.返回:Returns the value of the named header field.

- 

getResponseStream

public java.io.BufferedInputStream getResponseStream()

返回:Returns an input stream that reads from this open connection.

- 

internalConnect

protected abstract int internalConnect()
- 

internalGetResponseStream

protected abstract java.io.BufferedInputStream internalGetResponseStream()

跳过导航链接