Package com.smartfoxserver.api
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 Summary
ConstructorsConstructorDescriptionRoomExtensionSettings(String id, String className) The Extension id is the name of the folder that contains it. -
Method Summary
Modifier and TypeMethodDescriptionGet the fully qualified name of the Extension main classgetId()Get the extension idGet the name of the custom config properties filevoidsetPropertiesFile(String propertiesFile) Set an optional properties file that will be loaded when the Extension is initialized.toString()
-
Constructor Details
-
RoomExtensionSettings
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 extendsSFSExtensionThis 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/ directoryclassName- the fully qualified name of the Extension main class (extendingSFSExtension)
-
-
Method Details
-
getId
Get the extension id- Returns:
- the extension id
-
getClassName
Get the fully qualified name of the Extension main class- Returns:
- the fully qualified name of the Extension main class
-
setPropertiesFile
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
Get the name of the custom config properties file- Returns:
- the name of the custom config properties file
-
toString
-