Updated OperationMonitor
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-monitor-widget@99253 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cdce37127b
commit
edeec43f8c
|
@ -99,4 +99,18 @@ public class MonitorBarUpdater implements MonitorUpdaterListener {
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void monitorAborted() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void monitorPutInBackground() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -164,6 +164,24 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitorChanged(OperationMonitor operationMonitor) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitorAborted() {
|
||||
fireOperationAborted();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitorPutInBackground() {
|
||||
fireOperationPutInBackground();
|
||||
|
||||
}
|
||||
|
||||
protected void fireOperationComplete(TRId trId) {
|
||||
for (MonitorDialogListener listener : listeners)
|
||||
|
@ -179,6 +197,17 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
for (MonitorDialogListener listener : listeners)
|
||||
listener.operationStopped(trId, reason, details);
|
||||
}
|
||||
|
||||
protected void fireOperationAborted() {
|
||||
for (MonitorDialogListener listener : listeners)
|
||||
listener.operationAborted();
|
||||
}
|
||||
|
||||
protected void fireOperationPutInBackground() {
|
||||
for (MonitorDialogListener listener : listeners)
|
||||
listener.operationPutInBackground();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
@ -215,10 +244,6 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitorChanged(OperationMonitor operationMonitor) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -49,12 +49,13 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
|
|||
}
|
||||
|
||||
public void onSuccess(OperationMonitor result) {
|
||||
Log.info("retrieved OperationMonitor: "
|
||||
+ result.getTask().getState());
|
||||
Log.debug("retrieved OperationMonitor: "
|
||||
+ result);
|
||||
|
||||
if(result.isAbort()){
|
||||
if(result.isInBackground()){
|
||||
cancel();
|
||||
|
||||
fireMonitorPutInBackground();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (result.getTask().getState()) {
|
||||
|
@ -64,6 +65,7 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
|
|||
break;
|
||||
case ABORTED:
|
||||
cancel();
|
||||
fireMonitorAborted();
|
||||
Log.info("Aborted");
|
||||
break;
|
||||
case IN_PROGRESS:
|
||||
|
@ -181,6 +183,16 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
|
|||
listener.monitorStopped(trId,reason, details);
|
||||
}
|
||||
|
||||
protected void fireMonitorAborted() {
|
||||
for (MonitorUpdaterListener listener : listeners)
|
||||
listener.monitorAborted();
|
||||
}
|
||||
|
||||
protected void fireMonitorPutInBackground() {
|
||||
for (MonitorUpdaterListener listener : listeners)
|
||||
listener.monitorPutInBackground();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a new {@link MonitorUpdaterListener} to this
|
||||
|
|
|
@ -55,6 +55,19 @@ public interface MonitorUpdaterListener {
|
|||
*/
|
||||
public void monitorStopped(TRId trId, String reason, String details);
|
||||
|
||||
|
||||
/**
|
||||
* Called when the operation is aborted
|
||||
*/
|
||||
public void monitorAborted();
|
||||
|
||||
|
||||
/**
|
||||
* Called when the operation is put in background
|
||||
*/
|
||||
public void monitorPutInBackground();
|
||||
|
||||
|
||||
/**
|
||||
* Called when the operation is generating the view
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue