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
FieldsModifier and TypeFieldDescriptionIdentifier 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 toServiceStatus.ACTIVE.Reported version of the service, if any. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceModuleCreates a new ServiceModule instance.static StringgenerateServiceId(String serviceName, String host, int port) Generates a unique service ID.booleanChecks if the service is healthy based on heartbeat.voidUpdates 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
-
Field Details
-
serviceId
Primary key: the generated unique service ID. -
serviceName
Name of the registered service. -
host
Host address the service is reachable at. -
port
Port the service is reachable at. -
version
Reported version of the service, if any. -
configSchemaId
Identifier of the associated configuration schema, if any. -
metadata
-
registeredAt
Timestamp when the module first registered (set on insert). -
lastHeartbeat
Timestamp of the most recent heartbeat. -
status
Current lifecycle status; defaults toServiceStatus.ACTIVE.
-
-
Constructor Details
-
ServiceModule
public ServiceModule()Creates an empty module entity. Required by JPA; application code should prefercreate(String, String, int).
-
-
Method Details
-
create
Creates a new ServiceModule instance.- Parameters:
serviceName- the name of the servicehost- the host addressport- the port number- Returns:
- the created ServiceModule
-
generateServiceId
-
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
-