package com.mailserver.delivery; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.Column; import org.springframework.data.relational.core.mapping.Table; import java.time.Instant; @Table("outbound_queue") public class OutboundMessage { public static final String PENDING = "PENDING"; public static final String DELIVERED = "DELIVERED"; public static final String FAILED = "FAILED"; @Id private Long id; @Column("mail_from") private String mailFrom; @Column("rcpt_to") private String rcptTo; @Column("message") private byte[] message; @Column("status") private String status = PENDING; @Column("attempts") private int attempts; @Column("next_attempt_at") private Instant nextAttemptAt; @Column("last_error") private String lastError; @Column("created_at") private Instant createdAt; @Column("finished_at") private Instant finishedAt; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getMailFrom() { return mailFrom; } public void setMailFrom(String mailFrom) { this.mailFrom = mailFrom; } public String getRcptTo() { return rcptTo; } public void setRcptTo(String rcptTo) { this.rcptTo = rcptTo; } public byte[] getMessage() { return message; } public void setMessage(byte[] message) { this.message = message; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public int getAttempts() { return attempts; } public void setAttempts(int attempts) { this.attempts = attempts; } public Instant getNextAttemptAt() { return nextAttemptAt; } public void setNextAttemptAt(Instant nextAttemptAt) { this.nextAttemptAt = nextAttemptAt; } public String getLastError() { return lastError; } public void setLastError(String lastError) { this.lastError = lastError; } public Instant getCreatedAt() { return createdAt; } public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } public Instant getFinishedAt() { return finishedAt; } public void setFinishedAt(Instant finishedAt) { this.finishedAt = finishedAt; } }