public class AEMHeadlessClient
extends java.lang.Object
| Constructor and Description |
|---|
AEMHeadlessClient(@NotNull java.lang.String endpoint)
Creates a simple client (no authentication or other configuration).
|
| Modifier and Type | Method and Description |
|---|---|
static @NotNull AEMHeadlessClientBuilder |
builder()
Builder that allows to configure all available options of the
AEMHeadlessClient |
@NotNull java.util.List<PersistedQuery> |
listPersistedQueries(@NotNull java.lang.String configurationName)
Lists all persisted queries for the given configuration name.
|
@NotNull PersistedQuery |
persistQuery(@NotNull java.lang.String queryToPersist,
@NotNull java.lang.String persistedQueryPath)
Adds a new persisted query on the server.
|
@NotNull GraphQlResponse |
runPersistedQuery(@NotNull PersistedQuery persistedQuery)
Runs a persisted query on the server.
|
@NotNull GraphQlResponse |
runPersistedQuery(@NotNull PersistedQuery persistedQuery,
java.util.Map<java.lang.String,java.lang.Object> variables)
Runs a persisted query on the server.
|
@NotNull GraphQlResponse |
runPersistedQuery(@NotNull java.lang.String persistedQueryPath)
Runs a persisted query on the server.
|
@NotNull GraphQlResponse |
runPersistedQuery(@NotNull java.lang.String persistedQueryPath,
java.util.Map<java.lang.String,java.lang.Object> variables)
Runs a persisted query on the server.
|
@NotNull GraphQlResponse |
runQuery(@NotNull java.lang.String query)
Runs the given GraphQL query on server.
|
@NotNull GraphQlResponse |
runQuery(@NotNull java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> variables)
Runs the given GraphQL query on server.
|
public AEMHeadlessClient(@NotNull
@NotNull java.lang.String endpoint)
throws java.net.URISyntaxException
builder().
If the endpoint points to a server only without path (e.g.
http:/myserver:8080), then the default endpoint for GraphQL queries
/content/graphql/global/endpoint.json is taken.endpoint - the endpoint to run queries againstjava.net.URISyntaxException - if the endpoint is an invalid URI@NotNull public static @NotNull AEMHeadlessClientBuilder builder()
AEMHeadlessClient@NotNull public @NotNull GraphQlResponse runQuery(@NotNull @NotNull java.lang.String query)
query - the query to executeGraphQlResponseAEMHeadlessClientException - if the query cannot be executed@NotNull public @NotNull GraphQlResponse runQuery(@NotNull @NotNull java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> variables)
query - the query to executevariables - variables for the queryGraphQlResponseAEMHeadlessClientException - if the query cannot be executed@NotNull public @NotNull java.util.List<PersistedQuery> listPersistedQueries(@NotNull @NotNull java.lang.String configurationName)
configurationName - the configuration name to list queries forPersistedQuerysAEMHeadlessClientException - if the persisted queries cannot be
retrieved@NotNull public @NotNull GraphQlResponse runPersistedQuery(@NotNull @NotNull PersistedQuery persistedQuery)
persistedQuery - a PersistedQuery as retrieved by
listPersistedQueries(String).GraphQlResponseAEMHeadlessClientException - if the persisted query cannot be executed@NotNull public @NotNull GraphQlResponse runPersistedQuery(@NotNull @NotNull PersistedQuery persistedQuery, java.util.Map<java.lang.String,java.lang.Object> variables)
persistedQuery - a PersistedQuery as retrieved by
listPersistedQueries(String)variables - variables for the persisted queryGraphQlResponseAEMHeadlessClientException - if the persisted query cannot be executed@NotNull public @NotNull GraphQlResponse runPersistedQuery(@NotNull @NotNull java.lang.String persistedQueryPath)
persistedQueryPath - the persisted query path, e.g.
/myproj/myqueryGraphQlResponseAEMHeadlessClientException - if the persisted query cannot be executed@NotNull public @NotNull GraphQlResponse runPersistedQuery(@NotNull @NotNull java.lang.String persistedQueryPath, java.util.Map<java.lang.String,java.lang.Object> variables)
persistedQueryPath - the persisted query path, e.g.
/myproj/myqueryvariables - variables for the persisted queryGraphQlResponseAEMHeadlessClientException - if the persisted query cannot be executed@NotNull public @NotNull PersistedQuery persistQuery(@NotNull @NotNull java.lang.String queryToPersist, @NotNull @NotNull java.lang.String persistedQueryPath)
queryToPersist - the querypersistedQueryPath - the path to persist the query, e.g.
/myproj/myqueryPersistedQueryAEMHeadlessClientException - if the query cannot be persistedCopyright © 2021 Adobe. All rights reserved.