-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move server info into result summary #272
Conversation
7de9ef9
to
be8b568
Compare
Replaced session.server with resultSummary.server.version Replaced session.address with resultSummary.server.address
be8b568
to
efdf8bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhenlineo made couple small comments.
this.socket = socket; | ||
this.logger = logger; | ||
|
||
if( logger.isDebugEnabled() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe extract this if-else
in a method like createResponseHandler(Logger)
, otherwise it is duplicated in both constructors.
queueMessage( new InitMessage( clientName, authToken ), initCollector ); | ||
sync(); | ||
this.serverInfo = new InternalServerInfo( socket.address(), initCollector.server() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InternalServerInfo
constructor's second arg is called String version
but here we pass initCollector.server()
for it. This is a bit confusing. Maybe InitCollector#server()
can be renamed to #serverVersion()
?
|
||
public class InternalServerInfo implements ServerInfo | ||
{ | ||
private BoltServerAddress address; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fields can be final
|
||
/** | ||
* Returns a string telling which version of the server the query was executed. | ||
* @return The server version of <code>null</code> if not available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for the version
to not be available while address
is available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible. The version is not supported before server 3.1. I will add a line in the doc
System.out.println( session.server() ); | ||
assumeTrue( ServerVersion.version( session.server() ).greaterThanOrEqual( v3_1_0 ) ); | ||
String version = session.run( "RETURN 1" ).consume().server().version(); | ||
System.out.println( version ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This println can probably be removed.
Replaced session.server with resultSummary.server.version
Replaced session.address with resultSummary.server.address