Skip to content

Commit

Permalink
change requestScheme to protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenag committed Mar 2, 2017
1 parent 937d653 commit 56f6676
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Expand Up @@ -56,7 +56,7 @@ public String asConnectionDetails()
}

@Override
public String requestScheme()
public String protocol()
{
return "bolt";
}
Expand Down
Expand Up @@ -52,7 +52,7 @@ public ClientConnectionInfo withUsername( String username )
*
* @return the scheme used for connecting to the server, or {@code null} if no scheme is available.
*/
public String requestScheme()
public String protocol()
{
return null;
}
Expand Down Expand Up @@ -108,9 +108,9 @@ public String asConnectionDetails()
}

@Override
public String requestScheme()
public String protocol()
{
return source.requestScheme();
return source.protocol();
}

@Override
Expand Down
Expand Up @@ -26,19 +26,19 @@
*/
public class HttpConnectionInfo extends ClientConnectionInfo
{
private final String scheme;
private final String protocol;
private final InetSocketAddress clientAddress;
private final InetSocketAddress serverAddress;
private final String requestPath;

public HttpConnectionInfo(
String scheme,
String protocol,
@SuppressWarnings( "unused" ) String userAgent, // useful for achieving parity with BoltConnectionInfo
InetSocketAddress clientAddress,
InetSocketAddress serverAddress,
String requestPath )
{
this.scheme = scheme;
this.protocol = protocol;
this.clientAddress = clientAddress;
this.serverAddress = serverAddress;
this.requestPath = requestPath;
Expand All @@ -47,13 +47,13 @@ public HttpConnectionInfo(
@Override
public String asConnectionDetails()
{
return String.join( "\t", "server-session", scheme, clientAddress.getHostString(), requestPath );
return String.join( "\t", "server-session", protocol, clientAddress.getHostString(), requestPath );
}

@Override
public String requestScheme()
public String protocol()
{
return scheme;
return protocol;
}

@Override
Expand All @@ -67,7 +67,7 @@ public String requestURI()
{
return serverAddress == null ? requestPath : String.format(
"%s://%s:%d%s",
scheme,
protocol,
serverAddress.getHostString(),
serverAddress.getPort(),
requestPath );
Expand Down
Expand Up @@ -56,7 +56,7 @@ public class QueryStatusResult
@Deprecated
public final String connectionDetails;
/** @since Neo4j 3.2 */
public final String requestScheme;
public final String protocol;
/** @since Neo4j 3.2 */
public final String clientAddress;
/** @since Neo4j 3.2 */
Expand Down Expand Up @@ -92,7 +92,7 @@ private QueryStatusResult( QuerySnapshot query ) throws InvalidArgumentsExceptio
this.elapsedTime = formatInterval( elapsedTimeMillis );
ClientConnectionInfo clientConnection = query.clientConnection();
this.connectionDetails = clientConnection.asConnectionDetails();
this.requestScheme = clientConnection.requestScheme();
this.protocol = clientConnection.protocol();
this.clientAddress = clientConnection.clientAddress();
this.requestUri = clientConnection.requestURI();
this.metaData = query.transactionAnnotationData();
Expand Down
Expand Up @@ -212,7 +212,7 @@ public void shouldContainSpecificConnectionDetails() throws Exception
Map<String,Object> data = getQueryListing( "CALL dbms.listQueries" );

// then
assertThat( data, hasKey( "requestScheme" ) );
assertThat( data, hasKey( "protocol" ) );
assertThat( data, hasKey( "clientAddress" ) );
assertThat( data, hasKey( "requestUri" ) );
}
Expand Down

0 comments on commit 56f6676

Please sign in to comment.