Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use ReadConcernAwareNoOpSessionContext instead of NoOpSessionContext
  • Loading branch information
stIncMale committed May 28, 2025
commit df84c84925d536154cc9650d613c66f8bc1e690d
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,18 @@ abstract void authenticateAsync(InternalConnection connection, ConnectionDescrip
OperationContext operationContext, SingleResultCallback<Void> callback);

public void reauthenticate(final InternalConnection connection, final OperationContext operationContext) {
authenticate(connection, connection.getDescription(), operationContext.withSessionContext(NoOpSessionContext.INSTANCE));
authenticate(connection, connection.getDescription(), operationContextWithoutSession(operationContext));
}

public void reauthenticateAsync(final InternalConnection connection, final OperationContext operationContext,
final SingleResultCallback<Void> callback) {
beginAsync().thenRun((c) -> {
authenticateAsync(connection, connection.getDescription(), operationContext.withSessionContext(NoOpSessionContext.INSTANCE), c);
authenticateAsync(connection, connection.getDescription(), operationContextWithoutSession(operationContext), c);
}).finish(callback);
}

private static OperationContext operationContextWithoutSession(final OperationContext operationContext) {
return operationContext.withSessionContext(
new ReadConcernAwareNoOpSessionContext(operationContext.getSessionContext().getReadConcern()));
}
}