com.vaadin.data.provider.

Class DataCommunicator.ActiveDataHandler

    • Constructor Detail

      • ActiveDataHandler

        protected ActiveDataHandler()
    • Method Detail

      • addActiveData

        public void addActiveData​(Stream<T> dataObjects)

        Adds given objects as currently active objects.

        Parameters:

        dataObjects - collection of new active data objects

      • cleanUp

        public void cleanUp​(Stream<T> dataObjects)

        Executes the data destruction for dropped data that is not sent to the client. This method takes most recently sent data objects in a collection. Doing the clean up like this prevents the DataCommunicator.ActiveDataHandler from creating new keys for rows that were dropped but got re-requested by the client-side. In the case of having all data at the client, the collection should be all the data in the back end.

        Parameters:

        dataObjects - collection of most recently sent data to the client

      • dropAllActiveData

        public void dropAllActiveData()

        Marks all currently active data objects to be dropped.

        Since:

        8.6.0

      • dropActiveData

        public void dropActiveData​(String key)

        Marks a data object identified by given key string to be dropped.

        Parameters:

        key - key string

      • getDroppedData

        protected Map<Object,​T> getDroppedData()

        Returns all dropped data mapped by their id from DataProvider.

        Returns:

        map of ids to dropped data objects

        Since:

        8.6.0

      • getActiveData

        public Map<Object,​T> getActiveData()

        Returns all currently active data mapped by their id from DataProvider.

        Returns:

        map of ids to active data objects

      • generateData

        public void generateData​(T data,
                                 elemental.json.JsonObject jsonObject)

        Description copied from interface: DataGenerator

        Adds custom data for the given item to its serialized JsonObject representation. This JSON object will be sent to client-side DataProvider.

        Specified by:

        generateData in interface DataGenerator<T>

        Parameters:

        data - the data item being serialized

        jsonObject - the JSON object being sent to the client

      • destroyData

        public void destroyData​(T data)

        Description copied from interface: DataGenerator

        Informs the DataGenerator that the given data item has been dropped and is no longer needed. This method should clean up any unneeded information stored for this item.

        Specified by:

        destroyData in interface DataGenerator<T>

        Parameters:

        data - the dropped data item

      • destroyAllData

        public void destroyAllData()

        Description copied from interface: DataGenerator

        Informs the DataGenerator that all data has been dropped. This method should clean up any unneeded information stored for items.

        Specified by:

        destroyAllData in interface DataGenerator<T>