Package com.djrapitops.plan.extension
Class ExtensionSvc
java.lang.Object
com.djrapitops.plan.extension.ExtensionSvc
- All Implemented Interfaces:
ExtensionService
Implementation for
ExtensionService
.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.djrapitops.plan.extension.ExtensionService
ExtensionService.Holder
-
Constructor Summary
ConstructorDescriptionExtensionSvc(PlanConfig config, DBSystem dbSystem, ServerInfo serverInfo, Processing processing, ExtensionRegister extensionRegister, UUIDUtility uuidUtility, net.playeranalytics.plugin.server.PluginLogger logger, ErrorLogger errorLogger)
-
Method Summary
Modifier and TypeMethodDescriptionnewExtensionDataBuilder(DataExtension extension)
Obtain a newExtensionDataBuilder
, it is recommended to useDataExtension.newExtensionDataBuilder()
.void
register()
register(DataExtension dataExtension)
Register yourDataExtension
implementation.void
void
unregister(DataExtension extension)
Unregister yourDataExtension
implementation.void
updatePlayerValues(DataValueGatherer gatherer, UUID playerUUID, String playerName, CallEvents event)
void
updatePlayerValues(UUID playerUUID, String playerName, CallEvents event)
void
updateServerValues(CallEvents event)
void
updateServerValues(DataValueGatherer gatherer, CallEvents event)
-
Constructor Details
-
ExtensionSvc
@Inject public ExtensionSvc(PlanConfig config, DBSystem dbSystem, ServerInfo serverInfo, Processing processing, ExtensionRegister extensionRegister, UUIDUtility uuidUtility, net.playeranalytics.plugin.server.PluginLogger logger, ErrorLogger errorLogger)
-
-
Method Details
-
register
public void register() -
registerExtensions
public void registerExtensions() -
register
Description copied from interface:ExtensionService
Register yourDataExtension
implementation.You can use
ExtensionExtractor.validateAnnotations()
in your Unit Tests to prevent IllegalArgumentExceptions here at runtime.- Specified by:
register
in interfaceExtensionService
- Parameters:
dataExtension
- Your DataExtension implementation, seeDataExtension
for requirements.- Returns:
- Optional
Caller
that can be used to call for data update in Plan database manually - If the Optional is not present the user has disabled the extension in Plan config.
-
unregister
Description copied from interface:ExtensionService
Unregister yourDataExtension
implementation.This method should be used if calling methods on the DataExtension suddenly becomes unavailable, due to plugin disable for example.
- Specified by:
unregister
in interfaceExtensionService
- Parameters:
extension
- Your DataExtension implementation that was registered before.
-
newExtensionDataBuilder
Description copied from interface:ExtensionService
Obtain a newExtensionDataBuilder
, it is recommended to useDataExtension.newExtensionDataBuilder()
.Requires Capability DATA_EXTENSION_BUILDER_API
- Specified by:
newExtensionDataBuilder
in interfaceExtensionService
- Parameters:
extension
- Extension for which this builder is.- Returns:
- a new builder.
-
updatePlayerValues
-
updatePlayerValues
public void updatePlayerValues(DataValueGatherer gatherer, UUID playerUUID, String playerName, CallEvents event) -
updateServerValues
-
updateServerValues
-