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 RepoClientConfigurationvoidTrigger the creation of the database, according to the configuration provided on the server side.@Nullable RepositoryVersionTokencreatePartition(@NotNull Node partition) @Nullable RepositoryVersionTokencreatePartitions(List<Node> partitions) voidcreateRepository(@NotNull RepositoryConfiguration repositoryConfiguration) @Nullable RepositoryVersionTokendeletePartitions(List<String> ids) voiddeleteRepository(@NotNull String repositoryName) @NotNull JsonSerialization@NotNull LionWebVersionids(int count) listPartitions(RepositoryVersionToken repoVersion) @NotNull Set<RepositoryConfiguration>nodesByClassifier(@Nullable Integer limit) nodesByLanguage(@Nullable Integer limit) @Nullable RepositoryVersionTokenrawCreatePartitions(@NotNull String data) @NotNull StringrawRetrieve(@NotNull List<String> nodeIds, int limit) @Nullable RepositoryVersionToken@NotNull Noderetrieve(RepositoryVersionToken repoVersion, List<String> nodeIds, int limit) @Nullable RepositoryVersionToken@Nullable RepositoryVersionTokenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.lionweb.repoclient.api.HistoryAPIClient
retrieve, retrieveMethods inherited from interface io.lionweb.repoclient.api.InspectionAPIClient
nodesByClassifier, nodesByLanguageMethods 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:
rawCreatePartitionsin interfaceRawBulkAPIClient- Throws:
IOException
-
rawStore
@Nullable public @Nullable RepositoryVersionToken rawStore(@NotNull @NotNull String nodes) throws IOException - Specified by:
rawStorein interfaceRawBulkAPIClient- Throws:
IOException
-
rawRetrieve
@NotNull public @NotNull String rawRetrieve(@NotNull @NotNull List<String> nodeIds, int limit) throws IOException - Specified by:
rawRetrievein interfaceRawBulkAPIClient- Throws:
IOException
-
createPartitions
@Nullable public @Nullable RepositoryVersionToken createPartitions(List<Node> partitions) throws IOException - Specified by:
createPartitionsin 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:
deletePartitionsin interfaceBulkAPIClient- Throws:
IOException
-
listPartitions
- Specified by:
listPartitionsin interfaceBulkAPIClient- Throws:
IOException
-
listPartitionsIDs
- Specified by:
listPartitionsIDsin interfaceBulkAPIClient- Throws:
IOException
-
ids
- Specified by:
idsin interfaceBulkAPIClient- Throws:
IOException
-
store
- Specified by:
storein 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:
retrievein interfaceBulkAPIClient- Throws:
IOException
-
getLionWebVersion
- Specified by:
getLionWebVersionin interfaceBulkAPIClient- Specified by:
getLionWebVersionin interfaceRawBulkAPIClient
-
createRepository
public void createRepository(@NotNull @NotNull RepositoryConfiguration repositoryConfiguration) throws IOException - Specified by:
createRepositoryin interfaceDBAdminAPIClient- Throws:
IOException
-
deleteRepository
- Specified by:
deleteRepositoryin interfaceDBAdminAPIClient- Throws:
IOException
-
createDatabase
Description copied from interface:DBAdminAPIClientTrigger 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:
createDatabasein interfaceDBAdminAPIClient- Throws:
IOException
-
listRepositories
- Specified by:
listRepositoriesin interfaceDBAdminAPIClient- Throws:
IOException
-
nodesByClassifier
public Map<ClassifierKey,ClassifierResult> nodesByClassifier(@Nullable @Nullable Integer limit) throws IOException - Specified by:
nodesByClassifierin interfaceInspectionAPIClient- Throws:
IOException
-
nodesByLanguage
public Map<String,ClassifierResult> nodesByLanguage(@Nullable @Nullable Integer limit) throws IOException - Specified by:
nodesByLanguagein interfaceInspectionAPIClient- Throws:
IOException
-
listPartitions
- Specified by:
listPartitionsin interfaceHistoryAPIClient- Throws:
IOException
-
retrieve
public List<Node> retrieve(RepositoryVersionToken repoVersion, List<String> nodeIds, int limit) throws IOException - Specified by:
retrievein interfaceHistoryAPIClient- Throws:
IOException
-