Package me.ahoo.cosid.proxy.api
Interface MachineApi
- All Known Subinterfaces:
MachineClient
@HttpExchange("machines/{namespace}")
public interface MachineApi
-
Method Summary
Modifier and TypeMethodDescriptiondistribute(String namespace, int machineBit, String instanceId, boolean stable, String safeGuardDuration) voidguard(String namespace, String instanceId, boolean stable, String safeGuardDuration, @Nullable Integer machineId, @Nullable Long lastTimeStamp) Guard a machine ID.voidrevert(String namespace, String instanceId, boolean stable, @Nullable Integer machineId, @Nullable Long lastTimeStamp) Revert a machine ID.
-
Method Details
-
distribute
@PostExchange MachineState distribute(@PathVariable String namespace, @RequestParam int machineBit, @RequestParam String instanceId, @RequestParam boolean stable, @RequestParam String safeGuardDuration) throws MachineIdOverflowException - Throws:
MachineIdOverflowException
-
revert
@DeleteExchange void revert(@PathVariable String namespace, @RequestParam String instanceId, @RequestParam boolean stable, @RequestParam(required=false) @Nullable Integer machineId, @RequestParam(required=false) @Nullable Long lastTimeStamp) Revert a machine ID.machineIdandlastTimeStampare the client's own machine state. The server keeps no per-client state, so they are required for the server to stay stateless. They are optional only so that older clients, which do not send them, keep working through the server's legacy stateful path. -
guard
@PatchExchange void guard(@PathVariable String namespace, @RequestParam String instanceId, @RequestParam boolean stable, @RequestParam String safeGuardDuration, @RequestParam(required=false) @Nullable Integer machineId, @RequestParam(required=false) @Nullable Long lastTimeStamp) throws MachineIdLostException Guard a machine ID.See
revert(java.lang.String, java.lang.String, boolean, java.lang.Integer, java.lang.Long)formachineIdandlastTimeStamp.- Throws:
MachineIdLostException
-