public static ByteBuf newConnected(int clientProtocolVersion) { CommandConnected.Builder connectedBuilder = CommandConnected.newBuilder(); connectedBuilder.setServerVersion("Pulsar Server"); // If the broker supports a newer version of the protocol, it will anyway advertise the max version that the // client supports, to avoid confusing the client. int currentProtocolVersion = getCurrentProtocolVersion(); int versionToAdvertise = Math.min(currentProtocolVersion, clientProtocolVersion); connectedBuilder.setProtocolVersion(versionToAdvertise); CommandConnected connected = connectedBuilder.build(); ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.CONNECTED).setConnected(connected)); connected.recycle(); connectedBuilder.recycle(); return res; }
public static ByteBuf newConnected(int clientProtocolVersion) { CommandConnected.Builder connectedBuilder = CommandConnected.newBuilder(); connectedBuilder.setServerVersion("Pulsar Server"); // If the broker supports a newer version of the protocol, it will anyway advertise the max version that the // client supports, to avoid confusing the client. int currentProtocolVersion = getCurrentProtocolVersion(); int versionToAdvertise = Math.min(currentProtocolVersion, clientProtocolVersion); connectedBuilder.setProtocolVersion(versionToAdvertise); CommandConnected connected = connectedBuilder.build(); ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.CONNECTED).setConnected(connected)); connected.recycle(); connectedBuilder.recycle(); return res; }
public Builder setConnected( org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.Builder builderForValue) { connected_ = builderForValue.build(); bitField0_ |= 0x00000004; return this; } public Builder mergeConnected(org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected value) {
public Builder setConnected( org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected.Builder builderForValue) { connected_ = builderForValue.build(); bitField0_ |= 0x00000004; return this; } public Builder mergeConnected(org.apache.pulsar.common.api.proto.PulsarApi.CommandConnected value) {