Class ServiceModule

java.lang.Object
io.quarkus.hibernate.orm.panache.PanacheEntityBase
ai.pipestream.registration.entity.ServiceModule

@Entity public class ServiceModule extends io.quarkus.hibernate.orm.panache.PanacheEntityBase
Entity representing a registered service module in the system. This is the system of record for all service registrations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Identifier of the associated configuration schema, if any.
    Host address the service is reachable at.
    Timestamp of the most recent heartbeat.
    Free-form registration metadata, stored as a JSONB column.
    Port the service is reachable at.
    Timestamp when the module first registered (set on insert).
    Primary key: the generated unique service ID.
    Name of the registered service.
    Current lifecycle status; defaults to ServiceStatus.ACTIVE.
    Reported version of the service, if any.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty module entity.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(String serviceName, String host, int port)
    Creates a new ServiceModule instance.
    static String
    generateServiceId(String serviceName, String host, int port)
    Generates a unique service ID.
    boolean
    Checks if the service is healthy based on heartbeat.
    void
    Updates the last heartbeat timestamp.

    Methods inherited from class io.quarkus.hibernate.orm.panache.PanacheEntityBase

    count, count, count, count, delete, delete, delete, delete, deleteAll, deleteById, find, find, find, find, find, find, findAll, findAll, findById, findById, findByIdOptional, findByIdOptional, findByIds, flush, getEntityManager, getSession, isPersistent, list, list, list, list, list, list, listAll, listAll, persist, persist, persist, persist, persistAndFlush, stream, stream, stream, stream, stream, stream, streamAll, streamAll, update, update, update

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serviceId

      public String serviceId
      Primary key: the generated unique service ID.
    • serviceName

      public String serviceName
      Name of the registered service.
    • host

      public String host
      Host address the service is reachable at.
    • port

      public Integer port
      Port the service is reachable at.
    • version

      public String version
      Reported version of the service, if any.
    • configSchemaId

      public String configSchemaId
      Identifier of the associated configuration schema, if any.
    • metadata

      public Map<String,Object> metadata
      Free-form registration metadata, stored as a JSONB column.
    • registeredAt

      public LocalDateTime registeredAt
      Timestamp when the module first registered (set on insert).
    • lastHeartbeat

      public LocalDateTime lastHeartbeat
      Timestamp of the most recent heartbeat.
    • status

      public ServiceStatus status
      Current lifecycle status; defaults to ServiceStatus.ACTIVE.
  • Constructor Details

    • ServiceModule

      public ServiceModule()
      Creates an empty module entity. Required by JPA; application code should prefer create(String, String, int).
  • Method Details

    • create

      public static ServiceModule create(String serviceName, String host, int port)
      Creates a new ServiceModule instance.
      Parameters:
      serviceName - the name of the service
      host - the host address
      port - the port number
      Returns:
      the created ServiceModule
    • generateServiceId

      public static String generateServiceId(String serviceName, String host, int port)
      Generates a unique service ID.
      Parameters:
      serviceName - the name of the service
      host - the host address
      port - the port number
      Returns:
      the generated service ID
    • updateHeartbeat

      public void updateHeartbeat()
      Updates the last heartbeat timestamp.
    • isHealthy

      public boolean isHealthy()
      Checks if the service is healthy based on heartbeat.
      Returns:
      true if healthy, false otherwise