From 9c74c40f72c11a0efdc28318e1d6cd0ac5b8b469 Mon Sep 17 00:00:00 2001 From: Rsl1122 <24460436+Rsl1122@users.noreply.github.com> Date: Wed, 12 Feb 2020 18:16:30 +0200 Subject: [PATCH] Renamed some Service related classes --- .../plan/capability/CapabilityService.java | 8 +++---- .../plan/delivery/web/ResolverService.java | 17 ++++++++++++++ .../plan/extension/ExtensionService.java | 8 +++---- .../djrapitops/plan/query/QueryService.java | 8 +++---- .../listeners/BukkitListenerSystem.java | 4 ++-- .../bukkit/PlayerOnlineListener.java | 6 ++--- .../listeners/BungeeListenerSystem.java | 4 ++-- .../bungee/PlayerOnlineListener.java | 6 ++--- .../java/com/djrapitops/plan/PlanSystem.java | 22 +++++++++---------- ...Implementation.java => CapabilitySvc.java} | 15 ++++++------- .../manage/ManageClearCommand.java | 6 ++--- .../manage/ManageRemoveCommand.java | 6 ++--- .../ExtensionServerMethodCallerTask.java | 8 +++---- ...eImplementation.java => ExtensionSvc.java} | 6 ++--- .../implementation/CallerImplementation.java | 6 ++--- ...rviceImplementation.java => QuerySvc.java} | 6 ++--- ...ceImplementation.java => SettingsSvc.java} | 4 ++-- .../plan/storage/upkeep/DBCleanTask.java | 6 ++--- .../plan/storage/database/DatabaseTest.java | 20 ++++++++--------- .../nukkit/PlayerOnlineListener.java | 6 ++--- .../listeners/SpongeListenerSystem.java | 4 ++-- .../sponge/PlayerOnlineListener.java | 6 ++--- .../listeners/VelocityListenerSystem.java | 4 ++-- .../velocity/PlayerOnlineListener.java | 6 ++--- 24 files changed, 104 insertions(+), 88 deletions(-) rename Plan/common/src/main/java/com/djrapitops/plan/capability/{CapabilityServiceImplementation.java => CapabilitySvc.java} (77%) rename Plan/common/src/main/java/com/djrapitops/plan/extension/{ExtensionServiceImplementation.java => ExtensionSvc.java} (98%) rename Plan/common/src/main/java/com/djrapitops/plan/query/{QueryServiceImplementation.java => QuerySvc.java} (96%) rename Plan/common/src/main/java/com/djrapitops/plan/settings/{SettingsServiceImplementation.java => SettingsSvc.java} (96%) diff --git a/Plan/api/src/main/java/com/djrapitops/plan/capability/CapabilityService.java b/Plan/api/src/main/java/com/djrapitops/plan/capability/CapabilityService.java index cd5ed969f..0f41b0c3b 100644 --- a/Plan/api/src/main/java/com/djrapitops/plan/capability/CapabilityService.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/capability/CapabilityService.java @@ -39,7 +39,7 @@ public interface CapabilityService { * @throws IllegalStateException If Plan is installed, but not enabled. */ static CapabilityService getInstance() { - return Optional.ofNullable(CapabilityServiceHolder.service) + return Optional.ofNullable(Holder.service) .orElseThrow(() -> new IllegalStateException("CapabilityService has not been initialised yet.")); } @@ -61,15 +61,15 @@ public interface CapabilityService { return Capability.getByName(capabilityName).isPresent(); } - class CapabilityServiceHolder { + class Holder { static CapabilityService service; - private CapabilityServiceHolder() { + private Holder() { /* Static variable holder */ } static void set(CapabilityService service) { - CapabilityServiceHolder.service = service; + Holder.service = service; } } diff --git a/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResolverService.java b/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResolverService.java index 71de1ea1f..f7022dbc4 100644 --- a/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResolverService.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResolverService.java @@ -32,6 +32,11 @@ import java.util.regex.Pattern; */ public interface ResolverService { + static ResolverService getInstance() { + return Optional.ofNullable(ResolverService.Holder.service) + .orElseThrow(() -> new IllegalStateException("ResolverService has not been initialised yet.")); + } + /** * Register a new resolver. * @@ -68,4 +73,16 @@ public interface ResolverService { * @return Resolver if registered or empty. */ Optional getResolver(String target); + + class Holder { + static ResolverService service; + + private Holder() { + /* Static variable holder */ + } + + static void set(ResolverService service) { + ResolverService.Holder.service = service; + } + } } diff --git a/Plan/api/src/main/java/com/djrapitops/plan/extension/ExtensionService.java b/Plan/api/src/main/java/com/djrapitops/plan/extension/ExtensionService.java index c40b27442..8946fc387 100644 --- a/Plan/api/src/main/java/com/djrapitops/plan/extension/ExtensionService.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/extension/ExtensionService.java @@ -44,7 +44,7 @@ public interface ExtensionService { * @throws IllegalStateException If Plan is installed, but not enabled. */ static ExtensionService getInstance() { - return Optional.ofNullable(ExtensionServiceHolder.service) + return Optional.ofNullable(Holder.service) .orElseThrow(() -> new IllegalStateException("ExtensionService has not been initialised yet.")); } @@ -69,15 +69,15 @@ public interface ExtensionService { */ void unregister(DataExtension extension); - class ExtensionServiceHolder { + class Holder { static ExtensionService service; - private ExtensionServiceHolder() { + private Holder() { /* Static variable holder */ } static void set(ExtensionService service) { - ExtensionServiceHolder.service = service; + Holder.service = service; } } diff --git a/Plan/api/src/main/java/com/djrapitops/plan/query/QueryService.java b/Plan/api/src/main/java/com/djrapitops/plan/query/QueryService.java index 76eee4f98..1bb3255ce 100644 --- a/Plan/api/src/main/java/com/djrapitops/plan/query/QueryService.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/query/QueryService.java @@ -40,7 +40,7 @@ public interface QueryService { * @throws IllegalStateException If Plan is installed, but not enabled. */ static QueryService getInstance() { - return Optional.ofNullable(QueryService.QueryServiceHolder.service) + return Optional.ofNullable(Holder.service) .orElseThrow(() -> new IllegalStateException("QueryService has not been initialised yet.")); } @@ -148,15 +148,15 @@ public interface QueryService { void apply(); } - class QueryServiceHolder { + class Holder { static QueryService service; - private QueryServiceHolder() { + private Holder() { /* Static variable holder */ } static void set(QueryService service) { - QueryService.QueryServiceHolder.service = service; + Holder.service = service; } } diff --git a/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/BukkitListenerSystem.java b/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/BukkitListenerSystem.java index 1d74aea70..d406ec27f 100644 --- a/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/BukkitListenerSystem.java +++ b/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/BukkitListenerSystem.java @@ -19,7 +19,7 @@ package com.djrapitops.plan.gathering.listeners; import com.djrapitops.plan.Plan; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.api.events.PlanBukkitEnableEvent; -import com.djrapitops.plan.capability.CapabilityServiceImplementation; +import com.djrapitops.plan.capability.CapabilitySvc; import com.djrapitops.plan.gathering.listeners.bukkit.*; import org.bukkit.Bukkit; import org.bukkit.event.HandlerList; @@ -82,6 +82,6 @@ public class BukkitListenerSystem extends ListenerSystem { boolean isEnabled = plugin.isSystemEnabled(); PlanBukkitEnableEvent event = new PlanBukkitEnableEvent(isEnabled); Bukkit.getServer().getPluginManager().callEvent(event); - CapabilityServiceImplementation.notifyAboutEnable(isEnabled); + CapabilitySvc.notifyAboutEnable(isEnabled); } } diff --git a/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java b/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java index da20936dc..7ca428595 100644 --- a/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java +++ b/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java @@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.export.Exporter; import com.djrapitops.plan.delivery.webserver.cache.DataID; import com.djrapitops.plan.delivery.webserver.cache.JSONCache; import com.djrapitops.plan.extension.CallEvents; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.gathering.cache.NicknameCache; import com.djrapitops.plan.gathering.cache.SessionCache; import com.djrapitops.plan.gathering.domain.Session; @@ -62,7 +62,7 @@ public class PlayerOnlineListener implements Listener { private final Processing processing; private final ServerInfo serverInfo; private final DBSystem dbSystem; - private final ExtensionServiceImplementation extensionService; + private final ExtensionSvc extensionService; private final Exporter exporter; private final GeolocationCache geolocationCache; private final NicknameCache nicknameCache; @@ -76,7 +76,7 @@ public class PlayerOnlineListener implements Listener { Processing processing, ServerInfo serverInfo, DBSystem dbSystem, - ExtensionServiceImplementation extensionService, + ExtensionSvc extensionService, Exporter exporter, GeolocationCache geolocationCache, NicknameCache nicknameCache, diff --git a/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/BungeeListenerSystem.java b/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/BungeeListenerSystem.java index bb3aba4b9..764494479 100644 --- a/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/BungeeListenerSystem.java +++ b/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/BungeeListenerSystem.java @@ -19,7 +19,7 @@ package com.djrapitops.plan.gathering.listeners; import com.djrapitops.plan.PlanBungee; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.api.events.PlanBungeeEnableEvent; -import com.djrapitops.plan.capability.CapabilityServiceImplementation; +import com.djrapitops.plan.capability.CapabilitySvc; import com.djrapitops.plan.gathering.listeners.bungee.PlayerOnlineListener; import javax.inject.Inject; @@ -50,6 +50,6 @@ public class BungeeListenerSystem extends ListenerSystem { boolean isEnabled = plugin.isSystemEnabled(); PlanBungeeEnableEvent event = new PlanBungeeEnableEvent(isEnabled); ((PlanBungee) plugin).getProxy().getPluginManager().callEvent(event); - CapabilityServiceImplementation.notifyAboutEnable(isEnabled); + CapabilitySvc.notifyAboutEnable(isEnabled); } } diff --git a/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/bungee/PlayerOnlineListener.java b/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/bungee/PlayerOnlineListener.java index 8b60f26fe..2752e1b9d 100644 --- a/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/bungee/PlayerOnlineListener.java +++ b/Plan/bungeecord/src/main/java/com/djrapitops/plan/gathering/listeners/bungee/PlayerOnlineListener.java @@ -21,7 +21,7 @@ import com.djrapitops.plan.delivery.export.Exporter; import com.djrapitops.plan.delivery.webserver.cache.DataID; import com.djrapitops.plan.delivery.webserver.cache.JSONCache; import com.djrapitops.plan.extension.CallEvents; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.gathering.cache.SessionCache; import com.djrapitops.plan.gathering.domain.Session; import com.djrapitops.plan.gathering.geolocation.GeolocationCache; @@ -58,7 +58,7 @@ public class PlayerOnlineListener implements Listener { private final PlanConfig config; private final Processing processing; private final DBSystem dbSystem; - private final ExtensionServiceImplementation extensionService; + private final ExtensionSvc extensionService; private final Exporter exporter; private final GeolocationCache geolocationCache; private final SessionCache sessionCache; @@ -70,7 +70,7 @@ public class PlayerOnlineListener implements Listener { PlanConfig config, Processing processing, DBSystem dbSystem, - ExtensionServiceImplementation extensionService, + ExtensionSvc extensionService, Exporter exporter, GeolocationCache geolocationCache, SessionCache sessionCache, ServerInfo serverInfo, diff --git a/Plan/common/src/main/java/com/djrapitops/plan/PlanSystem.java b/Plan/common/src/main/java/com/djrapitops/plan/PlanSystem.java index 2e10fd34f..074e2ba64 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/PlanSystem.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/PlanSystem.java @@ -17,7 +17,7 @@ package com.djrapitops.plan; import com.djrapitops.plan.api.PlanAPI; -import com.djrapitops.plan.capability.CapabilityServiceImplementation; +import com.djrapitops.plan.capability.CapabilitySvc; import com.djrapitops.plan.delivery.DeliveryUtilities; import com.djrapitops.plan.delivery.export.ExportSystem; import com.djrapitops.plan.delivery.webserver.NonProxyWebserverDisableChecker; @@ -25,16 +25,16 @@ import com.djrapitops.plan.delivery.webserver.WebServer; import com.djrapitops.plan.delivery.webserver.WebServerSystem; import com.djrapitops.plan.exceptions.EnableException; import com.djrapitops.plan.extension.ExtensionService; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.gathering.cache.CacheSystem; import com.djrapitops.plan.gathering.importing.ImportSystem; import com.djrapitops.plan.gathering.listeners.ListenerSystem; import com.djrapitops.plan.identification.Server; import com.djrapitops.plan.identification.ServerInfo; import com.djrapitops.plan.processing.Processing; -import com.djrapitops.plan.query.QueryServiceImplementation; +import com.djrapitops.plan.query.QuerySvc; import com.djrapitops.plan.settings.ConfigSystem; -import com.djrapitops.plan.settings.SettingsServiceImplementation; +import com.djrapitops.plan.settings.SettingsSvc; import com.djrapitops.plan.settings.locale.LocaleSystem; import com.djrapitops.plan.storage.database.DBSystem; import com.djrapitops.plan.storage.database.queries.objects.ServerQueries; @@ -77,9 +77,9 @@ public class PlanSystem implements SubSystem { private final ImportSystem importSystem; private final ExportSystem exportSystem; private final DeliveryUtilities deliveryUtilities; - private final ExtensionServiceImplementation extensionService; - private final QueryServiceImplementation queryService; - private final SettingsServiceImplementation settingsService; + private final ExtensionSvc extensionService; + private final QuerySvc queryService; + private final SettingsSvc settingsService; private final PluginLogger logger; private final Timings timings; private final ErrorHandler errorHandler; @@ -100,9 +100,9 @@ public class PlanSystem implements SubSystem { ImportSystem importSystem, ExportSystem exportSystem, DeliveryUtilities deliveryUtilities, - ExtensionServiceImplementation extensionService, - QueryServiceImplementation queryService, - SettingsServiceImplementation settingsService, + ExtensionSvc extensionService, + QuerySvc queryService, + SettingsSvc settingsService, PluginLogger logger, Timings timings, ErrorHandler errorHandler, @@ -151,7 +151,7 @@ public class PlanSystem implements SubSystem { @Override public void enable() throws EnableException { - CapabilityServiceImplementation.initialize(); + CapabilitySvc.initialize(); enableSystems( files, diff --git a/Plan/common/src/main/java/com/djrapitops/plan/capability/CapabilityServiceImplementation.java b/Plan/common/src/main/java/com/djrapitops/plan/capability/CapabilitySvc.java similarity index 77% rename from Plan/common/src/main/java/com/djrapitops/plan/capability/CapabilityServiceImplementation.java rename to Plan/common/src/main/java/com/djrapitops/plan/capability/CapabilitySvc.java index 6b37eda79..193a74453 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/capability/CapabilityServiceImplementation.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/capability/CapabilitySvc.java @@ -27,21 +27,20 @@ import java.util.function.Consumer; * * @author Rsl1122 */ -public class CapabilityServiceImplementation implements CapabilityService { +public class CapabilitySvc implements CapabilityService { private final List> enableListeners; - private CapabilityServiceImplementation() { - /* Inject required for dagger */ - CapabilityServiceHolder.set(this); + private CapabilitySvc() { + Holder.set(this); enableListeners = new ArrayList<>(); } - private static CapabilityServiceImplementation get() { - if (CapabilityServiceHolder.service == null) { - return new CapabilityServiceImplementation(); + private static CapabilitySvc get() { + if (Holder.service == null) { + return new CapabilitySvc(); } - return (CapabilityServiceImplementation) CapabilityServiceHolder.service; + return (CapabilitySvc) Holder.service; } public static void initialize() { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageClearCommand.java b/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageClearCommand.java index 12b7f8f43..02316c51b 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageClearCommand.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageClearCommand.java @@ -20,7 +20,7 @@ import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.exceptions.database.DBInitException; import com.djrapitops.plan.exceptions.database.DBOpException; import com.djrapitops.plan.processing.Processing; -import com.djrapitops.plan.query.QueryServiceImplementation; +import com.djrapitops.plan.query.QuerySvc; import com.djrapitops.plan.settings.Permissions; import com.djrapitops.plan.settings.locale.Locale; import com.djrapitops.plan.settings.locale.lang.CmdHelpLang; @@ -55,7 +55,7 @@ public class ManageClearCommand extends CommandNode { private final Locale locale; private final Processing processing; private final DBSystem dbSystem; - private final QueryServiceImplementation queryService; + private final QuerySvc queryService; private final ErrorHandler errorHandler; @Inject @@ -64,7 +64,7 @@ public class ManageClearCommand extends CommandNode { Locale locale, Processing processing, DBSystem dbSystem, - QueryServiceImplementation queryService, + QuerySvc queryService, ErrorHandler errorHandler ) { super("clear", Permissions.MANAGE.getPermission(), CommandType.PLAYER_OR_ARGS); diff --git a/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageRemoveCommand.java b/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageRemoveCommand.java index eba9aab16..5640e9a66 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageRemoveCommand.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/commands/subcommands/manage/ManageRemoveCommand.java @@ -19,7 +19,7 @@ package com.djrapitops.plan.commands.subcommands.manage; import com.djrapitops.plan.exceptions.database.DBOpException; import com.djrapitops.plan.identification.UUIDUtility; import com.djrapitops.plan.processing.Processing; -import com.djrapitops.plan.query.QueryServiceImplementation; +import com.djrapitops.plan.query.QuerySvc; import com.djrapitops.plan.settings.Permissions; import com.djrapitops.plan.settings.locale.Locale; import com.djrapitops.plan.settings.locale.lang.CmdHelpLang; @@ -56,7 +56,7 @@ public class ManageRemoveCommand extends CommandNode { private final Locale locale; private final Processing processing; private final DBSystem dbSystem; - private final QueryServiceImplementation queryService; + private final QuerySvc queryService; private final UUIDUtility uuidUtility; private final ErrorHandler errorHandler; @@ -65,7 +65,7 @@ public class ManageRemoveCommand extends CommandNode { Locale locale, Processing processing, DBSystem dbSystem, - QueryServiceImplementation queryService, + QuerySvc queryService, UUIDUtility uuidUtility, ErrorHandler errorHandler ) { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServerMethodCallerTask.java b/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServerMethodCallerTask.java index 3c48094cb..ea75f8779 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServerMethodCallerTask.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServerMethodCallerTask.java @@ -29,15 +29,15 @@ import javax.inject.Singleton; @Singleton public class ExtensionServerMethodCallerTask extends AbsRunnable { - private final ExtensionServiceImplementation extensionServiceImplementation; + private final ExtensionSvc service; @Inject - public ExtensionServerMethodCallerTask(ExtensionServiceImplementation extensionServiceImplementation) { - this.extensionServiceImplementation = extensionServiceImplementation; + public ExtensionServerMethodCallerTask(ExtensionSvc service) { + this.service = service; } @Override public void run() { - extensionServiceImplementation.updateServerValues(CallEvents.SERVER_PERIODICAL); + service.updateServerValues(CallEvents.SERVER_PERIODICAL); } } \ No newline at end of file diff --git a/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServiceImplementation.java b/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionSvc.java similarity index 98% rename from Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServiceImplementation.java rename to Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionSvc.java index 5e723040d..df28f6aec 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionServiceImplementation.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/extension/ExtensionSvc.java @@ -47,7 +47,7 @@ import java.util.UUID; * @author Rsl1122 */ @Singleton -public class ExtensionServiceImplementation implements ExtensionService { +public class ExtensionSvc implements ExtensionService { private final PlanConfig config; private final DBSystem dbSystem; @@ -60,7 +60,7 @@ public class ExtensionServiceImplementation implements ExtensionService { private final Map extensionGatherers; @Inject - public ExtensionServiceImplementation( + public ExtensionSvc( PlanConfig config, DBSystem dbSystem, ServerInfo serverInfo, @@ -79,7 +79,7 @@ public class ExtensionServiceImplementation implements ExtensionService { extensionGatherers = new HashMap<>(); - ExtensionService.ExtensionServiceHolder.set(this); + Holder.set(this); } public void register() { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/CallerImplementation.java b/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/CallerImplementation.java index 52fa9eca8..5bbd14303 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/CallerImplementation.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/CallerImplementation.java @@ -18,7 +18,7 @@ package com.djrapitops.plan.extension.implementation; import com.djrapitops.plan.extension.CallEvents; import com.djrapitops.plan.extension.Caller; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.extension.implementation.providers.gathering.ProviderValueGatherer; import com.djrapitops.plan.processing.Processing; @@ -32,12 +32,12 @@ import java.util.UUID; public class CallerImplementation implements Caller { private final ProviderValueGatherer gatherer; - private final ExtensionServiceImplementation extensionService; + private final ExtensionSvc extensionService; private final Processing processing; public CallerImplementation( ProviderValueGatherer gatherer, - ExtensionServiceImplementation extensionService, + ExtensionSvc extensionService, Processing processing ) { this.gatherer = gatherer; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/query/QueryServiceImplementation.java b/Plan/common/src/main/java/com/djrapitops/plan/query/QuerySvc.java similarity index 96% rename from Plan/common/src/main/java/com/djrapitops/plan/query/QueryServiceImplementation.java rename to Plan/common/src/main/java/com/djrapitops/plan/query/QuerySvc.java index fda500be4..2e5f0d0fc 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/query/QueryServiceImplementation.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/query/QuerySvc.java @@ -38,7 +38,7 @@ import java.util.concurrent.Future; import java.util.function.Consumer; @Singleton -public class QueryServiceImplementation implements QueryService { +public class QuerySvc implements QueryService { private final DBSystem dbSystem; private final ServerInfo serverInfo; @@ -49,7 +49,7 @@ public class QueryServiceImplementation implements QueryService { private final Set clearSubscribers; @Inject - public QueryServiceImplementation( + public QuerySvc( DBSystem dbSystem, ServerInfo serverInfo, PluginLogger logger, @@ -65,7 +65,7 @@ public class QueryServiceImplementation implements QueryService { } public void register() { - QueryService.QueryServiceHolder.set(this); + Holder.set(this); } @Override diff --git a/Plan/common/src/main/java/com/djrapitops/plan/settings/SettingsServiceImplementation.java b/Plan/common/src/main/java/com/djrapitops/plan/settings/SettingsSvc.java similarity index 96% rename from Plan/common/src/main/java/com/djrapitops/plan/settings/SettingsServiceImplementation.java rename to Plan/common/src/main/java/com/djrapitops/plan/settings/SettingsSvc.java index 3d7a2d291..e10581552 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/settings/SettingsServiceImplementation.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/settings/SettingsSvc.java @@ -34,13 +34,13 @@ import java.util.function.Supplier; * @author Rsl1122 */ @Singleton -public class SettingsServiceImplementation implements SettingsService { +public class SettingsSvc implements SettingsService { private final PlanConfig config; private final ErrorHandler errorHandler; @Inject - public SettingsServiceImplementation( + public SettingsSvc( PlanConfig config, ErrorHandler errorHandler ) { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/storage/upkeep/DBCleanTask.java b/Plan/common/src/main/java/com/djrapitops/plan/storage/upkeep/DBCleanTask.java index 3a164ad95..3e973e70a 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/storage/upkeep/DBCleanTask.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/storage/upkeep/DBCleanTask.java @@ -20,7 +20,7 @@ import com.djrapitops.plan.exceptions.database.DBOpException; import com.djrapitops.plan.extension.implementation.storage.transactions.results.RemoveUnsatisfiedConditionalPlayerResultsTransaction; import com.djrapitops.plan.extension.implementation.storage.transactions.results.RemoveUnsatisfiedConditionalServerResultsTransaction; import com.djrapitops.plan.identification.ServerInfo; -import com.djrapitops.plan.query.QueryServiceImplementation; +import com.djrapitops.plan.query.QuerySvc; import com.djrapitops.plan.settings.config.PlanConfig; import com.djrapitops.plan.settings.config.paths.TimeSettings; import com.djrapitops.plan.settings.locale.Locale; @@ -61,7 +61,7 @@ public class DBCleanTask extends AbsRunnable { private final Locale locale; private final DBSystem dbSystem; private final PlanConfig config; - private final QueryServiceImplementation queryService; + private final QuerySvc queryService; private final ServerInfo serverInfo; private final PluginLogger logger; private final ErrorHandler errorHandler; @@ -75,7 +75,7 @@ public class DBCleanTask extends AbsRunnable { PlanConfig config, Locale locale, DBSystem dbSystem, - QueryServiceImplementation queryService, + QuerySvc queryService, ServerInfo serverInfo, PluginLogger logger, ErrorHandler errorHandler diff --git a/Plan/common/src/test/java/com/djrapitops/plan/storage/database/DatabaseTest.java b/Plan/common/src/test/java/com/djrapitops/plan/storage/database/DatabaseTest.java index 99d9710bd..900b0cb4b 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/storage/database/DatabaseTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/storage/database/DatabaseTest.java @@ -33,7 +33,7 @@ import com.djrapitops.plan.delivery.domain.mutators.SessionsMutator; import com.djrapitops.plan.extension.CallEvents; import com.djrapitops.plan.extension.DataExtension; import com.djrapitops.plan.extension.ExtensionService; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.extension.annotation.*; import com.djrapitops.plan.extension.icon.Color; import com.djrapitops.plan.extension.icon.Icon; @@ -46,7 +46,7 @@ import com.djrapitops.plan.extension.implementation.storage.transactions.results import com.djrapitops.plan.extension.table.Table; import com.djrapitops.plan.gathering.domain.*; import com.djrapitops.plan.identification.Server; -import com.djrapitops.plan.query.QueryServiceImplementation; +import com.djrapitops.plan.query.QuerySvc; import com.djrapitops.plan.settings.config.Config; import com.djrapitops.plan.settings.config.PlanConfig; import com.djrapitops.plan.settings.locale.Locale; @@ -546,7 +546,7 @@ public interface DatabaseTest { system().getConfigSystem().getConfig(), new Locale(), system().getDatabaseSystem(), - new QueryServiceImplementation(system().getDatabaseSystem(), system().getServerInfo(), logger, errorHandler), + new QuerySvc(system().getDatabaseSystem(), system().getServerInfo(), logger, errorHandler), system().getServerInfo(), logger, errorHandler @@ -1225,7 +1225,7 @@ public interface DatabaseTest { @Test default void extensionPlayerValuesAreStored() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); extensionService.register(new PlayerExtension()); extensionService.updatePlayerValues(playerUUID, TestConstants.PLAYER_ONE_NAME, CallEvents.MANUAL); @@ -1275,7 +1275,7 @@ public interface DatabaseTest { @Test default void extensionServerValuesAreStored() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); extensionService.register(new ServerExtension()); extensionService.updateServerValues(CallEvents.SERVER_EXTENSION_REGISTER); @@ -1297,7 +1297,7 @@ public interface DatabaseTest { @Test default void extensionServerAggregateQueriesWork() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); extensionService.register(new PlayerExtension()); extensionService.updatePlayerValues(playerUUID, TestConstants.PLAYER_ONE_NAME, CallEvents.MANUAL); @@ -1327,7 +1327,7 @@ public interface DatabaseTest { @Test default void unsatisfiedPlayerConditionalResultsAreCleaned() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); extensionService.register(new ConditionalExtension()); @@ -1381,7 +1381,7 @@ public interface DatabaseTest { @Test default void unsatisfiedServerConditionalResultsAreCleaned() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); ConditionalExtension.condition = true; extensionService.register(new ConditionalExtension()); @@ -1432,7 +1432,7 @@ public interface DatabaseTest { @Test default void extensionServerTableValuesAreInserted() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); extensionService.register(new TableExtension()); extensionService.updateServerValues(CallEvents.MANUAL); @@ -1463,7 +1463,7 @@ public interface DatabaseTest { @Test default void extensionPlayerTableValuesAreInserted() { - ExtensionServiceImplementation extensionService = (ExtensionServiceImplementation) system().getExtensionService(); + ExtensionSvc extensionService = (ExtensionSvc) system().getExtensionService(); extensionService.register(new TableExtension()); extensionService.updatePlayerValues(playerUUID, TestConstants.PLAYER_ONE_NAME, CallEvents.MANUAL); diff --git a/Plan/nukkit/src/main/java/com/djrapitops/plan/gathering/listeners/nukkit/PlayerOnlineListener.java b/Plan/nukkit/src/main/java/com/djrapitops/plan/gathering/listeners/nukkit/PlayerOnlineListener.java index 5df23a13c..6a3ece683 100644 --- a/Plan/nukkit/src/main/java/com/djrapitops/plan/gathering/listeners/nukkit/PlayerOnlineListener.java +++ b/Plan/nukkit/src/main/java/com/djrapitops/plan/gathering/listeners/nukkit/PlayerOnlineListener.java @@ -30,7 +30,7 @@ import com.djrapitops.plan.delivery.export.Exporter; import com.djrapitops.plan.delivery.webserver.cache.DataID; import com.djrapitops.plan.delivery.webserver.cache.JSONCache; import com.djrapitops.plan.extension.CallEvents; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.gathering.cache.NicknameCache; import com.djrapitops.plan.gathering.cache.SessionCache; import com.djrapitops.plan.gathering.domain.GMTimes; @@ -63,7 +63,7 @@ public class PlayerOnlineListener implements Listener { private final Processing processing; private final ServerInfo serverInfo; private final DBSystem dbSystem; - private final ExtensionServiceImplementation extensionService; + private final ExtensionSvc extensionService; private final Exporter exporter; private final GeolocationCache geolocationCache; private final NicknameCache nicknameCache; @@ -77,7 +77,7 @@ public class PlayerOnlineListener implements Listener { Processing processing, ServerInfo serverInfo, DBSystem dbSystem, - ExtensionServiceImplementation extensionService, + ExtensionSvc extensionService, Exporter exporter, GeolocationCache geolocationCache, NicknameCache nicknameCache, diff --git a/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/SpongeListenerSystem.java b/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/SpongeListenerSystem.java index 1bcd2a6b2..03d8714fb 100644 --- a/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/SpongeListenerSystem.java +++ b/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/SpongeListenerSystem.java @@ -20,7 +20,7 @@ import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.PlanSponge; import com.djrapitops.plan.SpongeServerShutdownSave; import com.djrapitops.plan.api.events.PlanSpongeEnableEvent; -import com.djrapitops.plan.capability.CapabilityServiceImplementation; +import com.djrapitops.plan.capability.CapabilitySvc; import com.djrapitops.plan.gathering.listeners.sponge.*; import org.spongepowered.api.Sponge; import org.spongepowered.api.event.Event; @@ -91,6 +91,6 @@ public class SpongeListenerSystem extends ListenerSystem { } catch (IllegalStateException ignore) { /* Ignore, Sponge is not initialized */ } - CapabilityServiceImplementation.notifyAboutEnable(plugin.isSystemEnabled()); + CapabilitySvc.notifyAboutEnable(plugin.isSystemEnabled()); } } diff --git a/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/sponge/PlayerOnlineListener.java b/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/sponge/PlayerOnlineListener.java index eb11e8bde..03dd4c3b1 100644 --- a/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/sponge/PlayerOnlineListener.java +++ b/Plan/sponge/src/main/java/com/djrapitops/plan/gathering/listeners/sponge/PlayerOnlineListener.java @@ -22,7 +22,7 @@ import com.djrapitops.plan.delivery.export.Exporter; import com.djrapitops.plan.delivery.webserver.cache.DataID; import com.djrapitops.plan.delivery.webserver.cache.JSONCache; import com.djrapitops.plan.extension.CallEvents; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.gathering.cache.NicknameCache; import com.djrapitops.plan.gathering.cache.SessionCache; import com.djrapitops.plan.gathering.domain.Session; @@ -66,7 +66,7 @@ public class PlayerOnlineListener { private final Processing processing; private final ServerInfo serverInfo; private final DBSystem dbSystem; - private final ExtensionServiceImplementation extensionService; + private final ExtensionSvc extensionService; private final Exporter exporter; private final GeolocationCache geolocationCache; private final NicknameCache nicknameCache; @@ -80,7 +80,7 @@ public class PlayerOnlineListener { Processing processing, ServerInfo serverInfo, DBSystem dbSystem, - ExtensionServiceImplementation extensionService, + ExtensionSvc extensionService, Exporter exporter, GeolocationCache geolocationCache, NicknameCache nicknameCache, SessionCache sessionCache, diff --git a/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/VelocityListenerSystem.java b/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/VelocityListenerSystem.java index 9126e2ea0..a92fba838 100644 --- a/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/VelocityListenerSystem.java +++ b/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/VelocityListenerSystem.java @@ -19,7 +19,7 @@ package com.djrapitops.plan.gathering.listeners; import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.PlanVelocity; import com.djrapitops.plan.api.events.PlanVelocityEnableEvent; -import com.djrapitops.plan.capability.CapabilityServiceImplementation; +import com.djrapitops.plan.capability.CapabilitySvc; import com.djrapitops.plan.gathering.listeners.velocity.PlayerOnlineListener; import javax.inject.Inject; @@ -56,6 +56,6 @@ public class VelocityListenerSystem extends ListenerSystem { boolean isEnabled = plugin.isSystemEnabled(); PlanVelocityEnableEvent event = new PlanVelocityEnableEvent(isEnabled); ((PlanVelocity) plugin).getProxy().getEventManager().fireAndForget(event); - CapabilityServiceImplementation.notifyAboutEnable(isEnabled); + CapabilitySvc.notifyAboutEnable(isEnabled); } } diff --git a/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/velocity/PlayerOnlineListener.java b/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/velocity/PlayerOnlineListener.java index b05f01e9a..eb5239caf 100644 --- a/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/velocity/PlayerOnlineListener.java +++ b/Plan/velocity/src/main/java/com/djrapitops/plan/gathering/listeners/velocity/PlayerOnlineListener.java @@ -21,7 +21,7 @@ import com.djrapitops.plan.delivery.export.Exporter; import com.djrapitops.plan.delivery.webserver.cache.DataID; import com.djrapitops.plan.delivery.webserver.cache.JSONCache; import com.djrapitops.plan.extension.CallEvents; -import com.djrapitops.plan.extension.ExtensionServiceImplementation; +import com.djrapitops.plan.extension.ExtensionSvc; import com.djrapitops.plan.gathering.cache.SessionCache; import com.djrapitops.plan.gathering.domain.Session; import com.djrapitops.plan.gathering.geolocation.GeolocationCache; @@ -61,7 +61,7 @@ public class PlayerOnlineListener { private final PlanConfig config; private final Processing processing; private final DBSystem dbSystem; - private final ExtensionServiceImplementation extensionService; + private final ExtensionSvc extensionService; private final Exporter exporter; private final GeolocationCache geolocationCache; private final SessionCache sessionCache; @@ -73,7 +73,7 @@ public class PlayerOnlineListener { PlanConfig config, Processing processing, DBSystem dbSystem, - ExtensionServiceImplementation extensionService, + ExtensionSvc extensionService, Exporter exporter, GeolocationCache geolocationCache, SessionCache sessionCache, ServerInfo serverInfo,