public final class CachedDataService
- Object
- ConnectionRequest
- CachedDataService
ImplementsIOProgressListener
Methods
public static void register() | Makes sure the cached data class is properly registered as an externalizable. |
public static void updateData(CachedData d, ActionListener callback) | Checks that the cached data is up to date and if a newer version exits it updates the data in place |
public boolean equals(Object o) | Indicates whether some other object is “equal to” this one. |
public int hashCode() | Returns a hash code value for the object. |
protected void handleException(Exception err) | Handles an exception thrown when performing a network operation, the default implementation shows a retry dialog. |
protected void handleErrorResponseCode(int code, String message) | Handles a server response code that is not 200 and not a redirect (unless redirect handling is disabled) |
protected void readHeaders(Object connection)
throws IOException | Allows reading the headers from the connection by calling the getHeader() method. |
protected void readResponse(InputStream input)
throws IOException | Callback for the server response with the input stream from the server. |
Inherited nested types
Inherited fields
Inherited methods
From ConnectionRequest
getDefaultCacheMode, setDefaultCacheMode, isReadResponseForErrorsDefault, setReadResponseForErrorsDefault, isHandleErrorCodesInGlobalErrorHandler, setHandleErrorCodesInGlobalErrorHandler, getCookieHeader, setCookieHeader, isCookiesEnabledDefault, setCookiesEnabledDefault, isDefaultFollowRedirects, setDefaultFollowRedirects, isReadTimeoutSupported, purgeCacheDirectory, getDefaultUserAgent, setDefaultUserAgent, setUseNativeCookieStore, isNativeCookieSharingSupported, fetchJSON, fetchJSONAsync, getCacheMode, setCacheMode, isCheckSSLCertificates, setCheckSSLCertificates, isInsecure, setInsecure, getResponseData, getHttpMethod, setHttpMethod, addRequestHeader, removeRequestHeader, removeRequestHeaderIfUnchanged, checkSSLCertificates, getReadTimeout, setReadTimeout, initConnection, getCachedData, purgeCache, cacheUnmodified, cookieReceived, cookieSent, initCookieHeader, getResponseCode, getResposeCode, shouldConvertPostToGetOnRedirect, readErrorCodeHeaders, getHeader, getHeaders, getHeaderFieldNames, getYield, shouldAutoCloseResponse, handleIOException, handleRuntimeException, canGetSSLCertificates, getSSLCertificates, retry, onRedirect, postResponse, createRequestURL, buildRequestBody, shouldWriteUTFAsGetBytes, kill, shouldStop, isPausable, pause, resume, isPost, setPost, addArgument, removeArgument, removeAllArguments, addArgumentNoEncoding, addArgumentNoEncoding, addArgumentNoEncodingArray, addArgument, addArgumentArray, addArgument, addArguments, getContentType, setContentType, isWriteRequest, setWriteRequest, isReadRequest, setReadRequest, isPaused, setPaused, isKilled, setKilled, getPriority, setPriority, getUserAgent, setUserAgent, isFollowRedirects, setFollowRedirects, getTimeout, setTimeout, getContentLength, ioStreamUpdate, getUrl, setUrl, addResponseListener, removeResponseListener, addResponseCodeListener, addExceptionListener, removeResponseCodeListener, removeExceptionListener, hasResponseListeners, fireResponseListener, isDuplicateSupported, setDuplicateSupported, validate, getDisposeOnCompletion, setDisposeOnCompletion, getShowOnInit, setShowOnInit, getSilentRetryCount, setSilentRetryCount, isFailSilently, setFailSilently, isReadResponseForErrors, setReadResponseForErrors, getResponseContentType, isRedirecting, getDestinationFile, setDestinationFile, getDestinationStorage, setDestinationStorage, isCookiesEnabled, setCookiesEnabled, setChunkedStreamingMode, downloadImageToStorage, downloadImageToStorage, downloadImageToStorage, downloadImageToStorage, downloadImageToStorage, downloadImageToStorage, downloadImageToFileSystem, downloadImageToFileSystem, downloadImageToFileSystem, downloadImageToFileSystem, downloadImageToFileSystem, downloadImageToFileSystem, getRequestBody, setRequestBody, setRequestBody, getRequestBodyData, getResponseErrorMessage
Method details
register
public static void register()updateData
public static void updateData(CachedData d, ActionListener callback)Parameters
dCachedData- the data to check
callbackActionListener- optional callback to be invoked on request completion
equals
public boolean equals(Object o)hashCode
public int hashCode()handleException
protected void handleException(Exception err)Parameters
errException- the exception thrown
handleErrorResponseCode
protected void handleErrorResponseCode(int code, String message)Parameters
codeint- the response code from the server
messageString- the response message from the server
readHeaders
protected void readHeaders(Object connection)
throws IOExceptionParameters
connectionObject- used when invoking getHeader
Throws
java.io.IOException- thrown on failure
readResponse
protected void readResponse(InputStream input)
throws IOExceptionParameters
inputInputStream- the input stream containing the response
Throws
IOException- when a read input occurs