Class AbstractBinderFactory
java.lang.Object
io.github.qubitpi.athena.application.AbstractBinderFactory
- All Implemented Interfaces:
BinderFactory
- Direct Known Subclasses:
BooksBinderFactory
AbstractBinderFactory
implements standard buildBinder functionality.
It is left to individual projects to subclass, providing FileStore
and MetaStore
classes, etc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterBinding
(@NotNull org.glassfish.hk2.utilities.binding.AbstractBinder abstractBinder) Allows additional app-specific binding.void
afterRegistration
(ResourceConfig resourceConfig) Allows additional app-specific Jersey feature registration and config.org.glassfish.hk2.utilities.Binder
Builds an hk2 Binder instance.protected @NotNull FileIdGenerator
Initializes service for generating file ID's.Registers file data storage.protected @NotNull JsonDocumentParser
Initializes service for parsing client GraphQL request JSON.Registers GraphQL service that provides file metadata read/write API.protected abstract @NotNull graphql.schema.DataFetcher<MetaData>
Similar tobuildQueryDataFetcher()
, this method binds an object responsible for executing the mutation and returning some sensible output values ofMetaData
.protected abstract @NotNull graphql.schema.DataFetcher<MetaData>
Registers an object responsible for retrieving, from metadata database, a data value back for a given graphql field, i.e.
-
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 interfaceBinderFactory
- Returns:
- a binder instance
-
afterRegistration
Description copied from interface:BinderFactory
Allows additional app-specific Jersey feature registration and config.- Specified by:
afterRegistration
in interfaceBinderFactory
- Parameters:
resourceConfig
- Resource config to use for accessing the configuration
-
buildFileStore
Registers file data storage.- Returns:
- a service for persisting and fetching files
-
buildMetaStore
Registers GraphQL service that provides file metadata read/write API.- Returns:
- a service for persisting
-
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 aMetaData
into a runtime object that will be sent back as part of the overall graphqlExecutionResult
- Returns:
- a native GraphQL
DataFetcher
instance
-
buildMutationDataFetcher
@NotNull protected abstract @NotNull graphql.schema.DataFetcher<MetaData> buildMutationDataFetcher()Similar tobuildQueryDataFetcher()
, this method binds an object responsible for executing the mutation and returning some sensible output values ofMetaData
.- Returns:
- a native GraphQL
DataFetcher
instance - See Also:
-
buildFileIdGenerator
Initializes service for generating file ID's.- Returns:
- a new instance of
FileIdGenerator
- Throws:
IllegalStateException
- if an internal error occurs
-
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
-