sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionConnection.html
com.tencent.sonic.sdk
java.lang.Object
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() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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.
另请参阅:常量字段值
-
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.
另请参阅:常量字段值
-
public static final java.lang.String CUSTOM_HEAD_FILED_TEMPLATE_TAG
HTTP header:template_tag.
This header represents SHA1 value of the template file.
另请参阅:常量字段值
-
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.
另请参阅:常量字段值
-
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.
另请参阅:常量字段值
-
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.
另请参阅:常量字段值
-
public static final java.lang.String CUSTOM_HEAD_FILED_SDK_VERSION
HTTP Header:sdk_version.
This header represents the version of SDK.
另请参阅:常量字段值
-
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
另请参阅:常量字段值
-
public static final java.lang.String CUSTOM_HEAD_FILED_HTML_SHA1
HTTP header: .
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_CSP
HTTP Header:Content-Security-Policy.
This header represents the HTML CSP.
另请参阅:常量字段值
-
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.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FILED_SET_COOKIE
HTTP Header:Set-Cookie.
This header represents the HTML Set-Cookie.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FIELD_CACHE_CONTROL
HTTP Header : Cache-Control.
This header represents the strategy of cache control.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FIELD_EXPIRES
HTTP Header : Expires.
另请参阅:常量字段值
-
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.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FIELD_CONTENT_TYPE
HTTP Header : Content-Type.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FIELD_CONTENT_LENGTH
HTTP Header : Content-Length.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FIELD_COOKIE
HTTP Request Header : Cookie.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FILED_USER_AGENT
HTTP Request Header:User-Agent.
另请参阅:常量字段值
-
public static final java.lang.String HTTP_HEAD_FILED_IF_NOT_MATCH
另请参阅:常量字段值
-
public static final java.lang.String CUSTOM_HEAD_FILED_LINK
HTTP Response Header: Link.
另请参阅:常量字段值
-
protected final[SonicSession](../../../../com/tencent/sonic/sdk/SonicSession.html "com.tencent.sonic.sdk中的类")session
SonicSession Object used by SonicSessionConnection.
-
protected final 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.
-
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
-
public int connect()
Opens a communications link to the resource referenced by Sonic session 返回:Returns the response code of connection
-
public abstract void disconnect()
Disconnect the communications link to the resource referenced by Sonic session
-
public abstract int getResponseCode()
-
public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getResponseHeaderFields()
-
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.
-
public java.io.BufferedInputStream getResponseStream()
返回:Returns an input stream that reads from this open connection.
-
protected abstract int internalConnect()
-
protected abstract java.io.BufferedInputStream internalGetResponseStream()