
com.gruelbox.transactionoutbox.StubPersistor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transactionoutbox-core Show documentation
Show all versions of transactionoutbox-core Show documentation
A safe implementation of the transactional outbox pattern for Java (core library)
package com.gruelbox.transactionoutbox;
import java.time.Instant;
import java.util.Collection;
import java.util.List;
import lombok.Builder;
/** Stub implementation of {@link Persistor}. */
@Builder
public class StubPersistor implements Persistor {
StubPersistor() {}
@Override
public void migrate(TransactionManager transactionManager) {
// No-op
}
@Override
public void save(Transaction tx, TransactionOutboxEntry entry) {
// No-op
}
@Override
public void delete(Transaction tx, TransactionOutboxEntry entry) {
// No-op
}
@Override
public void update(Transaction tx, TransactionOutboxEntry entry) {
// No-op
}
@Override
public boolean lock(Transaction tx, TransactionOutboxEntry entry) {
return true;
}
@Override
public boolean unblock(Transaction tx, String entryId) {
return true;
}
@Override
public List selectBatch(Transaction tx, int batchSize, Instant now) {
return List.of();
}
@Override
public Collection selectNextInTopics(
Transaction tx, int flushBatchSize, Instant now) {
return List.of();
}
@Override
public int deleteProcessedAndExpired(Transaction tx, int batchSize, Instant now) {
return 0;
}
@Override
public void clear(Transaction tx) {}
@Override
public boolean checkConnection(Transaction tx) {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy