Skip to content

Refactor executeQuery() to use Action pattern #221

@rrobetti

Description

@rrobetti

SummarynnRefactor the executeQuery() method in StatementServiceImpl to follow the Action pattern, extracting the logic into a dedicated ExecuteQueryAction class.nn## ContextnnAs part of the ongoing refactoring of StatementServiceImpl (a 2,528-line God class), we're extracting each public method into focused Action classes. The connect() method has been implemented as a reference (see PR #XXX).nn## TasknnExtract the executeQuery() method logic into ExecuteQueryAction:nnCurrent code location: StatementServiceImpl.executeQuery() (line ~890)nnTarget: Create org.openjproxy.grpc.server.action.statement.ExecuteQueryActionnn## Implementation Stepsnn1. Create ExecuteQueryAction class implementing Action<StatementRequest, OpResult>n2. Extract logic from StatementServiceImpl.executeQuery() into the actionn3. Consider creating ExecuteQueryInternalAction for internal logic reusen4. Handle ResultSet processing logicn5. Update method to use context.getSessionManager() and other shared staten6. Update StatementServiceImpl.executeQuery() to delegate:n javan public void executeQuery(StatementRequest request, StreamObserver<OpResult> responseObserver) {n new ExecuteQueryAction(actionContext).execute(request, responseObserver);n }n n7. Compile and testnn## ComplexitynnMedium - Estimated 100-120 lines. Statement preparation, parameter binding, execution, ResultSet processing.nn## Referencenn- Migration Guide: STATEMENTSERVICE_ACTION_PATTERN_MIGRATION.mdn- Reference Implementation: PR #XXX (connect method)n- Package: org.openjproxy.grpc.server.action.statementnn## Acceptance Criteriann- [ ] ExecuteQueryAction class createdn- [ ] Logic extracted from StatementServiceImpln- [ ] Helper action created if needed (ExecuteQueryInternalAction)n- [ ] ResultSet processing handledn- [ ] StatementServiceImpl.executeQuery() delegates to actionn- [ ] Code compiles successfullyn- [ ] Existing tests passn- [ ] No functional changes (pure refactoring)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions