private void applyDataUpdate(final M data) {
        this.data = data;
        CompletableFutureLite<M> currentSyncFuture = null;
        Future<M> currentSyncTask = null;

        // Check if sync is in process.
        synchronized (syncMonitor) {
            if (syncFuture != null) {
                currentSyncFuture = syncFuture;
                currentSyncTask = syncTask;
                syncFuture = null;
                syncTask = null;
            }
        }

        if (currentSyncFuture != null) {
            currentSyncFuture.complete(data);
        }

        if (currentSyncTask != null && !currentSyncTask.isDone()) {
            currentSyncTask.cancel(false);
        }

        setConnectionState(CONNECTED);

        // Notify data update
        try {
            notifyPrioritizedObservers(data);
        } catch (CouldNotPerformException ex) {
            ExceptionPrinter.printHistory(new CouldNotPerformException("Could not notify data update!", ex), logger);
        }

        try {
            dataObservable.notifyObservers(data);
        } catch (CouldNotPerformException ex) {
            ExceptionPrinter.printHistory(new CouldNotPerformException("Could not notify data update to all observer!", ex), logger);
        }
    }
private void applyDataUpdate ( final M data ) { this . data = data ; CompletableFutureLite < M > currentSyncFuture = null ; Future < M > currentSyncTask = null ; synchronized ( syncMonitor ) { if ( syncFuture != null ) { currentSyncFuture = syncFuture ; currentSyncTask = syncTask ; syncFuture = null ; syncTask = null ; } } if ( currentSyncFuture != null ) { currentSyncFuture . complete ( data ) ; } if ( currentSyncTask != null && ! currentSyncTask . isDone ( ) ) { currentSyncTask . cancel ( false ) ; } setConnectionState ( CONNECTED ) ; try { notifyPrioritizedObservers ( data ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( new CouldNotPerformException ( "Could not notify data update!" , ex ) , logger ) ; } try { dataObservable . notifyObservers ( data ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( new CouldNotPerformException ( "Could not notify data update to all observer!" , ex ) , logger ) ; } }
Method is used to internally update the data object.

@param data