Class SqlDataStore
- java.lang.Object
-
- ca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
- ca.stellardrift.permissionsex.datastore.sql.SqlDataStore
-
- All Implemented Interfaces:
ca.stellardrift.permissionsex.datastore.DataStore
public final class SqlDataStore extends ca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
DataSource for SQL data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSqlDataStore.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Stream<Map.Entry<ca.stellardrift.permissionsex.subject.SubjectRef<?>,ca.stellardrift.permissionsex.subject.ImmutableSubjectData>>getAll()Stream<String>getAllIdentifiers(String type)Stream<String>getAllRankLadders()CompletableFuture<ca.stellardrift.permissionsex.context.ContextInheritance>getContextInheritanceInternal()protected CompletableFuture<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>getDataInternal(String type, String identifier)CompletableFuture<Set<String>>getDefinedContextKeys()protected CompletableFuture<ca.stellardrift.permissionsex.rank.RankLadder>getRankLadderInternal(String ladder)Set<String>getRegisteredTypes()StringgetTableName(String raw)StringgetTableName(String raw, boolean legacyOnly)CompletableFuture<Boolean>hasRankLadder(String ladder)voidinitializeTables()CompletableFuture<Boolean>isRegistered(String type, String identifier)protected voidload()protected <T> TperformBulkOperationSync(Function<ca.stellardrift.permissionsex.datastore.DataStore,T> function)voidsetAutoInitialize(boolean autoInitialize)voidsetConnectionUrl(String connectionUrl)CompletableFuture<ca.stellardrift.permissionsex.context.ContextInheritance>setContextInheritanceInternal(ca.stellardrift.permissionsex.context.ContextInheritance inheritance)protected CompletableFuture<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>setDataInternal(String type, String identifier, ca.stellardrift.permissionsex.subject.ImmutableSubjectData data)voidsetPrefix(String prefix)protected CompletableFuture<ca.stellardrift.permissionsex.rank.RankLadder>setRankLadderInternal(String ladder, @Nullable ca.stellardrift.permissionsex.rank.RankLadder newLadder)-
Methods inherited from class ca.stellardrift.permissionsex.impl.backend.AbstractDataStore
applyDefaultData, config, context, engine, firstRun, getAll, getContextInheritance, getData, getRankLadder, markFirstRun, moveData, name, performBulkOperation, runAsync, runAsync, setContextInheritance, setData, setRankLadder
-
-
-
-
Method Detail
-
load
protected void load() throws ca.stellardrift.permissionsex.exception.PermissionsLoadingException
- Specified by:
loadin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>- Throws:
ca.stellardrift.permissionsex.exception.PermissionsLoadingException
-
initializeTables
public void initializeTables() throws SQLException
- Throws:
SQLException
-
setConnectionUrl
public void setConnectionUrl(String connectionUrl)
-
getTableName
public String getTableName(String raw)
-
getTableName
public String getTableName(String raw, boolean legacyOnly)
-
getDataInternal
protected CompletableFuture<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> getDataInternal(String type, String identifier)
- Specified by:
getDataInternalin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
setDataInternal
protected CompletableFuture<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> setDataInternal(String type, String identifier, ca.stellardrift.permissionsex.subject.ImmutableSubjectData data)
- Specified by:
setDataInternalin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
isRegistered
public CompletableFuture<Boolean> isRegistered(String type, String identifier)
-
getAllIdentifiers
public Stream<String> getAllIdentifiers(String type)
-
getRegisteredTypes
public Set<String> getRegisteredTypes()
-
getDefinedContextKeys
public CompletableFuture<Set<String>> getDefinedContextKeys()
-
getAll
public Stream<Map.Entry<ca.stellardrift.permissionsex.subject.SubjectRef<?>,ca.stellardrift.permissionsex.subject.ImmutableSubjectData>> getAll()
-
getRankLadderInternal
protected CompletableFuture<ca.stellardrift.permissionsex.rank.RankLadder> getRankLadderInternal(String ladder)
- Specified by:
getRankLadderInternalin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
setRankLadderInternal
protected CompletableFuture<ca.stellardrift.permissionsex.rank.RankLadder> setRankLadderInternal(String ladder, @Nullable ca.stellardrift.permissionsex.rank.RankLadder newLadder)
- Specified by:
setRankLadderInternalin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
getAllRankLadders
public Stream<String> getAllRankLadders()
-
hasRankLadder
public CompletableFuture<Boolean> hasRankLadder(String ladder)
-
getContextInheritanceInternal
public CompletableFuture<ca.stellardrift.permissionsex.context.ContextInheritance> getContextInheritanceInternal()
- Specified by:
getContextInheritanceInternalin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
setContextInheritanceInternal
public CompletableFuture<ca.stellardrift.permissionsex.context.ContextInheritance> setContextInheritanceInternal(ca.stellardrift.permissionsex.context.ContextInheritance inheritance)
- Specified by:
setContextInheritanceInternalin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>
-
performBulkOperationSync
protected <T> T performBulkOperationSync(Function<ca.stellardrift.permissionsex.datastore.DataStore,T> function) throws Exception
- Specified by:
performBulkOperationSyncin classca.stellardrift.permissionsex.impl.backend.AbstractDataStore<SqlDataStore,ca.stellardrift.permissionsex.datastore.sql.SqlDataStore.Config>- Throws:
Exception
-
close
public void close()
-
setAutoInitialize
public void setAutoInitialize(boolean autoInitialize)
-
-