org.neo4j.driver.internal.messaging.v43.MessageWriterV43 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neo4j-java-driver Show documentation
Show all versions of neo4j-java-driver Show documentation
Access to the Neo4j graph database through Java
/*
* 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.v43;
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.3
*
* This version is able to encode all the versions existing on v4.2, but it encodes
* new messages such as ROUTE
*/
public class MessageWriterV43 extends AbstractMessageWriter
{
public MessageWriterV43( PackOutput output )
{
super( new CommonValuePacker( output ), buildEncoders() );
}
private static Map buildEncoders()
{
Map 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() ); // new
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;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy