Package com.djrapitops.plan.extension
Class ExtensionSvc
- java.lang.Object
-
- com.djrapitops.plan.extension.ExtensionSvc
-
- All Implemented Interfaces:
ExtensionService
@Singleton public class ExtensionSvc extends java.lang.Object implements ExtensionService
Implementation forExtensionService
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.djrapitops.plan.extension.ExtensionService
ExtensionService.Holder
-
-
Constructor Summary
Constructors Constructor Description ExtensionSvc(PlanConfig config, DBSystem dbSystem, ServerInfo serverInfo, Processing processing, ExtensionRegister extensionRegister, net.playeranalytics.plugin.server.PluginLogger logger, ErrorLogger errorLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionDataBuilder
newExtensionDataBuilder(DataExtension extension)
Obtain a newExtensionDataBuilder
, it is recommended to useDataExtension.newExtensionDataBuilder()
.void
register()
java.util.Optional<Caller>
register(DataExtension dataExtension)
Register yourDataExtension
implementation.void
registerExtensions()
void
unregister(DataExtension extension)
Unregister yourDataExtension
implementation.void
updatePlayerValues(DataValueGatherer gatherer, java.util.UUID playerUUID, java.lang.String playerName, CallEvents event)
void
updatePlayerValues(java.util.UUID playerUUID, java.lang.String playerName, CallEvents event)
void
updateServerValues(CallEvents event)
void
updateServerValues(DataValueGatherer gatherer, CallEvents event)
-
-
-
Constructor Detail
-
ExtensionSvc
@Inject public ExtensionSvc(PlanConfig config, DBSystem dbSystem, ServerInfo serverInfo, Processing processing, ExtensionRegister extensionRegister, net.playeranalytics.plugin.server.PluginLogger logger, ErrorLogger errorLogger)
-
-
Method Detail
-
register
public void register()
-
registerExtensions
public void registerExtensions()
-
register
public java.util.Optional<Caller> register(DataExtension dataExtension)
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
public void unregister(DataExtension extension)
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
public ExtensionDataBuilder newExtensionDataBuilder(DataExtension extension)
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
public void updatePlayerValues(java.util.UUID playerUUID, java.lang.String playerName, CallEvents event)
-
updatePlayerValues
public void updatePlayerValues(DataValueGatherer gatherer, java.util.UUID playerUUID, java.lang.String playerName, CallEvents event)
-
updateServerValues
public void updateServerValues(CallEvents event)
-
updateServerValues
public void updateServerValues(DataValueGatherer gatherer, CallEvents event)
-
-