Class AbstractBinderFactory

java.lang.Object
io.github.qubitpi.athena.application.AbstractBinderFactory
All Implemented Interfaces:
BinderFactory
Direct Known Subclasses:
BooksBinderFactory

public abstract class AbstractBinderFactory extends Object implements BinderFactory
AbstractBinderFactory implements standard buildBinder functionality.

It is left to individual projects to subclass, providing FileStore and MetaStore classes, etc.

  • Constructor Details

    • AbstractBinderFactory

      public AbstractBinderFactory()
  • Method Details

    • buildBinder

      public org.glassfish.hk2.utilities.Binder buildBinder()
      Description copied from interface: BinderFactory
      Builds an hk2 Binder instance.

      This binder should bind all data dictionaries after loading them, as well as UI/NonUI web services and Health Check metrics

      Specified by:
      buildBinder in interface BinderFactory
      Returns:
      a binder instance
    • afterRegistration

      public void afterRegistration(ResourceConfig resourceConfig)
      Description copied from interface: BinderFactory
      Allows additional app-specific Jersey feature registration and config.
      Specified by:
      afterRegistration in interface BinderFactory
      Parameters:
      resourceConfig - Resource config to use for accessing the configuration
    • buildFileStore

      @NotNull protected abstract @NotNull Class<? extends FileStore> buildFileStore()
      Registers file data storage.
      Returns:
      a service for persisting and fetching files
    • buildMetaStore

      @NotNull protected abstract @NotNull Class<? extends MetaStore> buildMetaStore()
      Registers GraphQL service that provides file metadata read/write API.
      Returns:
      a service for persisting
    • buildQueryDataFetcher

      @NotNull protected abstract @NotNull graphql.schema.DataFetcher<MetaData> buildQueryDataFetcher()
      Registers an object responsible for retrieving, from metadata database, a data value back for a given graphql field, i.e. MetaData object; the graphql engine uses this data fetcher to resolve/fetch a MetaData into a runtime object that will be sent back as part of the overall graphql ExecutionResult
      Returns:
      a native GraphQL DataFetcher instance
    • buildMutationDataFetcher

      @NotNull protected abstract @NotNull graphql.schema.DataFetcher<MetaData> buildMutationDataFetcher()
      Similar to buildQueryDataFetcher(), this method binds an object responsible for executing the mutation and returning some sensible output values of MetaData.
      Returns:
      a native GraphQL DataFetcher instance
      See Also:
    • buildFileIdGenerator

      @NotNull protected @NotNull FileIdGenerator buildFileIdGenerator()
      Initializes service for generating file ID's.
      Returns:
      a new instance of FileIdGenerator
      Throws:
      IllegalStateException - if an internal error occurs
    • buildJsonDocumentParser

      @NotNull protected @NotNull JsonDocumentParser buildJsonDocumentParser()
      Initializes service for parsing client GraphQL request JSON.
      Returns:
      a new instance
    • afterBinding

      protected void afterBinding(@NotNull @NotNull org.glassfish.hk2.utilities.binding.AbstractBinder abstractBinder)
      Allows additional app-specific binding.
      Parameters:
      abstractBinder - Binder to use for binding