Class CosIdEndpoint

java.lang.Object
me.ahoo.cosid.spring.autoconfigure.CosIdEndpoint

@Endpoint(id="cosid") public class CosIdEndpoint extends Object
The read-only cosid Actuator endpoint (07 ยง4.2, D17), replacing the 4.x cosid, cosidGenerator and cosidStringGenerator endpoints:
  • GET /actuator/cosid: every generator (CosIdRuntime.describe());
  • GET /actuator/cosid/{name}: one generator;
  • GET /actuator/cosid/{name}/long: a long id (snowflake, segment and custom);
  • GET /actuator/cosid/{name}/string: a text id, through the generator's codec.
An unknown generator answers 404; a disabled one, or long of a text-only one, 400.
  • Field Details

  • Constructor Details

    • CosIdEndpoint

      public CosIdEndpoint(me.ahoo.cosid.runtime.CosIdRuntime runtime)
      Creates the endpoint.
      Parameters:
      runtime - the runtime it describes and generates from
  • Method Details

    • describe

      @ReadOperation public Map<String,CosIdEndpoint.Generator> describe()
      Describes every generator.
      Returns:
      the generators by name
    • generator

      @ReadOperation public CosIdEndpoint.Generator generator(@Selector String name)
      Describes one generator.
      Parameters:
      name - the generator name
      Returns:
      the generator, or null for an unknown one
    • generate

      @ReadOperation public Object generate(@Selector String name, @Selector String format)
      Generates an id.
      Parameters:
      name - the generator name
      format - long or string
      Returns:
      the id, or null for an unknown generator