Class SlingDataFetcherSelector
- java.lang.Object
-
- org.apache.sling.graphql.core.engine.SlingDataFetcherSelector
-
public class SlingDataFetcherSelector extends Object
Selects a SlingDataFetcher used to retrieve data, based on a name specified by a GraphQL schema directive.
-
-
Field Summary
Fields Modifier and Type Field Description static String
RESERVED_NAME_PREFIX
Fetchers which have a name starting with this prefix must be under the {#link RESERVED_PACKAGE_PREFIX} package.static String
RESERVED_PACKAGE_PREFIX
Package name prefix for fetchers which have names starting with the {#link RESERVED_NAME_PREFIX}.
-
Constructor Summary
Constructors Constructor Description SlingDataFetcherSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(org.osgi.framework.BundleContext ctx)
@Nullable SlingDataFetcher<Object>
getSlingFetcher(@NotNull String name)
-
-
-
Field Detail
-
RESERVED_NAME_PREFIX
public static final String RESERVED_NAME_PREFIX
Fetchers which have a name starting with this prefix must be under the {#link RESERVED_PACKAGE_PREFIX} package.- See Also:
- Constant Field Values
-
RESERVED_PACKAGE_PREFIX
public static final String RESERVED_PACKAGE_PREFIX
Package name prefix for fetchers which have names starting with the {#link RESERVED_NAME_PREFIX}.- See Also:
- Constant Field Values
-
-
Method Detail
-
activate
public void activate(org.osgi.framework.BundleContext ctx)
-
getSlingFetcher
@Nullable public @Nullable SlingDataFetcher<Object> getSlingFetcher(@NotNull @NotNull String name) throws IOException
- Returns:
- a SlingDataFetcher, or null if none available. First tries to get an OSGi SlingDataFetcher service, and if not found tries to find a scripted SlingDataFetcher.
- Throws:
IOException
-
-