/** * Returns a test instance of {@link ResumeFrame}. * * @return a test instance of {@link ResumeFrame} */ public static ResumeFrame createTestResumeFrame() { return createResumeFrame(DEFAULT, 1, 0, EMPTY_BUFFER, 1, 1); }
/** * Creates the {@code RESUME} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param resumeIdentificationToken the resume identification token * @param lastReceivedServerPosition the last received server position * @param firstAvailableClientPosition the first available client position * @return the {@code RESUME} frame * @throws NullPointerException if {@code byteBufAllocator} or {@code resumeIdentificationToken} * is {@code null} */ public static ResumeFrame createResumeFrame( ByteBufAllocator byteBufAllocator, ByteBuf resumeIdentificationToken, long lastReceivedServerPosition, long firstAvailableClientPosition) { return createResumeFrame( byteBufAllocator, 1, 0, resumeIdentificationToken, lastReceivedServerPosition, firstAvailableClientPosition); }
public static ResumeFrame createTestResumeFrame() { return createResumeFrame(DEFAULT, 1, 0, EMPTY_BUFFER, 1, 1); }
/** * Creates the {@code RESUME} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param resumeIdentificationToken the resume identification token * @param lastReceivedServerPosition the last received server position * @param firstAvailableClientPosition the first available client position * @return the {@code RESUME} frame * @throws NullPointerException if {@code byteBufAllocator} or {@code resumeIdentificationToken} * is {@code null} */ public static ResumeFrame createResumeFrame( ByteBufAllocator byteBufAllocator, String resumeIdentificationToken, long lastReceivedServerPosition, long firstAvailableClientPosition) { ByteBuf resumeIdentificationTokenByteBuf = getUtf8AsByteBufRequired( resumeIdentificationToken, "resumeIdentificationToken must not be null"); try { return createResumeFrame( byteBufAllocator, resumeIdentificationTokenByteBuf, lastReceivedServerPosition, firstAvailableClientPosition); } finally { release(resumeIdentificationToken); } }
@DisplayName("createResumeFrame throws NullPointerException with null byteBufAllocator") @Test void createResumeFrameNullByteBufAllocator() { assertThatNullPointerException() .isThrownBy(() -> createResumeFrame(null, 100, 200, EMPTY_BUFFER, 300, 400)) .withMessage("byteBufAllocator must not be null"); }
@DisplayName("createResumeFrame throws NullPointerException with null resumeIdentificationToken") @Test void createResumeFrameNullResumeIdentificationToken() { assertThatNullPointerException() .isThrownBy(() -> createResumeFrame(DEFAULT, 100, 200, null, 300, 400)) .withMessage("resumeIdentificationToken must not be null"); }
return createMetadataPushFrame(byteBuf); case RESUME: return createResumeFrame(byteBuf); case RESUME_OK: return createResumeOkFrame(byteBuf);
/** * Creates the {@code RESUME} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param resumeIdentificationToken the resume identification token * @param lastReceivedServerPosition the last received server position * @param firstAvailableClientPosition the first available client position * @return the {@code RESUME} frame * @throws NullPointerException if {@code byteBufAllocator} or {@code resumeIdentificationToken} * is {@code null} */ public static ResumeFrame createResumeFrame( ByteBufAllocator byteBufAllocator, ByteBuf resumeIdentificationToken, long lastReceivedServerPosition, long firstAvailableClientPosition) { return createResumeFrame( byteBufAllocator, 1, 0, resumeIdentificationToken, lastReceivedServerPosition, firstAvailableClientPosition); }
/** * Creates the {@code RESUME} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param resumeIdentificationToken the resume identification token * @param lastReceivedServerPosition the last received server position * @param firstAvailableClientPosition the first available client position * @return the {@code RESUME} frame * @throws NullPointerException if {@code byteBufAllocator} or {@code resumeIdentificationToken} * is {@code null} */ public static ResumeFrame createResumeFrame( ByteBufAllocator byteBufAllocator, String resumeIdentificationToken, long lastReceivedServerPosition, long firstAvailableClientPosition) { ByteBuf resumeIdentificationTokenByteBuf = getUtf8AsByteBufRequired( resumeIdentificationToken, "resumeIdentificationToken must not be null"); try { return createResumeFrame( byteBufAllocator, resumeIdentificationTokenByteBuf, lastReceivedServerPosition, firstAvailableClientPosition); } finally { release(resumeIdentificationToken); } }
return createMetadataPushFrame(byteBuf); case RESUME: return createResumeFrame(byteBuf); case RESUME_OK: return createResumeOkFrame(byteBuf);