MarginaliaSearch/code/common/service/java/nu/marginalia/service/ServiceId.java
Viktor Lofgren 46423612e3 (refac) Merge service-discovery and service modules
Also adds a few tests to the server/client code.
2024-03-03 10:49:23 +01:00

36 lines
761 B
Java

package nu.marginalia.service;
public enum ServiceId {
Assistant("assistant-service"),
Api("api-service"),
Search("search-service"),
Index("index-service"),
Query("query-service"),
Executor("executor-service"),
Control("control-service"),
Dating("dating-service"),
Explorer("explorer-service");
public final String serviceName;
ServiceId(String serviceName) {
this.serviceName = serviceName;
}
public String withNode(int node) {
return serviceName + ":" + node;
}
public static ServiceId byName(String name) {
for (ServiceId id : values()) {
if (id.serviceName.equals(name)) {
return id;
}
}
return null;
}
}