Interface Service.ServiceFactory<I,R>

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
Service.DirectoryService<I>
All Known Implementing Classes:
ServiceRegistry, TinkerDegreeCentralityFactory, TinkerServiceRegistry, TinkerServiceRegistry.LambdaServiceFactory, TinkerServiceRegistry.TinkerServiceFactory, TinkerTextSearchFactory
Enclosing interface:
Service<I,R>

public static interface Service.ServiceFactory<I,R> extends AutoCloseable
The service factory creates instances of callable services based on the desired execution type. Some services (e.g. full text search) might be run at the start of a traversal or mid-traversal. The service factory will create an instance based on how the service will be executed. This leaves open the possibility for a single named service to support multiple execution modes (streaming vs. chunked vs. all-at-once) and dynamically choose one based on the location in the traversal of the service call and the static parameters supplied (this allow for dynamic chunk size).
  • Method Details

    • getName

      String getName()
      Get the name of this service.
    • getSupportedTypes

      Set<Service.Type> getSupportedTypes()
      Get the execution modes that it supports.
    • describeParams

      default Map describeParams()
      Return a description of any service call parameters.
    • getRequirementsByType

      default Map<Service.Type,Set<TraverserRequirement>> getRequirementsByType()
      Return any TraverserRequirements necessary for this service call for each execution Service.Type it supports.
    • getRequirements

      default Set<TraverserRequirement> getRequirements(Service.Type type)
      Return any TraverserRequirements necessary for this service call for the supplied execution Service.Type.
    • createService

      Service<I,R> createService(boolean isStart, Map params)
      Create a Service call instance.
      Parameters:
      isStart - true if the call is being used to start a traversal
      params - the static params provided to service call (if any)
      Returns:
      the service call instance
    • close

      default void close()
      Service factories can implement cleanup/shutdown procedures here.
      Specified by:
      close in interface AutoCloseable