Francesco Mangiacrapa 6 years ago
parent 46549ec577
commit efdf0cff7b

@ -155,45 +155,49 @@ public class WsThreddsWidgetViewManager {
}
//Removing old monitor
//cancelMonitor(folder);
//Creating new one
final MonitorFolderSyncStatusView currentMonitor = monitorView;
Timer schedulingTimer = new Timer() {
if(monitorView.getSchedulerTime()==null) {
@Override
public void run() {
//Removing old monitor
//cancelMonitor(folder);
//Creating new one
final MonitorFolderSyncStatusView currentMonitor = monitorView;
Timer schedulingTimer = new Timer() {
WsThreddsWidget.wsThreddsSyncService.monitorSyncStatus(folder.getFolderId(), new AsyncCallback<ThSyncStatus>() {
@Override
public void onFailure(Throwable caught) {
cancelMonitor(folder);
}
@Override
public void onSuccess(ThSyncStatus status) {
currentMonitor.updateStatusView(folder, status);
if(status!=null && status.getProcessStatus()!=null) {
if(status.getProcessStatus().getStatus().equals(Status.COMPLETED)) {
GWT.log("Sync completed cancel the polling: "+status);
cancelMonitor(folder);
@Override
public void run() {
WsThreddsWidget.wsThreddsSyncService.monitorSyncStatus(folder.getFolderId(), new AsyncCallback<ThSyncStatus>() {
@Override
public void onFailure(Throwable caught) {
cancelMonitor(folder);
}
@Override
public void onSuccess(ThSyncStatus status) {
currentMonitor.updateStatusView(folder, status);
if(status!=null && status.getProcessStatus()!=null) {
if(status.getProcessStatus().getStatus().equals(Status.COMPLETED)) {
GWT.log("Sync completed cancel the polling: "+status);
cancelMonitor(folder);
}
}
}
}
});
}
};
});
}
};
schedulingTimer.scheduleRepeating(2000);
currentMonitor.setScheduler(schedulingTimer);
saveMonitor(folder, currentMonitor);
}
schedulingTimer.scheduleRepeating(2000);
currentMonitor.setScheduler(schedulingTimer);
saveMonitor(folder, currentMonitor);
panelView.addViewAsWidget(monitorView);
box.add(panelView);
box.show();

Loading…
Cancel
Save