Awake SQL v1.2.1

org.awakefw.commons.api.client
Class DefaultAwakeProgressManager

java.lang.Object
  extended by org.awakefw.commons.api.client.DefaultAwakeProgressManager
All Implemented Interfaces:
AwakeProgressManager

public class DefaultAwakeProgressManager
extends Object
implements AwakeProgressManager

A default implementation for an Awake Progress Manager. 

This implementation is ready to use without any customization.

Since:
1.0

Constructor Summary
DefaultAwakeProgressManager()
          Constructor.
 
Method Summary
 void cancel()
          Cancels the current monitored operation.
 long getLengthToTransfer()
          Allows to define the total length in bytes of the file(s) to transfer.
 int getProgress()
          Returns the progress (as percentage) of the current monitored operation.
 boolean isCancelled()
          Method repeatedly called by Awake when uploading/downloading files.
 void setLengthToTransfer(long lengthToTransfer)
          Will reinitialize all other values for a new usage: cancelValue = false progress = 0
 void setProgress(int progress)
          Sets the progress in percentage of the transfer operation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAwakeProgressManager

public DefaultAwakeProgressManager()
Constructor.

Method Detail

cancel

public void cancel()
Description copied from interface: AwakeProgressManager
Cancels the current monitored operation.

Specified by:
cancel in interface AwakeProgressManager

getLengthToTransfer

public long getLengthToTransfer()
Description copied from interface: AwakeProgressManager
Allows to define the total length in bytes of the file(s) to transfer. Method will be called by Awake just before the transfer operation.

Specified by:
getLengthToTransfer in interface AwakeProgressManager
Returns:
the number for bytes to transfer

getProgress

public int getProgress()
Description copied from interface: AwakeProgressManager
Returns the progress (as percentage) of the current monitored operation.
Method is needed and will be called by an external observer (Timer, SwingWorker, ...) to retrieve the progress value between 0 and 100.

Specified by:
getProgress in interface AwakeProgressManager
Returns:
the progress value as percentage value

isCancelled

public boolean isCancelled()
Description copied from interface: AwakeProgressManager
Method repeatedly called by Awake when uploading/downloading files.

Returns true if this task was canceled before it completed normally.

Specified by:
isCancelled in interface AwakeProgressManager
Returns:
true if this task was canceled before it completed

setLengthToTransfer

public void setLengthToTransfer(long lengthToTransfer)
Will reinitialize all other values for a new usage:

Specified by:
setLengthToTransfer in interface AwakeProgressManager
Parameters:
lengthToTransfer - the total length in bytes of the file(s) to transfer

setProgress

public void setProgress(int progress)
Description copied from interface: AwakeProgressManager
Sets the progress in percentage of the transfer operation.

The method is repeatedly called by Awake during transfer operation each 1% of transfer done.

Specified by:
setProgress in interface AwakeProgressManager
Parameters:
progress - The value must be between 0 and 100

Awake SQL v1.2.1

Awake SQL - Virtual JDBC Driver over HTTP for Android, Swing and JavaFX
Android & Desktop Edition allow easy access to majors remote SQL databases with regular JDBC calls:
DB2 - H2 - HSQLDB (HyperSQL) - Informix - Ingres - MySQL - Oracle - PostgreSQL - SQL Server - Sybase - Teradata
Copyright © 2012 Kawan Softwares SAS