-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This initial update brings 4.4 support that is based on 4.3.
- Loading branch information
1 parent
cd02074
commit f29cf07
Showing
11 changed files
with
1,038 additions
and
6 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
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
45 changes: 45 additions & 0 deletions
45
driver/src/main/java/org/neo4j/driver/internal/messaging/v44/BoltProtocolV44.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,45 @@ | ||
/* | ||
* Copyright (c) "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.messaging.v44; | ||
|
||
import org.neo4j.driver.internal.messaging.BoltProtocol; | ||
import org.neo4j.driver.internal.messaging.BoltProtocolVersion; | ||
import org.neo4j.driver.internal.messaging.MessageFormat; | ||
import org.neo4j.driver.internal.messaging.v43.BoltProtocolV43; | ||
|
||
/** | ||
* Definition of the Bolt Protocol 4.4 | ||
*/ | ||
public class BoltProtocolV44 extends BoltProtocolV43 | ||
{ | ||
public static final BoltProtocolVersion VERSION = new BoltProtocolVersion( 4, 4 ); | ||
public static final BoltProtocol INSTANCE = new BoltProtocolV44(); | ||
|
||
@Override | ||
public MessageFormat createMessageFormat() | ||
{ | ||
return new MessageFormatV44(); | ||
} | ||
|
||
@Override | ||
public BoltProtocolVersion version() | ||
{ | ||
return VERSION; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
driver/src/main/java/org/neo4j/driver/internal/messaging/v44/MessageFormatV44.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,42 @@ | ||
/* | ||
* Copyright (c) "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.messaging.v44; | ||
|
||
import org.neo4j.driver.internal.messaging.MessageFormat; | ||
import org.neo4j.driver.internal.messaging.common.CommonMessageReader; | ||
import org.neo4j.driver.internal.packstream.PackInput; | ||
import org.neo4j.driver.internal.packstream.PackOutput; | ||
|
||
/** | ||
* Bolt message format v4.4 | ||
*/ | ||
public class MessageFormatV44 implements MessageFormat | ||
{ | ||
@Override | ||
public MessageFormat.Writer newWriter( PackOutput output ) | ||
{ | ||
return new MessageWriterV44( output ); | ||
} | ||
|
||
@Override | ||
public MessageFormat.Reader newReader( PackInput input ) | ||
{ | ||
return new CommonMessageReader( input ); | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
driver/src/main/java/org/neo4j/driver/internal/messaging/v44/MessageWriterV44.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,77 @@ | ||
/* | ||
* Copyright (c) "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.messaging.v44; | ||
|
||
import java.util.Map; | ||
|
||
import org.neo4j.driver.internal.messaging.AbstractMessageWriter; | ||
import org.neo4j.driver.internal.messaging.MessageEncoder; | ||
import org.neo4j.driver.internal.messaging.common.CommonValuePacker; | ||
import org.neo4j.driver.internal.messaging.encode.BeginMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.CommitMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.DiscardMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.GoodbyeMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.HelloMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.PullMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.ResetMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.RollbackMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.RouteMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.encode.RunWithMetadataMessageEncoder; | ||
import org.neo4j.driver.internal.messaging.request.BeginMessage; | ||
import org.neo4j.driver.internal.messaging.request.CommitMessage; | ||
import org.neo4j.driver.internal.messaging.request.DiscardMessage; | ||
import org.neo4j.driver.internal.messaging.request.GoodbyeMessage; | ||
import org.neo4j.driver.internal.messaging.request.HelloMessage; | ||
import org.neo4j.driver.internal.messaging.request.PullMessage; | ||
import org.neo4j.driver.internal.messaging.request.ResetMessage; | ||
import org.neo4j.driver.internal.messaging.request.RollbackMessage; | ||
import org.neo4j.driver.internal.messaging.request.RouteMessage; | ||
import org.neo4j.driver.internal.messaging.request.RunWithMetadataMessage; | ||
import org.neo4j.driver.internal.packstream.PackOutput; | ||
import org.neo4j.driver.internal.util.Iterables; | ||
|
||
/** | ||
* Bolt message writer v4.4 | ||
*/ | ||
public class MessageWriterV44 extends AbstractMessageWriter | ||
{ | ||
public MessageWriterV44( PackOutput output ) | ||
{ | ||
super( new CommonValuePacker( output ), buildEncoders() ); | ||
} | ||
|
||
private static Map<Byte,MessageEncoder> buildEncoders() | ||
{ | ||
Map<Byte,MessageEncoder> result = Iterables.newHashMapWithSize( 9 ); | ||
result.put( HelloMessage.SIGNATURE, new HelloMessageEncoder() ); | ||
result.put( GoodbyeMessage.SIGNATURE, new GoodbyeMessageEncoder() ); | ||
result.put( RunWithMetadataMessage.SIGNATURE, new RunWithMetadataMessageEncoder() ); | ||
result.put( RouteMessage.SIGNATURE, new RouteMessageEncoder() ); | ||
|
||
result.put( DiscardMessage.SIGNATURE, new DiscardMessageEncoder() ); | ||
result.put( PullMessage.SIGNATURE, new PullMessageEncoder() ); | ||
|
||
result.put( BeginMessage.SIGNATURE, new BeginMessageEncoder() ); | ||
result.put( CommitMessage.SIGNATURE, new CommitMessageEncoder() ); | ||
result.put( RollbackMessage.SIGNATURE, new RollbackMessageEncoder() ); | ||
|
||
result.put( ResetMessage.SIGNATURE, new ResetMessageEncoder() ); | ||
return result; | ||
} | ||
} |
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.