예제 #1
0
        public override void ChannelRead(ChannelHandlerContext ctx, object msg)
        {
            if (_protocol.isExpecting(CatchupClientProtocol.State.MessageType))
            {
                sbyte byteValue = (( ByteBuf )msg).readByte();
                ResponseMessageType responseMessageType = from(byteValue);

                switch (responseMessageType.innerEnumValue)
                {
                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.STORE_ID:
                    _protocol.expect(CatchupClientProtocol.State.StoreId);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.TX:
                    _protocol.expect(CatchupClientProtocol.State.TxPullResponse);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.FILE:
                    _protocol.expect(CatchupClientProtocol.State.FileHeader);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.STORE_COPY_FINISHED:
                    _protocol.expect(CatchupClientProtocol.State.StoreCopyFinished);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.CORE_SNAPSHOT:
                    _protocol.expect(CatchupClientProtocol.State.CoreSnapshot);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.TX_STREAM_FINISHED:
                    _protocol.expect(CatchupClientProtocol.State.TxStreamFinished);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.PREPARE_STORE_COPY_RESPONSE:
                    _protocol.expect(CatchupClientProtocol.State.PrepareStoreCopyResponse);
                    break;

                case Org.Neo4j.causalclustering.catchup.ResponseMessageType.InnerEnum.INDEX_SNAPSHOT_RESPONSE:
                    _protocol.expect(CatchupClientProtocol.State.IndexSnapshotResponse);
                    break;

                default:
                    _log.warn("No handler found for message type %s (%d)", responseMessageType.name(), byteValue);
                    break;
                }

                ReferenceCountUtil.release(msg);
            }
            else
            {
                ctx.fireChannelRead(msg);
            }
        }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, final org.neo4j.causalclustering.catchup.storecopy.PrepareStoreCopyResponse msg) throws Exception
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        protected internal override void ChannelRead0(ChannelHandlerContext ctx, PrepareStoreCopyResponse msg)
        {
            _handler.onStoreListingResponse(msg);
            _protocol.expect(CatchupClientProtocol.State.MessageType);
        }