public class

ExportTileCacheStatus

extends Object
java.lang.Object
   ↳ com.esri.core.tasks.tilecache.ExportTileCacheStatus

Class Overview

This class is used by the offline tile cache generation process (ExportTileCacheTask) to indicate the current status of the task. The URL of the service that the task is running on along with its job ID are also available.

Summary

Protected Constructors
ExportTileCacheStatus()
Public Methods
static ExportTileCacheStatus fromJson(JsonParser parser)
Creates an instance of this class from the given JSON parser.
String getDownloadFilename()
Gets the name of the tile cache file currently being downloaded.
long getDownloadSize()
During tile cache download, this method returns the total number of bytes to be downloaded.
String getJobID()
Gets the job ID of the task whose status is being reported by this instance.
GPJobResource getJobResource()
Gets the job resource.
GPJobResource.JobStatus getStatus()
Gets the current status.
TileCacheJobResource getTileCacheJobResource()
long getTotalBytesDownloaded()
During tile cache download, this method returns the number of bytes downloaded so far for the current file.
long getTotalFiles()
Gets the total number of files expected to be downloaded.
long getTotalFilesDownloaded()
Gets the number of files currently downloaded.
String getUrl()
Gets the URL of the map service the task is running on.
boolean isDownloading()
This method can be used to determine whether or not this ExportTileCacheStatus instance is indicating download progress or not.
String toJson()
Return a JSON representation of this class.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected ExportTileCacheStatus ()

Public Methods

public static ExportTileCacheStatus fromJson (JsonParser parser)

Creates an instance of this class from the given JSON parser.

Parameters
parser JsonParser: the JSON parser
Returns
ExportTileCacheStatus the TileCacheStatus instance
Throws
Exception any exception on parsing the JSON

public String getDownloadFilename ()

Gets the name of the tile cache file currently being downloaded. This can be either a single tpk for a whole tile cache or one of the individual files of a compact tile cache.

Returns
String name of tile cache file currently downloading

public long getDownloadSize ()

During tile cache download, this method returns the total number of bytes to be downloaded.

The returned value is only valid if isDownloading() returns true.

Returns
long number of bytes expected

public String getJobID ()

Gets the job ID of the task whose status is being reported by this instance.

Returns
String the job ID

public GPJobResource getJobResource ()

Gets the job resource. This object contains more status information on the task inlcuding any messages generated by the server.

Returns
GPJobResource the job resource

public GPJobResource.JobStatus getStatus ()

Gets the current status.

Returns
GPJobResource.JobStatus the status

public TileCacheJobResource getTileCacheJobResource ()

public long getTotalBytesDownloaded ()

During tile cache download, this method returns the number of bytes downloaded so far for the current file. Note that if a previous incomplete download is resumed, this number will start from the number of bytes previously downloaded.

The returned value is only valid if isDownloading() returns true.

Returns
long number of bytes downloaded

public long getTotalFiles ()

Gets the total number of files expected to be downloaded. When downloading a tpk, this will always be one.

Returns
long total number of files expected to be downloaded

public long getTotalFilesDownloaded ()

Gets the number of files currently downloaded. When downloading a tpk, there will only be one file. When downloading a compact cache, there will be multiple files.

Returns
long number of files downloaded so far

public String getUrl ()

Gets the URL of the map service the task is running on.

Returns
String the URL

public boolean isDownloading ()

This method can be used to determine whether or not this ExportTileCacheStatus instance is indicating download progress or not. If this returns true, the getDownloadFilename(), getTotalBytesDownloaded() and getDownloadSize() methods will indicate the filename, bytes downloaded so far and total bytes expected respectively for the tile cache file currently downloading. The getTotalFilesDownloaded() and getTotalFiles() methods will indicate the number of files downloaded so far and the total files expected respectively.

Returns
boolean true if this instance is indicating download progress.

public String toJson ()

Return a JSON representation of this class.

Returns
String the JSON representation of this instance
Throws
IOException Signals that an I/O exception has occurred.