Interface IAttributeStore

All Superinterfaces:
AttributeStoreMXBean
All Known Subinterfaces:
ICastingAttributeStore, IClient, IConnection, IRemotingConnection, IServiceCapableConnection, IStreamCapableConnection
All Known Implementing Classes:
AdminApplication, AntMediaApplicationAdapter, ApplicationAdapter, AttributeStore, BaseConnection, Client, MultiThreadedApplicationAdapter, PersistableAttributeStore, RTMPConnection, RTMPMinaConnection, StatefulScopeWrappingAdapter

public interface IAttributeStore extends AttributeStoreMXBean
Base interface for all API objects with attributes
Author:
The Red5 Project, Luke Hubbard (luke@codegent.com)
  • Method Details

    • getAttributeNames

      Set<String> getAttributeNames()
      Get the attribute names. The resulting set will be read-only.
      Specified by:
      getAttributeNames in interface AttributeStoreMXBean
      Returns:
      set containing all attribute names
    • getAttributes

      Map<String,Object> getAttributes()
      Get the attributes. The resulting map will be read-only.
      Returns:
      map containing all attributes
    • setAttribute

      boolean setAttribute(String name, Object value)
      Set an attribute on this object.
      Parameters:
      name - the name of the attribute to change
      value - the new value of the attribute
      Returns:
      true if the attribute value changed otherwise false
    • setAttributes

      boolean setAttributes(Map<String,Object> values)
      Set multiple attributes on this object.
      Parameters:
      values - the attributes to set
      Returns:
      true if the attribute values changed otherwise false
    • setAttributes

      boolean setAttributes(IAttributeStore values)
      Set multiple attributes on this object.
      Parameters:
      values - the attributes to set
      Returns:
      true if the attribute values changed otherwise false
    • getAttribute

      Object getAttribute(String name)
      Return the value for a given attribute.
      Parameters:
      name - the name of the attribute to get
      Returns:
      the attribute value or null if the attribute doesn't exist
    • getAttribute

      Object getAttribute(String name, Object defaultValue)
      Return the value for a given attribute and set it if it doesn't exist. This is a utility function that internally performs the following code:
       if (!hasAttribute(name))
           setAttribute(name, defaultValue);
       return getAttribute(name);
       
      Parameters:
      name - the name of the attribute to get
      defaultValue - the value of the attribute to set if the attribute doesn't exist
      Returns:
      the attribute value
    • hasAttribute

      boolean hasAttribute(String name)
      Check the object has an attribute.
      Specified by:
      hasAttribute in interface AttributeStoreMXBean
      Parameters:
      name - the name of the attribute to check
      Returns:
      true if the attribute exists otherwise false
    • removeAttribute

      boolean removeAttribute(String name)
      Remove an attribute.
      Specified by:
      removeAttribute in interface AttributeStoreMXBean
      Parameters:
      name - the name of the attribute to remove
      Returns:
      true if the attribute was found and removed otherwise false
    • removeAttributes

      void removeAttributes()
      Remove all attributes.
      Specified by:
      removeAttributes in interface AttributeStoreMXBean
    • size

      int size()
      Size of the attribute store.
      Returns:
      count of attributes