Package dev.frostlake.executor.commands
Class GrantRevokeHandler
java.lang.Object
dev.frostlake.executor.commands.GrantRevokeHandler
- All Implemented Interfaces:
CommandHandler
Handles
GRANT … and REVOKE … statements, extracted verbatim from
SQLCommandVisitor.visitGrantStatement(dev.frostlake.parser.FrostlakeParser.GrantStatementContext) and SQLCommandVisitor.visitRevokeStatement(dev.frostlake.parser.FrostlakeParser.RevokeStatementContext).
The visitSecurityStatement router stays on the visitor and dispatches into
handleGrant(dev.frostlake.parser.FrostlakeParser.GrantStatementContext) / handleRevoke(dev.frostlake.parser.FrostlakeParser.RevokeStatementContext). Catalog mutations run against the injected
Catalog; grant-authority checks go through queryExecutor.getSecurityManager();
parse-text extraction (getText) is reached through the visitor back-reference so
its exact original behavior is preserved. The private privilegeName(org.antlr.v4.runtime.ParserRuleContext) helper moved along
with the two statement bodies (it was used only by them).-
Constructor Summary
ConstructorsConstructorDescriptionGrantRevokeHandler(Catalog catalog, QueryExecutor queryExecutor, SQLCommandVisitor visitor) -
Method Summary
Modifier and TypeMethodDescriptionGet catalog instanceGet query executor instanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.frostlake.executor.commands.CommandHandler
extractComment, extractComment, getText, getText, qualifiedNameParts
-
Constructor Details
-
GrantRevokeHandler
-
-
Method Details
-
getCatalog
Description copied from interface:CommandHandlerGet catalog instance- Specified by:
getCatalogin interfaceCommandHandler- Returns:
- the engine's metastore catalog, holding the objects this handler reads and mutates
-
getQueryExecutor
Description copied from interface:CommandHandlerGet query executor instance- Specified by:
getQueryExecutorin interfaceCommandHandler- Returns:
- the engine's query executor, for handlers that run nested queries or need session state
-
handleGrant
-
handleRevoke
-