Interface IPersistable

All Known Implementing Classes:
PersistableAttributeStore

public interface IPersistable
Base interface for objects that can be made persistent. Every object that complies to this interface must provide either a constructor that takes an input stream as only parameter or an empty constructor so it can be loaded from the persistence store. However this is not required for objects that are created by the application and initialized afterwards.
Author:
The Red5 Project, Luke Hubbard (luke@codegent.com), Joachim Bauch (jojo@struktur.de)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Prefix for attribute names that should not be made persistent.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Load the object from the passed input stream.
    long
    Returns the timestamp when the object was last modified.
    Returns the name of the persistent object.
    Returns the path of the persistent object.
    Returns the persistence store this object is stored in
    Returns the type of the persistent object.
    boolean
    Returns
    void
    serialize(Output output)
    Write the object to the passed output stream.
    void
    Set the name of the persistent object.
    void
    Set the path of the persistent object.
    void
    setPersistent(boolean persistent)
    Set the persistent flag of the object.
    void
    Store a reference to the persistence store in the object.
  • Field Details

    • TRANSIENT_PREFIX

      static final String TRANSIENT_PREFIX
      Prefix for attribute names that should not be made persistent.
      See Also:
  • Method Details

    • isPersistent

      boolean isPersistent()
      Returns
       true
       
      if the object is persistent,
       false
       
      otherwise.
      Returns:
       true
       
      if object is persistent,
       false
       
      otherwise
    • setPersistent

      void setPersistent(boolean persistent)
      Set the persistent flag of the object.
      Parameters:
      persistent -
       true
       
      if object is persistent,
       false
       
      otherwise
    • getName

      String getName()
      Returns the name of the persistent object.
      Returns:
      Object name
    • setName

      void setName(String name)
      Set the name of the persistent object.
      Parameters:
      name - New object name
    • getType

      String getType()
      Returns the type of the persistent object.
      Returns:
      Object type
    • getPath

      String getPath()
      Returns the path of the persistent object.
      Returns:
      Persisted object path
    • setPath

      void setPath(String path)
      Set the path of the persistent object.
      Parameters:
      path - New persisted object path
    • getLastModified

      long getLastModified()
      Returns the timestamp when the object was last modified.
      Returns:
      Last modification date in milliseconds
    • getStore

      IPersistenceStore getStore()
      Returns the persistence store this object is stored in
      Returns:
      This object's persistence store
    • setStore

      void setStore(IPersistenceStore store)
      Store a reference to the persistence store in the object.
      Parameters:
      store - Store the object is saved in
    • serialize

      void serialize(Output output) throws IOException
      Write the object to the passed output stream.
      Parameters:
      output - Output stream to write to
      Throws:
      IOException - Any I/O exception
    • deserialize

      void deserialize(Input input) throws IOException
      Load the object from the passed input stream.
      Parameters:
      input - Input stream to load from
      Throws:
      IOException - Any I/O exception