-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
402 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/voruti/velocityplayerlistquery/model/exception/InvalidServerPingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package voruti.velocityplayerlistquery.model.exception; | ||
|
||
import lombok.experimental.StandardException; | ||
|
||
@StandardException | ||
public class InvalidServerPingException extends IllegalStateException { | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/voruti/velocityplayerlistquery/service/ConfigService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package voruti.velocityplayerlistquery.service; | ||
|
||
import com.google.inject.Inject; | ||
import lombok.AccessLevel; | ||
import lombok.NonNull; | ||
import lombok.experimental.FieldDefaults; | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
import org.slf4j.Logger; | ||
import voruti.velocityplayerlistquery.model.Config; | ||
|
||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
@FieldDefaults(level = AccessLevel.PRIVATE) | ||
public class ConfigService { | ||
|
||
@Inject | ||
Logger logger; | ||
|
||
@Inject | ||
PersistenceService persistenceService; | ||
|
||
@Nullable | ||
Config cachedConfig; | ||
|
||
|
||
@NonNull | ||
public Config getConfig() { | ||
if (this.cachedConfig == null) { | ||
this.reloadConfig(); | ||
} | ||
|
||
return this.cachedConfig; | ||
} | ||
|
||
public void reloadConfig() { | ||
logger.trace("Loading config from persistence service..."); | ||
|
||
this.cachedConfig = this.persistenceService.loadConfig(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 15 additions & 11 deletions
26
...istquery/util/ServerListEntryBuilder.java → ...ervice/ServerListEntryBuilderService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.