Class CreateRoomSettings.RoomExtensionSettings

java.lang.Object
com.smartfoxserver.api.CreateRoomSettings.RoomExtensionSettings
All Implemented Interfaces:
Serializable
Enclosing class:
CreateRoomSettings

public static final class CreateRoomSettings.RoomExtensionSettings extends Object implements Serializable
Define the Extension settings of the Room

Each extension can define 3 parameters

  • id: the id of the extension (corresponding to the extension folder name)
  • className: the main extension class file
  • propertiesFile: (optional) a properties file containing custom configuration data for your extension.
See Also:
  • Constructor Details

    • RoomExtensionSettings

      public RoomExtensionSettings(String id, String className)
      The Extension id is the name of the folder that contains it. The className is the fully qualified name of the Extension's main class, which extends SFSExtension

      This is also valid for other supported languages such as Kotlin, Scala and Groovy.

      There is however an exception to this rule when using Groovy as a scripts rather than pre-compiling it. In this case the className should be name of the Groovy script to load.

      Parameters:
      id - the id must correspond to the Extension's folder name under the extensions/ directory
      className - the fully qualified name of the Extension main class (extending SFSExtension)
  • Method Details

    • getId

      public String getId()
      Get the extension id
      Returns:
      the extension id
    • getClassName

      public String getClassName()
      Get the fully qualified name of the Extension main class
      Returns:
      the fully qualified name of the Extension main class
    • setPropertiesFile

      public void setPropertiesFile(String propertiesFile)
      Set an optional properties file that will be loaded when the Extension is initialized. By default the Server already looks for a config.properties in the extension folder. If the file exists it is auto-loaded.

      The properties are immediately available in your extension via the SFSExtension.getConfigProperties() protected method.

      Parameters:
      propertiesFile - the name of the custom config properties file.
    • getPropertiesFile

      public String getPropertiesFile()
      Get the name of the custom config properties file
      Returns:
      the name of the custom config properties file
    • toString

      public String toString()
      Overrides:
      toString in class Object