use of no.stelar7.api.l4j8.pojo.status.ShardStatus in project L4J8 by stelar7.
the class StatusAPI method getShardStatus.
public ShardStatus getShardStatus(Platform server) {
DataCallBuilder builder = new DataCallBuilder().withEndpoint(URLEndpoint.V3_SHARD_STATUS).withPlatform(server);
Optional chl = DataCall.getCacheProvider().get(URLEndpoint.V3_SHARD_STATUS, server);
if (chl.isPresent()) {
return (ShardStatus) chl.get();
}
try {
ShardStatus list = (ShardStatus) builder.build();
DataCall.getCacheProvider().store(URLEndpoint.V3_SHARD_STATUS, list, server);
return list;
} catch (ClassCastException e) {
return null;
}
}
Aggregations