public final class TLfnServiceRepository extends Object
Repository to query the services available in LuciadFusion Studio.
LuciadFusion will create an implementation of the TLfnServiceRepository
at startup and provide this as a bean in the Spring container.
Spring dependency injection can be used to obtain a reference to the repository in your code.
The most straightforward way is to use the org.springframework.beans.factory.annotation.Autowired
annotation in the constructor of your Spring component.
@Controller
public class MyController {
private final TLfnServiceRepository fServiceRepository;
@Autowired
public MyController(TLfnServiceRepository aServiceRepository) {
fServiceRepository = aServiceRepository;
}
}
TLfnService
Modifier and Type | Method and Description |
---|---|
Optional<TLfnService> |
findByTypeAndName(String aServiceType,
String aServiceName)
Searches for a service that has the given type and name.
|
public Optional<TLfnService> findByTypeAndName(String aServiceType, String aServiceName)
Searches for a service that has the given type and name.
This method can be used to find the service related to a request from a client. If the service is found, verify that the service is running by checking the status. Return an error if this not the case. If no service is found, return an appropriate error to the client.
aServiceType
- the type of the serviceaServiceName
- the name of the serviceOptional
containing the service with given type and name, Optional.empty()
if none is found.