public ClientProxy(final BroadcastTransmitter transmitter) { this.transmitter = transmitter; errorResponse.wrap(buffer, 0); imageReady.wrap(buffer, 0); publicationReady.wrap(buffer, 0); subscriptionReady.wrap(buffer, 0); operationSucceeded.wrap(buffer, 0); imageMessage.wrap(buffer, 0); counterUpdate.wrap(buffer, 0); clientTimeout.wrap(buffer, 0); }
public DriverProxy(final RingBuffer toDriverCommandBuffer, final long clientId) { this.toDriverCommandBuffer = toDriverCommandBuffer; publicationMessage.wrap(buffer, 0); subscriptionMessage.wrap(buffer, 0); correlatedMessage.wrap(buffer, 0); removeMessage.wrap(buffer, 0); destinationMessage.wrap(buffer, 0); counterMessage.wrap(buffer, 0); correlatedMessage.clientId(clientId); }
/** * Offset of label buffer. * * @return offset of label buffer */ public int labelBufferOffset() { return labelOffset() + SIZE_OF_INT; }
public void onUnavailableImage( final long correlationId, final long subscriptionRegistrationId, final int streamId, final String channel) { imageMessage .correlationId(correlationId) .subscriptionRegistrationId(subscriptionRegistrationId) .streamId(streamId) .channel(channel); transmit(ON_UNAVAILABLE_IMAGE, buffer, 0, imageMessage.length()); }
private static void dissect(final PublicationMessageFlyweight msg, final StringBuilder builder) { builder .append(msg.channel()) .append(' ') .append(msg.streamId()) .append(" [") .append(msg.clientId()) .append(':') .append(msg.correlationId()) .append(']'); }
private static void dissect(final DestinationMessageFlyweight msg, final StringBuilder builder) { builder .append(msg.channel()) .append(' ') .append(msg.registrationCorrelationId()) .append(" [") .append(msg.clientId()) .append(':') .append(msg.correlationId()) .append(']'); }
private static void dissect(final CounterUpdateFlyweight msg, final StringBuilder builder) { builder .append(msg.correlationId()) .append(' ') .append(msg.counterId()); }
private static void dissect(final RemoveMessageFlyweight msg, final StringBuilder builder) { builder .append(msg.registrationId()) .append(" [") .append(msg.clientId()) .append(':') .append(msg.correlationId()) .append(']'); }
private static void dissect(final SubscriptionReadyFlyweight msg, final StringBuilder builder) { builder .append(msg.correlationId()) .append(' ') .append(msg.channelStatusCounterId()); }
private static void dissect(final ClientTimeoutFlyweight msg, final StringBuilder builder) { builder.append(msg.clientId()); }
private static void dissect(final OperationSucceededFlyweight msg, final StringBuilder builder) { builder.append(msg.correlationId()); }
public long clientId() { return correlatedMessage.clientId(); }
public void clientClose() { correlatedMessage.correlationId(Aeron.NULL_VALUE); toDriverCommandBuffer.write(CLIENT_CLOSE, buffer, 0, CorrelatedMessageFlyweight.LENGTH); } }
/** * Return the source identity string in ASCII * * @return source identity string */ public String sourceIdentity() { return buffer.getStringAscii(offset + sourceIdentityOffset()); }
public void onCounterReady(final long correlationId, final int counterId) { counterUpdate .correlationId(correlationId) .counterId(counterId); transmit(ON_COUNTER_READY, buffer, 0, CounterUpdateFlyweight.LENGTH); }
public void onClientTimeout(final long clientId) { clientTimeout.clientId(clientId); transmit(ON_CLIENT_TIMEOUT, buffer, 0, ClientTimeoutFlyweight.LENGTH); }
/** * Length of label buffer in bytes. * * @return length of label buffer in bytes */ public int labelBufferLength() { return buffer.getInt(offset + labelOffset()); }
/** * Get the length of the current message * <p> * NB: must be called after the data is written in order to be accurate. * * @return the length of the current message */ public int length() { final int sourceIdentityOffset = sourceIdentityOffset(); return sourceIdentityOffset + buffer.getInt(offset + sourceIdentityOffset) + SIZE_OF_INT; }
public void onUnavailableCounter(final long registrationId, final int counterId) { counterUpdate .correlationId(registrationId) .counterId(counterId); transmit(ON_UNAVAILABLE_COUNTER, buffer, 0, CounterUpdateFlyweight.LENGTH); }
/** * Get the length of the current message * <p> * NB: must be called after the data is written in order to be accurate. * * @return the length of the current message */ public int length() { final int labelOffset = labelOffset(); return labelOffset + buffer.getInt(offset + labelOffset) + SIZE_OF_INT; }