Package ca.stellardrift.permissionsex
Interface PermissionsEngineBuilder<C>
-
- Type Parameters:
C- The type of an extra platform-specific configuration that will be injected into the engine configuration
public interface PermissionsEngineBuilder<C>
A builder for creating permissions engines.- Since:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePermissionsEngineBuilder.FactoryA service interface for creating new engine builders.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PermissionsEngineBuilder<C>asyncExecutor(Executor executor)Set an executor to use to execute asynchronous tasks.PermissionsEngineBuilder<C>baseDirectory(Path baseDir)Set the base directory for this engine instance.PermissionsEnginebuild()Create a full engine.Map.Entry<PermissionsEngine,Supplier<C>>buildWithConfig()Create a full engine, and return it with a supplier for the implementation configurationPermissionsEngineBuilder<C>configuration(Path configFile)Set the file that this engine will load its configuration from.PermissionsEngineBuilder<C>databaseProvider(org.spongepowered.configurate.util.CheckedFunction<String,@Nullable DataSource,SQLException> databaseProvider)Set a callback function that will be queried to provide database for a url.PermissionsEngineBuilder<C>logger(org.slf4j.Logger logger)Set a logger that will receive messages logged by the engine.
-
-
-
Method Detail
-
configuration
PermissionsEngineBuilder<C> configuration(Path configFile)
Set the file that this engine will load its configuration from.- Parameters:
configFile- The configuration file.- Returns:
- this builder
- Since:
- 2.0.0
-
baseDirectory
PermissionsEngineBuilder<C> baseDirectory(Path baseDir)
Set the base directory for this engine instance.- Parameters:
baseDir- the base directory- Returns:
- this builder
- Since:
- 2.0.0
-
logger
PermissionsEngineBuilder<C> logger(org.slf4j.Logger logger)
Set a logger that will receive messages logged by the engine.By default, this will be a logger named
PermissionsEx- Parameters:
logger- the logger to log to- Returns:
- this builder
- Since:
- 2.0.0
-
asyncExecutor
PermissionsEngineBuilder<C> asyncExecutor(Executor executor)
Set an executor to use to execute asynchronous tasks.By default, the
ForkJoinPool.commonPool()will be used.- Parameters:
executor- The executor- Returns:
- this builder
- Since:
- 2.0.0
-
databaseProvider
PermissionsEngineBuilder<C> databaseProvider(org.spongepowered.configurate.util.CheckedFunction<String,@Nullable DataSource,SQLException> databaseProvider)
Set a callback function that will be queried to provide database for a url.Implementations may allow this url to be an alias to an existing connection definition, rather than an actual URL.
- Parameters:
databaseProvider- The database provider- Returns:
- this builder
- Since:
- 2.0.0
-
build
PermissionsEngine build() throws PermissionsLoadingException
Create a full engine.- Returns:
- the built engine
- Throws:
PermissionsLoadingException- if any errors occur while loading the engine or its configuration- Since:
- 2.0.0
-
buildWithConfig
Map.Entry<PermissionsEngine,Supplier<C>> buildWithConfig() throws PermissionsLoadingException
Create a full engine, and return it with a supplier for the implementation configuration- Returns:
- the built engine
- Throws:
PermissionsLoadingException- if any errors occur while loading the engine or its configuration- Since:
- 2.0.0
-
-