/** * Returns a test instance of {@link ResumeOkFrame}. * * @return a test instance of {@link ResumeOkFrame} */ public static ResumeOkFrame createTestResumeOkFrame() { return createResumeOkFrame(DEFAULT, 1); }
/** * Creates the {@code RESUME_OK} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param lastReceivedClientPosition the last received server position * @return the {@code RESUME_OK} frame * @throws NullPointerException if {@code byteBufAllocator} is {@code null} */ public static ResumeOkFrame createResumeOkFrame( ByteBufAllocator byteBufAllocator, long lastReceivedClientPosition) { ByteBuf byteBuf = createFrameTypeAndFlags(byteBufAllocator, RESUME_OK).writeLong(lastReceivedClientPosition); return RECYCLER.get().setByteBuf(byteBuf); }
/** * Returns the last received client position. * * @return the last received client position */ public long getLastReceivedClientPosition() { return getByteBuf().getLong(OFFSET_LAST_RECEIVED_CLIENT_POSITION); }
@Override public String toString() { return "ResumeOkFrame{" + "lastReceivedClientPosition=" + getLastReceivedClientPosition() + '}'; } }
/** * Creates the {@code RESUME_OK} frame. * * @param byteBuf the {@link ByteBuf} representing the frame * @return the {@code RESUME_OK} frame. * @throws NullPointerException if {@code byteBuf} is {@code null} */ public static ResumeOkFrame createResumeOkFrame(ByteBuf byteBuf) { Objects.requireNonNull(byteBuf, "byteBuf must not be null"); return RECYCLER.get().setByteBuf(byteBuf.retain()); }
@DisplayName("creates RESUME_OK frame") @Test void createFrameResumeOk() { createTestResumeOkFrame() .consumeFrame( byteBuf -> assertThat(createFrame(byteBuf)).isInstanceOf(ResumeOkFrame.class)); }
@Override public String toString() { return "ResumeOkFrame{" + "lastReceivedClientPosition=" + getLastReceivedClientPosition() + '}'; } }
/** * Creates the {@code RESUME_OK} frame. * * @param byteBuf the {@link ByteBuf} representing the frame * @return the {@code RESUME_OK} frame. * @throws NullPointerException if {@code byteBuf} is {@code null} */ public static ResumeOkFrame createResumeOkFrame(ByteBuf byteBuf) { Objects.requireNonNull(byteBuf, "byteBuf must not be null"); return RECYCLER.get().setByteBuf(byteBuf.retain()); }
public static ResumeOkFrame createTestResumeOkFrame() { return createResumeOkFrame(DEFAULT, 1); }
/** * Creates the {@code RESUME_OK} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param lastReceivedClientPosition the last received server position * @return the {@code RESUME_OK} frame * @throws NullPointerException if {@code byteBufAllocator} is {@code null} */ public static ResumeOkFrame createResumeOkFrame( ByteBufAllocator byteBufAllocator, long lastReceivedClientPosition) { ByteBuf byteBuf = createFrameTypeAndFlags(byteBufAllocator, RESUME_OK).writeLong(lastReceivedClientPosition); return RECYCLER.get().setByteBuf(byteBuf); }
/** * Returns the last received client position. * * @return the last received client position */ public long getLastReceivedClientPosition() { return getByteBuf().getLong(OFFSET_LAST_RECEIVED_CLIENT_POSITION); }
@DisplayName("createResumeOkFrame throws NullPointerException with null byteBufAllocator") @Test void createResumeOkFrameNullByteBufAllocator() { assertThatNullPointerException() .isThrownBy(() -> createResumeOkFrame(null, 100)) .withMessage("byteBufAllocator must not be null"); }
return createResumeFrame(byteBuf); case RESUME_OK: return createResumeOkFrame(byteBuf); case EXT: return createExtensionFrame(byteBuf);
return createResumeFrame(byteBuf); case RESUME_OK: return createResumeOkFrame(byteBuf); case EXT: return createExtensionFrame(byteBuf);