Search in sources :

Example 1 with ShardStatus

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;
    }
}
Also used : ShardStatus(no.stelar7.api.l4j8.pojo.status.ShardStatus) Optional(java.util.Optional)

Aggregations

Optional (java.util.Optional)1 ShardStatus (no.stelar7.api.l4j8.pojo.status.ShardStatus)1