Package io.lionweb.repoclient
Class LionWebRepoClient
java.lang.Object
io.lionweb.repoclient.LionWebRepoClient
- All Implemented Interfaces:
BulkAPIClient
,DBAdminAPIClient
,HistoryAPIClient
,InspectionAPIClient
,RawBulkAPIClient
- Direct Known Subclasses:
ExtendedLionWebRepoClient
public class LionWebRepoClient
extends Object
implements RawBulkAPIClient, BulkAPIClient, DBAdminAPIClient, InspectionAPIClient, HistoryAPIClient
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLionWebRepoClient
(@NotNull LionWebVersion lionWebVersion, @NotNull String hostname, int port, @Nullable String authorizationToken, @NotNull String clientID, @NotNull String repository, long connectTimeoutInSeconds, long callTimeoutInSeconds) LionWebRepoClient
(@NotNull LionWebVersion lionWebVersion, String hostname, int port, String repository) -
Method Summary
Modifier and TypeMethodDescriptionprotected RepoClientConfiguration
void
Trigger the creation of the database, according to the configuration provided on the server side.@Nullable RepositoryVersionToken
createPartition
(@NotNull Node partition) @Nullable RepositoryVersionToken
createPartitions
(List<Node> partitions) void
createRepository
(@NotNull RepositoryConfiguration repositoryConfiguration) @Nullable RepositoryVersionToken
deletePartitions
(List<String> ids) void
deleteRepository
(@NotNull String repositoryName) @NotNull JsonSerialization
@NotNull LionWebVersion
ids
(int count) listPartitions
(RepositoryVersionToken repoVersion) @NotNull Set<RepositoryConfiguration>
nodesByClassifier
(@Nullable Integer limit) nodesByLanguage
(@Nullable Integer limit) @Nullable RepositoryVersionToken
rawCreatePartitions
(@NotNull String data) @NotNull String
rawRetrieve
(@NotNull List<String> nodeIds, int limit) @Nullable RepositoryVersionToken
@NotNull Node
retrieve
(RepositoryVersionToken repoVersion, List<String> nodeIds, int limit) @Nullable RepositoryVersionToken
@Nullable RepositoryVersionToken
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.lionweb.repoclient.api.HistoryAPIClient
retrieve, retrieve
Methods inherited from interface io.lionweb.repoclient.api.InspectionAPIClient
nodesByClassifier, nodesByLanguage
Methods inherited from interface io.lionweb.repoclient.api.RawBulkAPIClient
rawRetrieve
-
Field Details
-
JSON
protected static final okhttp3.MediaType JSON -
protocol
-
hostname
-
port
protected final int port -
authorizationToken
-
clientID
-
repository
-
httpClient
protected final okhttp3.OkHttpClient httpClient -
jsonSerialization
-
-
Constructor Details
-
LionWebRepoClient
public LionWebRepoClient(@NotNull @NotNull LionWebVersion lionWebVersion, String hostname, int port, String repository) -
LionWebRepoClient
public LionWebRepoClient(@NotNull @NotNull LionWebVersion lionWebVersion, @NotNull @NotNull String hostname, int port, @Nullable @Nullable String authorizationToken, @NotNull @NotNull String clientID, @NotNull @NotNull String repository, long connectTimeoutInSeconds, long callTimeoutInSeconds)
-
-
Method Details
-
buildRepositoryConfiguration
-
getJsonSerialization
-
rawCreatePartitions
@Nullable public @Nullable RepositoryVersionToken rawCreatePartitions(@NotNull @NotNull String data) throws IOException - Specified by:
rawCreatePartitions
in interfaceRawBulkAPIClient
- Throws:
IOException
-
rawStore
@Nullable public @Nullable RepositoryVersionToken rawStore(@NotNull @NotNull String nodes) throws IOException - Specified by:
rawStore
in interfaceRawBulkAPIClient
- Throws:
IOException
-
rawRetrieve
@NotNull public @NotNull String rawRetrieve(@NotNull @NotNull List<String> nodeIds, int limit) throws IOException - Specified by:
rawRetrieve
in interfaceRawBulkAPIClient
- Throws:
IOException
-
createPartitions
@Nullable public @Nullable RepositoryVersionToken createPartitions(List<Node> partitions) throws IOException - Specified by:
createPartitions
in interfaceBulkAPIClient
- Throws:
IOException
-
createPartition
@Nullable public @Nullable RepositoryVersionToken createPartition(@NotNull @NotNull Node partition) throws IOException - Throws:
IOException
-
deletePartitions
@Nullable public @Nullable RepositoryVersionToken deletePartitions(List<String> ids) throws IOException - Specified by:
deletePartitions
in interfaceBulkAPIClient
- Throws:
IOException
-
listPartitions
- Specified by:
listPartitions
in interfaceBulkAPIClient
- Throws:
IOException
-
listPartitionsIDs
- Specified by:
listPartitionsIDs
in interfaceBulkAPIClient
- Throws:
IOException
-
ids
- Specified by:
ids
in interfaceBulkAPIClient
- Throws:
IOException
-
store
- Specified by:
store
in interfaceBulkAPIClient
- Throws:
IOException
-
store
@Nullable public @Nullable RepositoryVersionToken store(@NotNull @NotNull Node node) throws IOException - Throws:
IOException
-
retrieve
- Throws:
IOException
-
retrieve
- Throws:
IOException
-
retrieve
- Specified by:
retrieve
in interfaceBulkAPIClient
- Throws:
IOException
-
getLionWebVersion
- Specified by:
getLionWebVersion
in interfaceBulkAPIClient
- Specified by:
getLionWebVersion
in interfaceRawBulkAPIClient
-
createRepository
public void createRepository(@NotNull @NotNull RepositoryConfiguration repositoryConfiguration) throws IOException - Specified by:
createRepository
in interfaceDBAdminAPIClient
- Throws:
IOException
-
deleteRepository
- Specified by:
deleteRepository
in interfaceDBAdminAPIClient
- Throws:
IOException
-
createDatabase
Description copied from interface:DBAdminAPIClient
Trigger the creation of the database, according to the configuration provided on the server side. In other words, we cannot dictate the name of the configuration of the database, just triggers its creation.- Specified by:
createDatabase
in interfaceDBAdminAPIClient
- Throws:
IOException
-
listRepositories
- Specified by:
listRepositories
in interfaceDBAdminAPIClient
- Throws:
IOException
-
nodesByClassifier
public Map<ClassifierKey,ClassifierResult> nodesByClassifier(@Nullable @Nullable Integer limit) throws IOException - Specified by:
nodesByClassifier
in interfaceInspectionAPIClient
- Throws:
IOException
-
nodesByLanguage
public Map<String,ClassifierResult> nodesByLanguage(@Nullable @Nullable Integer limit) throws IOException - Specified by:
nodesByLanguage
in interfaceInspectionAPIClient
- Throws:
IOException
-
listPartitions
- Specified by:
listPartitions
in interfaceHistoryAPIClient
- Throws:
IOException
-
retrieve
public List<Node> retrieve(RepositoryVersionToken repoVersion, List<String> nodeIds, int limit) throws IOException - Specified by:
retrieve
in interfaceHistoryAPIClient
- Throws:
IOException
-