-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass access mode as part of statement metadata
- Loading branch information
Showing
26 changed files
with
769 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
driver/src/main/java/org/neo4j/driver/internal/async/AccessModeConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/* | ||
* Copyright (c) 2002-2019 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.neo4j.driver.internal.async; | ||
|
||
import java.util.concurrent.CompletionStage; | ||
|
||
import org.neo4j.driver.internal.BoltServerAddress; | ||
import org.neo4j.driver.internal.messaging.BoltProtocol; | ||
import org.neo4j.driver.internal.messaging.Message; | ||
import org.neo4j.driver.internal.spi.Connection; | ||
import org.neo4j.driver.internal.spi.ResponseHandler; | ||
import org.neo4j.driver.internal.util.ServerVersion; | ||
import org.neo4j.driver.v1.AccessMode; | ||
|
||
public class AccessModeConnection implements Connection | ||
{ | ||
private final Connection delegate; | ||
private final AccessMode mode; | ||
|
||
public AccessModeConnection( Connection delegate, AccessMode mode ) | ||
{ | ||
this.delegate = delegate; | ||
this.mode = mode; | ||
} | ||
|
||
public Connection connection() | ||
{ | ||
return delegate; | ||
} | ||
|
||
@Override | ||
public boolean isOpen() | ||
{ | ||
return delegate.isOpen(); | ||
} | ||
|
||
@Override | ||
public void enableAutoRead() | ||
{ | ||
delegate.enableAutoRead(); | ||
} | ||
|
||
@Override | ||
public void disableAutoRead() | ||
{ | ||
delegate.disableAutoRead(); | ||
} | ||
|
||
@Override | ||
public void write( Message message, ResponseHandler handler ) | ||
{ | ||
delegate.write( message, handler ); | ||
} | ||
|
||
@Override | ||
public void write( Message message1, ResponseHandler handler1, Message message2, ResponseHandler handler2 ) | ||
{ | ||
delegate.write( message1, handler1, message2, handler2 ); | ||
} | ||
|
||
@Override | ||
public void writeAndFlush( Message message, ResponseHandler handler ) | ||
{ | ||
delegate.writeAndFlush( message, handler ); | ||
} | ||
|
||
@Override | ||
public void writeAndFlush( Message message1, ResponseHandler handler1, Message message2, ResponseHandler handler2 ) | ||
{ | ||
delegate.writeAndFlush( message1, handler1, message2, handler2 ); | ||
} | ||
|
||
@Override | ||
public CompletionStage<Void> reset() | ||
{ | ||
return delegate.reset(); | ||
} | ||
|
||
@Override | ||
public CompletionStage<Void> release() | ||
{ | ||
return delegate.release(); | ||
} | ||
|
||
@Override | ||
public void terminateAndRelease( String reason ) | ||
{ | ||
delegate.terminateAndRelease( reason ); | ||
} | ||
|
||
@Override | ||
public BoltServerAddress serverAddress() | ||
{ | ||
return delegate.serverAddress(); | ||
} | ||
|
||
@Override | ||
public ServerVersion serverVersion() | ||
{ | ||
return delegate.serverVersion(); | ||
} | ||
|
||
@Override | ||
public BoltProtocol protocol() | ||
{ | ||
return delegate.protocol(); | ||
} | ||
|
||
@Override | ||
public AccessMode mode() | ||
{ | ||
return mode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.