PersistenceHandler (Resource Management Library 2.8.1-SNAPSHOT API)
Date: 2018-11-04

org.gcube.resourcemanagement.support.server.utils.persistence

## Interface PersistenceHandler<T>

- All Known Implementing Classes:
    PersistentItem

      public interface PersistenceHandler<T>

  Author:
    Daniele Strollo (ISTI-CNR)

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Requires the destroy of the persistent resource.
    `T` | `getData()` The implementation to retrieve data from the persistence manager.
    `void` | `onDestroy()` When the item need no more to be persisted the refresh loop is closed and this method is invoked.
    `void` | `onLoad()` Automatically invoked by the library at instantiation of persistent items.
    `void` | `onRefresh()` The code to execute once the persistent object is refreshed.
    `void` | `setData(T data)` Sets the new data to persist.

- - ### Method Detail

    - #### onRefresh

          void onRefresh()

      The code to execute once the persistent object is refreshed.

    - #### onLoad

          void onLoad()

      Automatically invoked by the library at instantiation of persistent items. Used to make initializations before starting the persistence manager.

    - #### onDestroy

          void onDestroy()

      When the item need no more to be persisted the refresh loop is closed and this method is invoked.

    - #### destroy

          void destroy()

      Requires the destroy of the persistent resource. The persistent file will be deleted and the onDestroy event will be raised.

    - #### getData

          T getData()

      The implementation to retrieve data from the persistence manager.
      Returns:

    - #### setData

          void setData(T data)

      Sets the new data to persist.
      Parameters:
        `data` -

Copyright © 2018. All Rights Reserved.