@Override protected void handleConnected(CommandConnected connected) { if (isTlsHostnameVerificationEnable && remoteHostName != null && !verifyTlsHostName(remoteHostName, ctx)) { // close the connection if host-verification failed with the broker log.warn("[{}] Failed to verify hostname of {}", ctx.channel(), remoteHostName); ctx.close(); return; } checkArgument(state == State.SentConnectFrame); if (log.isDebugEnabled()) { log.debug("{} Connection is ready", ctx.channel()); } // set remote protocol version to the correct version before we complete the connection future remoteEndpointProtocolVersion = connected.getProtocolVersion(); connectionFuture.complete(null); state = State.Ready; }
if (!getConnected().isInitialized()) { memoizedIsInitialized = 0; return false;
if (!getConnected().isInitialized()) {
connect_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandConnect.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000002); connected_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); subscribe_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandSubscribe.getDefaultInstance();
private void initFields() { type_ = org.apache.pulsar.common.api.proto.PulsarApi.BaseCommand.Type.CONNECT; connect_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandConnect.getDefaultInstance(); connected_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance(); subscribe_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandSubscribe.getDefaultInstance(); producer_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandProducer.getDefaultInstance();
@Override protected void handleConnected(CommandConnected connected) { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received Connected from broker", inboundChannel, outboundChannel); } if (config.isTlsHostnameVerificationEnabled() && remoteHostName != null && !verifyTlsHostName(remoteHostName, ctx)) { // close the connection if host-verification failed with the // broker log.warn("[{}] Failed to verify hostname of {}", ctx.channel(), remoteHostName); ctx.close(); return; } state = BackendState.HandshakeCompleted; inboundChannel.writeAndFlush(Commands.newConnected(connected.getProtocolVersion())).addListener(future -> { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Removing decoder from pipeline", inboundChannel, outboundChannel); } inboundChannel.pipeline().remove("frameDecoder"); outboundChannel.pipeline().remove("frameDecoder"); // Start reading from both connections inboundChannel.read(); outboundChannel.read(); }); }
@Override protected void handleConnected(CommandConnected connected) { if (isTlsHostnameVerificationEnable && remoteHostName != null && !verifyTlsHostName(remoteHostName, ctx)) { // close the connection if host-verification failed with the broker log.warn("[{}] Failed to verify hostname of {}", ctx.channel(), remoteHostName); ctx.close(); return; } checkArgument(state == State.SentConnectFrame); if (log.isDebugEnabled()) { log.debug("{} Connection is ready", ctx.channel()); } // set remote protocol version to the correct version before we complete the connection future remoteEndpointProtocolVersion = connected.getProtocolVersion(); connectionFuture.complete(null); state = State.Ready; }
public org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected getDefaultInstanceForType() { return org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance(); }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.apache.pulsar.shaded.com.google.protobuf.v241.CodedOutputStream .computeBytesSize(1, getServerVersionBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += org.apache.pulsar.shaded.com.google.protobuf.v241.CodedOutputStream .computeInt32Size(2, protocolVersion_); } memoizedSerializedSize = size; return size; }
public Builder mergeConnected(org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected value) { if (((bitField0_ & 0x00000004) == 0x00000004) && connected_ != org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance()) { connected_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.newBuilder(connected_).mergeFrom(value).buildPartial(); } else { connected_ = value; } bitField0_ |= 0x00000004; return this; } public Builder clearConnected() {
public org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected build() { org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public void writeTo(org.apache.pulsar.common.util.protobuf.ByteBufCodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getServerVersionBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(2, protocolVersion_); } }
public Builder clearConnected() { connected_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); return this; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasServerVersion()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public Builder clearServerVersion() { bitField0_ = (bitField0_ & ~0x00000001); serverVersion_ = getDefaultInstance().getServerVersion(); return this; } void setServerVersion(org.apache.pulsar.shaded.com.google.protobuf.v241.ByteString value) {
private org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected buildParsed() throws org.apache.pulsar.shaded.com.google.protobuf.v241.InvalidProtocolBufferException { org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } return result; }
public void recycle() { this.initFields(); this.memoizedIsInitialized = -1; this.bitField0_ = 0; this.memoizedSerializedSize = -1; if (handle != null) { RECYCLER.recycle(this, handle); } }
public Builder mergeFrom(org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected other) { if (other == org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.getDefaultInstance()) return this; if (other.hasServerVersion()) { setServerVersion(other.getServerVersion()); } if (other.hasProtocolVersion()) { setProtocolVersion(other.getProtocolVersion()); } return this; }
if (!getConnected().isInitialized()) { memoizedIsInitialized = 0; return false;
if (!getConnected().isInitialized()) {