Package org.infinispan.client.rest
Interface RestCacheClient
- All Known Implementing Classes:
RestCacheClientOkHttp
public interface RestCacheClient
- Since:
- 10.0
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
Method Summary
Modifier and TypeMethodDescriptionbackupStatus(String site) bringSiteOnline(String site) Bring back a backup site onlinecancelPushState(String site) Cancels the state pushcancelReceiveState(String site) Cancel the receiving state on a backup siteclear()Clears a cacheDeletes all the indexes from the cache.Clear the status of a state push in a siteDeprecated.Clear search stats.default CompletionStage<RestResponse>Retrieves the cache configurationconfiguration(String mediaType) Retrieves the cache configuration with a specific MediaType or list of MediaTypes.Retrieves all available configuration attributes for this cacheconfigurationAttributes(boolean full) Retrieves all available configuration attributes for this cache optionally including values and typesconnectSource(RestEntity remoteStoreJsonConfig) Connects the target cluster to a source cluster before a Rolling UpgradecreateWithConfiguration(RestEntity configuration, org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags) Creates the cache using the supplied configurationcreateWithTemplate(String template, org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags) Creates the cache using the supplied template namedelete()Removes the cachedetails()Obtains details about the cacheDisables automatic rebalancing for the cache.Disconnects the target cluster from the source cluster after a Rolling UpgradeObtain metrics about the distribution of data of the cache.Enables automatic rebalancing for the cache.default CompletionStage<RestResponse>entries()Retrieves entries without metadataentries(boolean contentNegotiation) Retrieves entries without metadataentries(int limit) Retrieves entries limited by countentries(int limit, boolean metadata) Retrieves entries with limit and metadataexists()Check if the cache existsGETs a key from the cacheGETs a key from the cache with a specific MediaType or list of MediaTypes.Same asget(String, String)but with an option to return extended headers.Same asget(String)but allowing custom headers.Retrieves the Cache's Availability status.Get the configuration used to automatically take a backup site offlineSimilar toget(String)but only retrieves headersSimilar tohead(String)but allowing custom headersObtains the index metamodel for the current cache.Deprecated.UsesearchStats()instead.keys()Retrieve all keyskeys(int limit) Retrieve keys limited by countRetrieves all keys from the cache with a specific MediaType or list of MediaTypes.name()Returns the name of the cachePOSTs a key/value to the cache as text/plainPOSTs a key/value to the cache as text/plain with the specified expirationpost(String key, RestEntity value) POSTs a key/value to the cache with the specified encodingpost(String key, RestEntity value, long ttl, long maxIdle) POSTs a key/value to the cache with the specified encoding and expirationpushSiteState(String site) Starts the state push to a backup siteObtain the status of a state push to a backup sitePUTs a key/value to the cache as text/plainPUTs a key/value to the cache as text/plain with the specified expirationput(String key, String keyContentType, RestEntity value) PUT a key/value to the cache with custom media types for keys and valuesput(String key, String keyContentType, RestEntity value, long ttl, long maxIdle) PUT an entry with metadata.Same asput(String, String, RestEntity)but allowing custom headers.put(String key, RestEntity value) PUTs a key/value to the cache with the specified encodingput(String key, RestEntity value, long ttl, long maxIdle) PUTs a key/value to the cache with the specified encoding and expirationput(String key, RestEntity value, String... flags) Same asput(String, RestEntity)also allowing one or moreorg.infinispan.context.Flagto be passed.default CompletionStage<RestResponse>Executes an Ickle-queryExecutes an Ickle-queryExecutes an Ickle-queryExecutes an Ickle-queryDeprecated.UsesearchStats()instead.reindex()Rebuild the search indexes of the cache based on its data.Same asreindex()but only considers data from the local cluster member.DELETEs an entry from the cacheSame asremove(String)but allowing custom headersObtain query and indexing statistics for the cache.setAvailability(String availability) Sets the Cache's Avaialabilitysize()Obtains the total number of elements in the cacheChecks if the cache is connected through a remote store to perform rolling upgradesReturn the remote store configuration in case the case has been connected to another cluster usingconnectSource(RestEntity)stats()Obtains statistics for the cacheExecute a Rolling Upgrade processing using defaults.synchronizeData(Integer readBatch, Integer threads) Execute a Rolling Upgrade processingtakeSiteOffline(String site) Take a backup site offlineupdateConfigurationAttribute(String attribute, String value) Updates a configuration attribute.Update index schema for the current cache.updateWithConfiguration(RestEntity configuration, org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags) Updates the cache configurationupdateXSiteTakeOfflineConfig(String site, int afterFailures, long minTimeToWait) Updates the configuration used to automatically take a backup site offlinexSiteStateTransferMode(String site) Returns the cross-site replication state transfer mode.xSiteStateTransferMode(String site, org.infinispan.configuration.cache.XSiteStateTransferMode mode) Sets the cross-site replication state transfer mode.
-
Method Details
-
name
String name()Returns the name of the cache -
keys
CompletionStage<RestResponse> keys()Retrieve all keys- Returns:
- Response with inputStream to get all the keys
-
keys
Retrieve keys limited by count- Parameters:
limit- The maximum number of keys to retrieve- Returns:
- Response with InputStream to get the keys
-
entries
Retrieves entries without metadata- Returns:
- Response with InputStream to get the entries
-
entries
Retrieves entries without metadata- Parameters:
contentNegotiation- if true, the server will convert keys and values to a readable format and return headers with the negotiated media type.- Returns:
- Response with InputStream to get the entries
-
entries
Retrieves entries limited by count- Parameters:
limit- : The maximum number of entries to retrieve, or -1 to retrieve all
-
entries
Retrieves entries with limit and metadata- Parameters:
limit- : The maximum number of entries to retrieve, or -1 to retrieve allmetadata- : if true, includes the metadata for each entry
-
keys
Retrieves all keys from the cache with a specific MediaType or list of MediaTypes. -
configuration
Retrieves the cache configuration -
configuration
Retrieves the cache configuration with a specific MediaType or list of MediaTypes. -
clear
CompletionStage<RestResponse> clear()Clears a cache -
size
CompletionStage<RestResponse> size()Obtains the total number of elements in the cache -
post
POSTs a key/value to the cache as text/plain- Parameters:
key-value-- Returns:
-
post
POSTs a key/value to the cache as text/plain with the specified expiration- Parameters:
key-value-ttl-maxIdle-- Returns:
-
post
POSTs a key/value to the cache with the specified encoding- Parameters:
key-value-- Returns:
-
post
POSTs a key/value to the cache with the specified encoding and expiration- Parameters:
key-value-ttl-maxIdle-- Returns:
-
put
PUTs a key/value to the cache as text/plain- Parameters:
key-value-- Returns:
-
put
PUT a key/value to the cache with custom media types for keys and values -
put
CompletionStage<RestResponse> put(String key, String keyContentType, RestEntity value, Map<String, String> headers) Same asput(String, String, RestEntity)but allowing custom headers. -
put
CompletionStage<RestResponse> put(String key, String keyContentType, RestEntity value, long ttl, long maxIdle) PUT an entry with metadata.- Parameters:
key- The keykeyContentType- TheMediaTypeof the keyvalue- aRestEntitycontaining the value and its MediaTypettl- The time to live valuemaxIdle- The max idle value- Returns:
-
put
PUTs a key/value to the cache as text/plain with the specified expiration- Parameters:
key-value-ttl-maxIdle-- Returns:
-
put
PUTs a key/value to the cache with the specified encoding- Parameters:
key-value-- Returns:
-
put
Same asput(String, RestEntity)also allowing one or moreorg.infinispan.context.Flagto be passed. -
put
PUTs a key/value to the cache with the specified encoding and expiration- Parameters:
key-value-ttl-maxIdle-- Returns:
-
get
GETs a key from the cache- Parameters:
key-- Returns:
-
get
Same asget(String)but allowing custom headers. -
get
GETs a key from the cache with a specific MediaType or list of MediaTypes. -
get
Same asget(String, String)but with an option to return extended headers. -
head
Similar toget(String)but only retrieves headers- Parameters:
key-- Returns:
-
head
Similar tohead(String)but allowing custom headers -
remove
DELETEs an entry from the cache- Parameters:
key-- Returns:
-
remove
Same asremove(String)but allowing custom headers -
createWithTemplate
CompletionStage<RestResponse> createWithTemplate(String template, org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags) Creates the cache using the supplied template name- Parameters:
template- the name of a templateflags- any flags to apply to the create operation, e.g.CacheContainerAdmin.AdminFlag.VOLATILE- Returns:
-
stats
CompletionStage<RestResponse> stats()Obtains statistics for the cache- Returns:
-
distribution
CompletionStage<RestResponse> distribution()Obtain metrics about the distribution of data of the cache.- Returns:
-
createWithConfiguration
CompletionStage<RestResponse> createWithConfiguration(RestEntity configuration, org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags) Creates the cache using the supplied configuration- Parameters:
configuration- the configuration, in XML, JSON or YAML formatflags- any flags to apply to the create operation, e.g.CacheContainerAdmin.AdminFlag.VOLATILE- Returns:
-
updateWithConfiguration
CompletionStage<RestResponse> updateWithConfiguration(RestEntity configuration, org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags) Updates the cache configuration- Parameters:
configuration- the configuration, in XML, JSON or YAML formatflags- any flags to apply to the update operation, e.g.CacheContainerAdmin.AdminFlag.VOLATILE- Returns:
-
delete
CompletionStage<RestResponse> delete()Removes the cache- Returns:
-
query
Executes an Ickle-query- Parameters:
query- the ickle query
-
query
Executes an Ickle-query- Parameters:
query- the ickle querylocal- if true, query is restricted to the data present in the node that process the request.
-
query
Executes an Ickle-query- Parameters:
query- the ickle querymaxResults- the maximum number of results to returnoffset- the offset within the result from which to return results
-
query
Executes an Ickle-query- Parameters:
query- the ickle querymaxResults- the maximum number of results to returnoffset- the offset within the result from which to return resultshitCountAccuracy- the limit to the hit count accuracy to return sooner
-
xsiteBackups
CompletionStage<RestResponse> xsiteBackups()- Returns:
- the status of all backup sites
-
backupStatus
- Returns:
- the status of a single backup site
-
takeSiteOffline
Take a backup site offline -
bringSiteOnline
Bring back a backup site online -
pushSiteState
Starts the state push to a backup site -
cancelPushState
Cancels the state push -
cancelReceiveState
Cancel the receiving state on a backup site -
pushStateStatus
CompletionStage<RestResponse> pushStateStatus()Obtain the status of a state push to a backup site -
getXSiteTakeOfflineConfig
Get the configuration used to automatically take a backup site offline -
updateXSiteTakeOfflineConfig
CompletionStage<RestResponse> updateXSiteTakeOfflineConfig(String site, int afterFailures, long minTimeToWait) Updates the configuration used to automatically take a backup site offline -
clearPushStateStatus
CompletionStage<RestResponse> clearPushStateStatus()Clear the status of a state push in a site -
xSiteStateTransferMode
Returns the cross-site replication state transfer mode.- See Also:
-
XSiteStateTransferMode
-
xSiteStateTransferMode
CompletionStage<RestResponse> xSiteStateTransferMode(String site, org.infinispan.configuration.cache.XSiteStateTransferMode mode) Sets the cross-site replication state transfer mode.- See Also:
-
XSiteStateTransferMode
-
exists
CompletionStage<RestResponse> exists()Check if the cache exists -
synchronizeData
Execute a Rolling Upgrade processing -
synchronizeData
CompletionStage<RestResponse> synchronizeData()Execute a Rolling Upgrade processing using defaults. -
disconnectSource
CompletionStage<RestResponse> disconnectSource()Disconnects the target cluster from the source cluster after a Rolling Upgrade -
connectSource
Connects the target cluster to a source cluster before a Rolling Upgrade- Parameters:
remoteStoreJsonConfig- The remote-store config as JSON
-
sourceConnected
CompletionStage<RestResponse> sourceConnected()Checks if the cache is connected through a remote store to perform rolling upgrades -
sourceConnection
CompletionStage<RestResponse> sourceConnection()Return the remote store configuration in case the case has been connected to another cluster usingconnectSource(RestEntity) -
reindex
CompletionStage<RestResponse> reindex()Rebuild the search indexes of the cache based on its data. -
reindexLocal
CompletionStage<RestResponse> reindexLocal()Same asreindex()but only considers data from the local cluster member. -
clearIndex
CompletionStage<RestResponse> clearIndex()Deletes all the indexes from the cache. -
updateIndexSchema
CompletionStage<RestResponse> updateIndexSchema()Update index schema for the current cache. -
queryStats
Deprecated.UsesearchStats()instead.Obtain statistics about queries. -
indexStats
Deprecated.UsesearchStats()instead.Obtain statistics about the indexes. -
clearQueryStats
Deprecated.UsesearchStats()andclearSearchStats().Clear runtime query statistics. -
details
CompletionStage<RestResponse> details()Obtains details about the cache -
indexMetamodel
CompletionStage<RestResponse> indexMetamodel()Obtains the index metamodel for the current cache. The query has to be indexed.- Returns:
- the stage of the response containing the metamodel of the index
-
searchStats
CompletionStage<RestResponse> searchStats()Obtain query and indexing statistics for the cache. -
clearSearchStats
CompletionStage<RestResponse> clearSearchStats()Clear search stats. -
enableRebalancing
CompletionStage<RestResponse> enableRebalancing()Enables automatic rebalancing for the cache. -
disableRebalancing
CompletionStage<RestResponse> disableRebalancing()Disables automatic rebalancing for the cache. -
updateConfigurationAttribute
Updates a configuration attribute. -
configurationAttributes
CompletionStage<RestResponse> configurationAttributes()Retrieves all available configuration attributes for this cache -
configurationAttributes
Retrieves all available configuration attributes for this cache optionally including values and types -
getAvailability
CompletionStage<RestResponse> getAvailability()Retrieves the Cache's Availability status. -
setAvailability
Sets the Cache's Avaialability
-
searchStats()andclearSearchStats().