C - Base Component type for this manager.
Must be implemented by all components in this modulepublic interface Manager<C extends Component<?,?>>
A module consists of a Manager and a (single) Component
for every data storage implementation.
The Manager of a module is its metaphorical gateway. Interactions with
other modules should (almost always) be done through the Manager.
There are, however, some cases where direct access to a component is required.
One such case is inter-Repository access that requires compile time
type safety. Because the Component.getTKeyClass() type is not known
to the manager, code that interacts with TKey must be placed in a
Component.
One of the primary functions of a Manager is to provide the correct
Component implementation via getPrimaryComponent().
Implementations of Manager should consist of methods similar to the
following:
CompletableFuture<TString> create(UUID userUUID);CompletableFuture<TString> invite(UUID userUUID, UUID targetUserUUID);CompletableFuture<TString> kick(UUID userUUID, UUID targetUserUUID);CompletableFuture<List<TString>> list(String query);
TString is the base return type for the methods in a Manager.
To build these results use TextService.Builder.
All methods (with some exceptions) in Manager should return a form of TString
to be displayed directly to the end user. Normally, the return type, TString, is wrapped in
a CompletableFuture in order to keep the main game thread
free from IO. It is sometimes necessary to further wrap the TString in a List
when the result is more than a single line. In this case, pagination can be used to display the result
to the end user.
The following interface signature is an example of a simple Manager:
public interface FooManager<
TFoo extends Foo<?>,
TString>
extends Manager<FooRepository<?, TFoo, ?, ?>>
Repository,
Component,
TextService| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDefaultIdentifierPluralLower()
Represents the default plural identifier for this module
|
java.lang.String |
getDefaultIdentifierPluralUpper()
Represents the default plural identifier for this module
|
java.lang.String |
getDefaultIdentifierSingularLower()
Represents the default singular identifier for this module
|
java.lang.String |
getDefaultIdentifierSingularUpper()
Represents the default singular identifier for this module
|
C |
getPrimaryComponent()
|
java.lang.String getDefaultIdentifierSingularUpper()
Represents the default singular identifier for this module
Should be overridden by other plugins who change the name of the object. Examples: "Clan", "Faction", "Guild", "Member", ... etc
Used in text sent to the player
java.lang.String getDefaultIdentifierPluralUpper()
Represents the default plural identifier for this module
Should be overridden by other plugins who change the name of party. Examples: "Clans", "Factions", "Guilds", "Members" ... etc
Used in text sent to the player
java.lang.String getDefaultIdentifierSingularLower()
Represents the default singular identifier for this module
Should be overridden by other plugins who change the name of party. Examples: "clan", "faction", "guild", "member" ... etc
Used in text sent to the player
java.lang.String getDefaultIdentifierPluralLower()
Represents the default plural identifier for this module
Should be overridden by other plugins who change the name of party. Examples: "clans", "factions", "guilds", "members" ... etc
Used in text sent to the player
C getPrimaryComponent()
Component as defined by
Keys.DATA_STORE_NAME in the current Registry.
The current Component implementation is defined as the
implementation provided by Guice that meets the following criteria:
The value for Keys.DATA_STORE_NAME found by
the the current Registry must match (ignored case) a registered
datastore implementation. This can be one of the following predefined values:
"mongodb""xodus"or a custom value defined by your guice module.
For example, 'mongodb' (or any capitalization thereof) will match
a Component annotated with Named(value = "mongodb"
Use BindingExtensions to bind your component implementations
Component implementationjava.lang.IllegalStateException - If the config has not been loaded yet,
or if no implementation was foundComponent,
BindingExtensions