Interface MachineApi

All Known Subinterfaces:
MachineClient

@HttpExchange("machines/{namespace}") public interface MachineApi
  • Method Summary

    Modifier and Type
    Method
    Description
    distribute(String namespace, int machineBit, String instanceId, boolean stable, String safeGuardDuration)
     
    void
    guard(String namespace, String instanceId, boolean stable, String safeGuardDuration, @Nullable Integer machineId, @Nullable Long lastTimeStamp)
    Guard a machine ID.
    void
    revert(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.

      machineId and lastTimeStamp are 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
      Throws:
      MachineIdLostException