Files
Backend/src/main/java/cc/fascinated/model/cache/CachedMinecraftServer.java

34 lines
835 B
Java
Raw Normal View History

2024-04-10 07:43:38 +01:00
package cc.fascinated.model.cache;
import cc.fascinated.model.server.MinecraftServer;
2024-04-10 08:21:52 +01:00
import com.fasterxml.jackson.annotation.JsonIgnore;
2024-04-10 07:43:38 +01:00
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import java.io.Serializable;
/**
* @author Braydon
*/
@AllArgsConstructor @Setter @Getter @ToString
@RedisHash(value = "server", timeToLive = 60L) // 1 minute (in seconds)
public final class CachedMinecraftServer implements Serializable {
/**
* The id of this cached server.
*/
2024-04-10 08:21:52 +01:00
@Id @NonNull @JsonIgnore
private final String id;
2024-04-10 07:43:38 +01:00
/**
* The cached server.
*/
2024-04-10 08:21:52 +01:00
@NonNull
2024-04-10 09:30:35 +01:00
private final MinecraftServer server;
2024-04-10 07:43:38 +01:00
/**
* The unix timestamp of when this
* server was cached, -1 if not cached.
*/
private long cached;
}