Interface ScriptStorageHandler

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean exists​(String key)
      Returns whether the given key represents a valid storage
      ScriptObjectStorage get​(String key)
      Returns a storage by key with no expiration, updating an existing or creating a new one.
      ScriptObjectStorage get​(String key, Integer timeoutInSeconds)
      Returns a storage by key, updating an existing one with the given timeout if needed, or creating a new one
      ScriptObjectStorage getIfValid​(String key)
      Returns a storage by key if it exists and is not expired, returning null otherwise
      boolean remove​(String key)
      Removes an storage by key, returning whether something was really removed
      void setAlwaysPersist​(boolean alwaysPersist)
      Only used by tests, if true is setted always persist storages when "get" methods are called.
    • Method Detail

      • exists

        boolean exists​(String key)
        Returns whether the given key represents a valid storage
      • get

        ScriptObjectStorage get​(String key)
        Returns a storage by key with no expiration, updating an existing or creating a new one. Equivalent to get(key, null)
      • get

        ScriptObjectStorage get​(String key,
                                Integer timeoutInSeconds)
        Returns a storage by key, updating an existing one with the given timeout if needed, or creating a new one
      • getIfValid

        ScriptObjectStorage getIfValid​(String key)
        Returns a storage by key if it exists and is not expired, returning null otherwise
      • remove

        boolean remove​(String key)
        Removes an storage by key, returning whether something was really removed
      • setAlwaysPersist

        void setAlwaysPersist​(boolean alwaysPersist)
        Only used by tests, if true is setted always persist storages when "get" methods are called.