public class ServerClient extends Object implements IDatabaseCommands
Modifier and Type | Class and Description |
---|---|
static class |
ServerClient.ErrorObjectProtoTransformer |
class |
ServerClient.HandleReplicationStatusChangesCallback |
static class |
ServerClient.IndexErrorObjectProto |
Modifier and Type | Field and Description |
---|---|
protected HttpJsonRequestFactory |
jsonRequestFactory |
protected Map<String,String> |
operationsHeaders |
protected int |
readStripingBase |
protected int |
requestCount |
protected String |
url |
Constructor and Description |
---|
ServerClient(String url,
DocumentConvention convention,
OperationCredentials credentials,
HttpJsonRequestFactory httpJsonRequestFactory,
UUID sessionId,
Function1<String,IDocumentStoreReplicationInformer> replicationInformerGetter,
String databaseName,
IDocumentConflictListener[] conflictListeners,
boolean incrementReadStripe) |
Modifier and Type | Method and Description |
---|---|
void |
addFailoverStatusChanged(EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs> event) |
BatchResult[] |
batch(List<ICommandData> commandDatas)
Sends multiple operations in a single request, reducing the number of remote calls and allowing several operations to share same transaction
|
HttpJsonRequest |
createReplicationAwareRequest(String currentServerUrl,
String requestUrl,
HttpMethods method) |
HttpJsonRequest |
createReplicationAwareRequest(String currentServerUrl,
String requestUrl,
HttpMethods method,
boolean disableRequestCompression) |
HttpJsonRequest |
createRequest(HttpMethods method,
String requestUrl)
Internal use
|
HttpJsonRequest |
createRequest(HttpMethods method,
String requestUrl,
boolean disableRequestCompression,
boolean disableAuthentication,
Long timeout) |
void |
delete(String key,
Etag etag)
Deletes the document with the specified key
|
void |
deleteAttachment(String key,
Etag etag)
Deprecated.
|
Operation |
deleteByIndex(String indexName,
IndexQuery queryToDelete)
Perform a set based deletes using the specified index
|
Operation |
deleteByIndex(String indexName,
IndexQuery queryToDelete,
BulkOperationOptions options)
Perform a set based deletes using the specified index
|
void |
deleteIndex(String name)
Deletes the specified index
|
void |
deleteTransformer(String name)
Deletes the specified transformer
|
protected BatchResult[] |
directBatch(List<ICommandData> commandDatas,
OperationMetadata operationMetadata) |
protected void |
directDelete(OperationMetadata operationMetadata,
String key,
Etag etag) |
protected void |
directDeleteAttachment(String key,
Etag etag,
OperationMetadata operationMetadata)
Deprecated.
|
protected Operation |
directDeleteByIndex(OperationMetadata operationMetadata,
String indexName,
IndexQuery queryToDelete,
BulkOperationOptions options) |
protected void |
directDeleteIndex(String name,
OperationMetadata operationMetadata) |
protected void |
directDeleteTransformer(String name,
OperationMetadata operationMetadata) |
JsonDocument |
directGet(OperationMetadata operationMetadata,
String key) |
protected MultiLoadResult |
directGet(String[] ids,
OperationMetadata operationMetadata,
String[] includes,
String transformer,
Map<String,RavenJToken> transformerParameters,
boolean metadataOnly) |
protected Attachment |
directGetAttachment(HttpMethods method,
String key,
OperationMetadata operationMetadata)
Deprecated.
|
protected List<Attachment> |
directGetAttachmentHeadersStartingWith(HttpMethods method,
String idPrefix,
int start,
int pageSize,
OperationMetadata operationMetadata)
Deprecated.
|
protected AttachmentInformation[] |
directGetAttachments(int start,
Etag startEtag,
int pageSize,
OperationMetadata operationMetadata)
Deprecated.
|
protected FacetResults |
directGetFacets(OperationMetadata operationMetadata,
String index,
IndexQuery query,
String facetSetupDoc,
int start,
Integer pageSize) |
protected FacetResults |
directGetFacets(OperationMetadata operationMetadata,
String index,
IndexQuery query,
String facetsJson,
int start,
Integer pageSize,
HttpMethods method) |
protected IndexDefinition |
directGetIndex(String indexName,
OperationMetadata operationMetadata) |
protected Collection<IndexDefinition> |
directGetIndexes(int start,
int pageSize,
OperationMetadata operationMetadata) |
protected Collection<String> |
directGetIndexNames(int start,
int pageSize,
OperationMetadata operationMetadata) |
ReplicationDocument |
directGetReplicationDestinations(OperationMetadata operationMetadata) |
protected List<String> |
directGetTerms(OperationMetadata operationMetadata,
String index,
String field,
String fromValue,
int pageSize) |
protected TransformerDefinition |
directGetTransformer(String transformerName,
OperationMetadata operationMetadata) |
protected List<TransformerDefinition> |
directGetTransformers(OperationMetadata operationMetadata,
int start,
int pageSize) |
protected JsonDocumentMetadata |
directHead(OperationMetadata operationMetadata,
String key) |
protected Boolean |
directIndexHasChanged(String name,
IndexDefinition definition,
OperationMetadata operationMetadata) |
protected GetResponse[] |
directMultiGetInternal(OperationMetadata operationMetadata,
GetRequest[] requests,
Reference<OperationMetadata> operationMetadataRef) |
protected Long |
directNextIdentityFor(String name,
OperationMetadata operationMetadata) |
protected PutResult |
directPut(RavenJObject metadata,
String key,
Etag etag,
RavenJObject document,
OperationMetadata operationMetadata) |
protected void |
directPutAttachment(String key,
RavenJObject metadata,
Etag etag,
InputStream data,
OperationMetadata operationMetadata)
Deprecated.
|
String |
directPutIndex(String name,
IndexDefinition definition,
boolean overwrite,
OperationMetadata operationMetadata) |
String |
directPutTransformer(String name,
OperationMetadata operationMetadata,
TransformerDefinition definition) |
protected QueryResult |
directQueryAsGet(String index,
IndexQuery query,
OperationMetadata operationMetadata,
String[] includes,
boolean metadataOnly,
boolean includeEntries) |
protected QueryResult |
directQueryAsPost(String index,
IndexQuery query,
OperationMetadata operationMetadata,
String[] includes,
boolean metadataOnly,
boolean indexEntriesOnly) |
protected void |
directResetIndex(String name,
OperationMetadata operationMetadata) |
protected void |
directSetIndexLock(String name,
IndexLockMode lockMode,
OperationMetadata operationMetadata) |
protected void |
directSetIndexPriority(String name,
IndexStats.IndexingPriority priority,
OperationMetadata operationMetadata) |
protected List<JsonDocument> |
directStartsWith(OperationMetadata operationMetadata,
String keyPrefix,
String matches,
int start,
int pageSize,
boolean metadataOnly,
String exclude,
RavenPagingInformation pagingInformation,
String transformer,
Map<String,RavenJToken> transformerParameters,
String skipAfter) |
RavenJObjectIterator |
directStreamDocs(OperationMetadata operationMetadata,
Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation,
String skipAfter) |
RavenJObjectIterator |
directStreamQuery(OperationMetadata operationMetadata,
String index,
IndexQuery query,
Reference<QueryHeaderInformation> queryHeaderInfo) |
protected SuggestionQueryResult |
directSuggest(String index,
SuggestionQuery suggestionQuery,
OperationMetadata operationMetadata) |
protected void |
directUpdateAttachmentMetadata(String key,
RavenJObject metadata,
Etag etag,
OperationMetadata operationMetadata)
Deprecated.
|
protected Operation |
directUpdateByIndexImpl(OperationMetadata operationMetadata,
String indexName,
IndexQuery queryToUpdate,
BulkOperationOptions options,
String requestData,
HttpMethods method) |
CleanCloseable |
disableAllCaching()
Disable all caching within the given scope
|
RavenJToken |
executeGetRequest(String requestUrl) |
<S> S |
executeWithReplication(HttpMethods method,
Function1<OperationMetadata,S> operation) |
protected ConcurrencyException |
fetchConcurrencyException(ErrorResponseException e) |
CleanCloseable |
forceReadFromMaster()
Force the database commands to read directly from the master, unless there has been a failover.
|
IDatabaseCommands |
forDatabase(String database)
Create a new instance of
IDatabaseCommands that will interacts with the specified database |
IDatabaseCommands |
forSystemDatabase()
Creates a new instance of
IDatabaseCommands that will interacts with the default database. |
JsonDocument |
get(String key)
Retrieve a single document for a specified key.
|
MultiLoadResult |
get(String[] ids,
String[] includes)
Retrieves documents with the specified ids, optionally specifying includes to fetch along and also optionally the transformer.
|
MultiLoadResult |
get(String[] ids,
String[] includes,
String transformer)
Retrieves documents with the specified ids, optionally specifying includes to fetch along and also optionally the transformer.
|
MultiLoadResult |
get(String[] ids,
String[] includes,
String transformer,
Map<String,RavenJToken> transformerParameters)
Retrieves documents with the specified ids, optionally specifying includes to fetch along and also optionally the transformer.
|
MultiLoadResult |
get(String[] ids,
String[] includes,
String transformer,
Map<String,RavenJToken> transformerParameters,
boolean metadataOnly)
Retrieves documents with the specified ids, optionally specifying includes to fetch along and also optionally the transformer.
|
IAdminDatabaseCommands |
getAdmin()
Admin operations for current database
|
Attachment |
getAttachment(String key)
Deprecated.
|
List<Attachment> |
getAttachmentHeadersStartingWith(String idPrefix,
int start,
int pageSize)
Deprecated.
|
AttachmentInformation[] |
getAttachments(int start,
Etag startEtag,
int pageSize)
Deprecated.
|
BuildNumber |
getBuildNumber()
Gets the build number
|
ILowLevelBulkInsertOperation |
getBulkInsertOperation(BulkInsertOptions options,
IDatabaseChanges changes)
Get the low level bulk insert operation
|
List<JsonDocument> |
getDocuments(Etag fromEtag,
int pageSize)
Retrieves multiple documents.
|
List<JsonDocument> |
getDocuments(Etag fromEtag,
int pageSize,
boolean metadataOnly)
Retrieves multiple documents.
|
List<JsonDocument> |
getDocuments(int start,
int pageSize)
Retrieves multiple documents.
|
List<JsonDocument> |
getDocuments(int start,
int pageSize,
boolean metadataOnly)
Retrieves multiple documents.
|
FacetResults |
getFacets(String index,
IndexQuery query,
List<Facet> facets)
Using the given Index, calculate the facets as per the specified doc with the given start and pageSize
|
FacetResults |
getFacets(String index,
IndexQuery query,
List<Facet> facets,
int start)
Using the given Index, calculate the facets as per the specified doc with the given start and pageSize
|
FacetResults |
getFacets(String index,
IndexQuery query,
List<Facet> facets,
int start,
Integer pageSize)
Using the given Index, calculate the facets as per the specified doc with the given start and pageSize
|
FacetResults |
getFacets(String index,
IndexQuery query,
String facetSetupDoc)
Using the given Index, calculate the facets as per the specified doc with the given start and pageSize
|
FacetResults |
getFacets(String index,
IndexQuery query,
String facetSetupDoc,
int start)
Using the given Index, calculate the facets as per the specified doc with the given start and pageSize
|
FacetResults |
getFacets(String index,
IndexQuery query,
String facetSetupDoc,
int start,
Integer pageSize)
Using the given Index, calculate the facets as per the specified doc with the given start and pageSize
|
IGlobalAdminDatabaseCommands |
getGlobalAdmin()
Admin operations performed against system database, like create/delete database
|
IndexDefinition |
getIndex(String name)
Retrieves an index definition from a database.
|
Collection<IndexDefinition> |
getIndexes(int start,
int pageSize)
Retrieves multiple index definitions from a database
|
IndexMergeResults |
getIndexMergeSuggestions()
Retrieves all suggestions for an index merging
|
Collection<String> |
getIndexNames(int start,
int pageSize)
Retrieves multiple index names from a database.
|
HttpJsonRequestFactory |
getJsonRequestFactory() |
LicensingStatus |
getLicenseStatus()
Gets the license status
|
LogItem[] |
getLogs(boolean errorsOnly)
Gets the Logs
|
FacetResults[] |
getMultiFacets(FacetQuery[] facetedQueries)
Sends a multiple faceted queries in a single request and calculates the facet results for each of them
|
Map<String,String> |
getOperationsHeaders()
Gets the operations headers
|
RavenJToken |
getOperationStatus(long id) |
OperationCredentials |
getPrimaryCredentials()
Primary credentials for access.
|
ProfilingInformation |
getProfilingInformation()
The profiling information
|
ReplicationStatistics |
getReplicationInfo()
Get replication info
|
IDocumentStoreReplicationInformer |
getReplicationInformer() |
DatabaseStatistics |
getStatistics()
Retrieve the statistics for the database
|
List<String> |
getTerms(String index,
String field,
String fromValue,
int pageSize)
Get the all terms stored in the index for the specified field
You can page through the results by use fromValue parameter as the
starting point for the next query
|
TransformerDefinition |
getTransformer(String name)
Gets the transformer definition for the specified name
|
List<TransformerDefinition> |
getTransformers(int start,
int pageSize)
Gets the transformers from the server
|
String |
getUrl() |
protected void |
handleReplicationStatusChanges(Map<String,String> headers,
String primaryUrl,
String currentUrl) |
JsonDocumentMetadata |
head(String key)
Retrieves the document metadata for the specified document key.
|
Attachment |
headAttachment(String key)
Deprecated.
|
boolean |
indexHasChanged(String name,
IndexDefinition definition)
Lets you check if the given index definition differs from the one on a server.
|
boolean |
isExpect100Continue()
Is expect 100 continue?
|
boolean |
isInFailoverMode() |
MultiLoadResult |
moreLikeThis(MoreLikeThisQuery query)
Return a list of documents that based on the MoreLikeThisQuery.
|
GetResponse[] |
multiGet(GetRequest[] requests)
Perform a single POST request containing multiple nested GET requests
|
Long |
nextIdentityFor(String name)
Generate the next identity value from the server
|
RavenJObject |
patch(String key,
PatchRequest[] patches)
Sends a patch request for a specific document, ignoring the document's Etag and if the document is missing
|
RavenJObject |
patch(String key,
PatchRequest[] patches,
boolean ignoreMissing)
Sends a patch request for a specific document, ignoring the document's Etag
|
RavenJObject |
patch(String key,
PatchRequest[] patches,
Etag etag)
Sends a patch request for a specific document
|
RavenJObject |
patch(String key,
PatchRequest[] patchesToExisting,
PatchRequest[] patchesToDefault,
RavenJObject defaultMetadata)
Sends a patch request for a specific document which may or may not currently exist
|
RavenJObject |
patch(String key,
ScriptedPatchRequest patch)
Sends a patch request for a specific document, ignoring the document's Etag and if the document is missing
|
RavenJObject |
patch(String key,
ScriptedPatchRequest patch,
boolean ignoreMissing)
Sends a patch request for a specific document, ignoring the document's Etag
|
RavenJObject |
patch(String key,
ScriptedPatchRequest patch,
Etag etag)
Sends a patch request for a specific document
|
RavenJObject |
patch(String key,
ScriptedPatchRequest patchExisting,
ScriptedPatchRequest patchDefault,
RavenJObject defaultMetadata)
Sends a patch request for a specific document which may or may not currently exist
|
PutResult |
put(String key,
Etag etag,
RavenJObject document,
RavenJObject metadata)
Puts the document in the database with the specified key.
|
void |
putAttachment(String key,
Etag etag,
InputStream data,
RavenJObject metadata)
Deprecated.
|
String |
putIndex(String name,
IndexDefinition definition)
Creates an index with the specified name, based on an index definition
|
String |
putIndex(String name,
IndexDefinition definition,
boolean overwrite)
Creates an index with the specified name, based on an index definition
|
String |
putIndex(String name,
IndexDefinition definition,
boolean overwrite,
Reference<Operation> precomputeBatchOperation)
Creates an index with the specified name, based on an index definition
|
String |
putIndex(String name,
IndexDefinitionBuilder indexDef)
Creates an index with the specified name, based on an index definition that is created by the supplied IndexDefinitionBuilder
|
String |
putIndex(String name,
IndexDefinitionBuilder indexDef,
boolean overwrite)
Creates an index with the specified name, based on an index definition that is created by the supplied IndexDefinitionBuilder
|
String[] |
putIndexes(IndexToAdd[] indexesToAdd)
Creates multiple indexes with the specified name, using given index definitions and priorities
|
String[] |
putSideBySideIndexes(IndexToAdd[] indexesToAdd)
Creates multiple side by side indexes with the specified name, using given index definitions and priorities
|
String[] |
putSideBySideIndexes(IndexToAdd[] indexesToAdd,
Etag minimumEtagBeforeReplace,
Date replaceTimeUtc)
Creates multiple side by side indexes with the specified name, using given index definitions and priorities
|
String |
putTransformer(String name,
TransformerDefinition indexDef)
Creates a transformer with the specified name, based on an transformer definition
|
QueryResult |
query(String index,
IndexQuery query)
Queries the specified index in the Raven-flavored Lucene query syntax
|
QueryResult |
query(String index,
IndexQuery query,
String[] includes)
Queries the specified index in the Raven-flavored Lucene query syntax
|
QueryResult |
query(String index,
IndexQuery query,
String[] includes,
boolean metadataOnly)
Queries the specified index in the Raven-flavored Lucene query syntax
|
QueryResult |
query(String index,
IndexQuery query,
String[] includes,
boolean metadataOnly,
boolean indexEntriesOnly)
Queries the specified index in the Raven-flavored Lucene query syntax
|
void |
removeFailoverStatusChanged(EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs> event) |
void |
resetIndex(String name)
Removes all indexing data from a server for a given index so the indexation can start from scratch for that index.
|
long |
seedIdentityFor(String name,
long value)
Seeds the next identity value on the server
|
protected static String |
serializeFacetsToFacetsJsonString(List<Facet> facets) |
void |
setExpect100Continue(boolean expect100Continue) |
void |
setIndexLock(String name,
IndexLockMode lockMode)
Sets the index lock mode
|
void |
setIndexPriority(String name,
IndexStats.IndexingPriority priority)
Sets the index priority
|
void |
setOperationsHeaders(Map<String,String> operationsHeaders)
Sets the operations headers
|
void |
setTransformerLock(String name,
TransformerLockMode lockMode)
Sets the transformer's lock mode
|
List<JsonDocument> |
startsWith(String keyPrefix,
String matches,
int start,
int pageSize)
Retrieves documents for the specified key prefix.
|
List<JsonDocument> |
startsWith(String keyPrefix,
String matches,
int start,
int pageSize,
boolean metadataOnly)
Retrieves documents for the specified key prefix.
|
List<JsonDocument> |
startsWith(String keyPrefix,
String matches,
int start,
int pageSize,
boolean metadataOnly,
String exclude)
Retrieves documents for the specified key prefix.
|
List<JsonDocument> |
startsWith(String keyPrefix,
String matches,
int start,
int pageSize,
boolean metadataOnly,
String exclude,
RavenPagingInformation pagingInformation)
Retrieves documents for the specified key prefix.
|
List<JsonDocument> |
startsWith(String keyPrefix,
String matches,
int start,
int pageSize,
boolean metadataOnly,
String exclude,
RavenPagingInformation pagingInformation,
String transformer,
Map<String,RavenJToken> transformerParameters)
Retrieves documents for the specified key prefix.
|
List<JsonDocument> |
startsWith(String keyPrefix,
String matches,
int start,
int pageSize,
boolean metadataOnly,
String exclude,
RavenPagingInformation pagingInformation,
String transformer,
Map<String,RavenJToken> transformerParameters,
String skipAfter)
Retrieves documents for the specified key prefix.
|
RavenJObjectIterator |
streamDocs()
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith,
String matches)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith,
String matches,
int start)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize,
String exclude)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamDocs(Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation,
String skipAfter)
Streams the documents by etag OR starts with the prefix and match the matches
Will return *all* results, regardless of the number of items that might be returned.
|
RavenJObjectIterator |
streamExport(ExportOptions options) |
RavenJObjectIterator |
streamQuery(String index,
IndexQuery query,
Reference<QueryHeaderInformation> queryHeaderInfo)
Queries the specified index in the Raven flavored Lucene query syntax.
|
SuggestionQueryResult |
suggest(String index,
SuggestionQuery suggestionQuery)
Returns a list of suggestions based on the specified suggestion query
|
Boolean |
tryResolveConflictByUsingRegisteredListeners(OperationMetadata operationMetadata,
String key,
Etag etag,
List<String> conflictedIds,
OperationMetadata opUrl)
Tries to resolve conflict using registered listeners
|
void |
updateAttachmentMetadata(String key,
Etag etag,
RavenJObject metadata)
Deprecated.
|
Operation |
updateByIndex(String indexName,
IndexQuery queryToUpdate,
PatchRequest[] patchRequests)
Perform a set based update using the specified index
|
Operation |
updateByIndex(String indexName,
IndexQuery queryToUpdate,
PatchRequest[] patchRequests,
BulkOperationOptions options)
Perform a set based update using the specified index
|
Operation |
updateByIndex(String indexName,
IndexQuery queryToUpdate,
ScriptedPatchRequest patch)
Perform a set based update using the specified index
|
Operation |
updateByIndex(String indexName,
IndexQuery queryToUpdate,
ScriptedPatchRequest patch,
BulkOperationOptions options)
Perform a set based update using the specified index
|
String |
urlFor(String documentKey)
Get the full URL for the given document key
|
static RavenJObjectIterator |
yieldStreamResults(org.apache.http.client.methods.CloseableHttpResponse webResponse) |
static RavenJObjectIterator |
yieldStreamResults(org.apache.http.client.methods.CloseableHttpResponse webResponse,
int start,
int pageSize,
RavenPagingInformation pagingInformation,
Function1<org.codehaus.jackson.JsonParser,Boolean> customizedEndResult) |
protected String url
protected final HttpJsonRequestFactory jsonRequestFactory
protected int requestCount
protected int readStripingBase
public ServerClient(String url, DocumentConvention convention, OperationCredentials credentials, HttpJsonRequestFactory httpJsonRequestFactory, UUID sessionId, Function1<String,IDocumentStoreReplicationInformer> replicationInformerGetter, String databaseName, IDocumentConflictListener[] conflictListeners, boolean incrementReadStripe)
public String getUrl()
public IDocumentStoreReplicationInformer getReplicationInformer()
public OperationCredentials getPrimaryCredentials()
IDatabaseCommands
getPrimaryCredentials
in interface IDatabaseCommands
public Collection<String> getIndexNames(int start, int pageSize)
IDatabaseCommands
getIndexNames
in interface IDatabaseCommands
start
- Number of index names that should be skippedpageSize
- Maximum number of index names that will be retrievedprotected Collection<String> directGetIndexNames(int start, int pageSize, OperationMetadata operationMetadata)
public Collection<IndexDefinition> getIndexes(int start, int pageSize)
IDatabaseCommands
getIndexes
in interface IDatabaseCommands
start
- Number of indexes that should be skippedpageSize
- Maximum number of indexes that will be retrievedprotected Collection<IndexDefinition> directGetIndexes(int start, int pageSize, OperationMetadata operationMetadata)
public List<TransformerDefinition> getTransformers(int start, int pageSize)
IDatabaseCommands
getTransformers
in interface IDatabaseCommands
start
- Number of transformers that should be skippedpageSize
- Maximum number of transformers that will be retrievedprotected List<TransformerDefinition> directGetTransformers(OperationMetadata operationMetadata, int start, int pageSize)
public void setTransformerLock(String name, TransformerLockMode lockMode)
IDatabaseCommands
setTransformerLock
in interface IDatabaseCommands
name
- The name of the transformerlockMode
- The lock mode to be setpublic void resetIndex(String name)
IDatabaseCommands
resetIndex
in interface IDatabaseCommands
name
- Name of an index to resetprotected void directResetIndex(String name, OperationMetadata operationMetadata)
public void setIndexLock(String name, IndexLockMode lockMode)
IDatabaseCommands
setIndexLock
in interface IDatabaseCommands
protected void directSetIndexLock(String name, IndexLockMode lockMode, OperationMetadata operationMetadata)
public void setIndexPriority(String name, IndexStats.IndexingPriority priority)
IDatabaseCommands
setIndexPriority
in interface IDatabaseCommands
protected void directSetIndexPriority(String name, IndexStats.IndexingPriority priority, OperationMetadata operationMetadata)
public String putIndex(String name, IndexDefinitionBuilder indexDef)
IDatabaseCommands
putIndex
in interface IDatabaseCommands
name
- Name of an indexindexDef
- Definition of an indexpublic String putIndex(String name, IndexDefinitionBuilder indexDef, boolean overwrite)
IDatabaseCommands
putIndex
in interface IDatabaseCommands
name
- Name of an indexindexDef
- Definition of an indexoverwrite
- If set to true [overwrite]public String putIndex(String name, IndexDefinition definition, boolean overwrite, Reference<Operation> precomputeBatchOperation)
IDatabaseCommands
putIndex
in interface IDatabaseCommands
name
- Name of the indexdefinition
- Definition of an indexprecomputeBatchOperation
- Operation of first time index populationpublic String[] putIndexes(IndexToAdd[] indexesToAdd)
IDatabaseCommands
putIndexes
in interface IDatabaseCommands
public String[] putSideBySideIndexes(IndexToAdd[] indexesToAdd)
IDatabaseCommands
putSideBySideIndexes
in interface IDatabaseCommands
public String[] putSideBySideIndexes(IndexToAdd[] indexesToAdd, Etag minimumEtagBeforeReplace, Date replaceTimeUtc)
IDatabaseCommands
putSideBySideIndexes
in interface IDatabaseCommands
public boolean indexHasChanged(String name, IndexDefinition definition)
IDatabaseCommands
indexHasChanged
in interface IDatabaseCommands
name
- Name of an index to checkdefinition
- Index definitionprotected Boolean directIndexHasChanged(String name, IndexDefinition definition, OperationMetadata operationMetadata)
public String putIndex(String name, IndexDefinition definition)
IDatabaseCommands
putIndex
in interface IDatabaseCommands
name
- Name of an indexdefinition
- Definition of an indexpublic String putIndex(String name, IndexDefinition definition, boolean overwrite)
IDatabaseCommands
putIndex
in interface IDatabaseCommands
name
- Name of an indexdefinition
- Definition of an indexoverwrite
- If set to true [overwrite]public String putTransformer(String name, TransformerDefinition indexDef)
IDatabaseCommands
putTransformer
in interface IDatabaseCommands
name
- Name of a transformerindexDef
- Definition of a transformerpublic String directPutIndex(String name, IndexDefinition definition, boolean overwrite, OperationMetadata operationMetadata)
public String directPutTransformer(String name, OperationMetadata operationMetadata, TransformerDefinition definition)
public void deleteIndex(String name)
IDatabaseCommands
deleteIndex
in interface IDatabaseCommands
name
- Name of an index to deleteprotected void directDeleteIndex(String name, OperationMetadata operationMetadata)
public Operation deleteByIndex(String indexName, IndexQuery queryToDelete)
IDatabaseCommands
deleteByIndex
in interface IDatabaseCommands
indexName
- Name of an index to perform a query onqueryToDelete
- Query that will be performedpublic Operation deleteByIndex(String indexName, IndexQuery queryToDelete, BulkOperationOptions options)
IDatabaseCommands
deleteByIndex
in interface IDatabaseCommands
indexName
- Name of an index to perform a query onqueryToDelete
- Query that will be performedoptions
- Various operation options e.g. AllowStale or MaxOpsPerSecprotected Operation directDeleteByIndex(OperationMetadata operationMetadata, String indexName, IndexQuery queryToDelete, BulkOperationOptions options)
public void deleteTransformer(String name)
IDatabaseCommands
deleteTransformer
in interface IDatabaseCommands
name
- Name of a transformer to deleteprotected void directDeleteTransformer(String name, OperationMetadata operationMetadata)
public RavenJObject patch(String key, PatchRequest[] patches)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatches
- Array of patch requestspublic RavenJObject patch(String key, PatchRequest[] patches, boolean ignoreMissing)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatches
- Array of patch requestsignoreMissing
- True if the patch request should ignore a missing document, false to throw DocumentDoesNotExistExceptionpublic RavenJObject patch(String key, ScriptedPatchRequest patch)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatch
- The patch request to use (using JavaScript)public RavenJObject patch(String key, ScriptedPatchRequest patch, boolean ignoreMissing)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatch
- The patch request to use (using JavaScript)ignoreMissing
- true if the patch request should ignore a missing document, false to throw DocumentDoesNotExistExceptionpublic RavenJObject patch(String key, PatchRequest[] patches, Etag etag)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatches
- Array of patch requestsetag
- Require specific Etag [null to ignore]public RavenJObject patch(String key, PatchRequest[] patchesToExisting, PatchRequest[] patchesToDefault, RavenJObject defaultMetadata)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatchesToExisting
- Array of patch requests to apply to an existing documentpatchesToDefault
- Array of patch requests to apply to a default document when the document is missingdefaultMetadata
- The metadata for the default document when the document is missingpublic RavenJObject patch(String key, ScriptedPatchRequest patch, Etag etag)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatch
- The patch request to use (using JavaScript)etag
- Require specific Etag [null to ignore]public RavenJObject patch(String key, ScriptedPatchRequest patchExisting, ScriptedPatchRequest patchDefault, RavenJObject defaultMetadata)
IDatabaseCommands
patch
in interface IDatabaseCommands
key
- Id of the document to patchpatchExisting
- The patch request to use (using JavaScript) to an existing documentpatchDefault
- The patch request to use (using JavaScript) to a default document when the document is missingdefaultMetadata
- The metadata for the default document when the document is missingpublic PutResult put(String key, Etag etag, RavenJObject document, RavenJObject metadata)
IDatabaseCommands
put
in interface IDatabaseCommands
key
- Unique key under which document will be storedetag
- Current document etag, used for concurrency checks (null to skip check)document
- Document datametadata
- Document metadataprotected PutResult directPut(RavenJObject metadata, String key, Etag etag, RavenJObject document, OperationMetadata operationMetadata)
public IDatabaseCommands forDatabase(String database)
IDatabaseCommands
IDatabaseCommands
that will interacts with the specified databaseforDatabase
in interface IDatabaseCommands
public IDatabaseCommands forSystemDatabase()
IDatabaseCommands
IDatabaseCommands
that will interacts with the default database.forSystemDatabase
in interface IDatabaseCommands
public Map<String,String> getOperationsHeaders()
IDatabaseCommands
getOperationsHeaders
in interface IDatabaseCommands
public void setOperationsHeaders(Map<String,String> operationsHeaders)
IDatabaseCommands
setOperationsHeaders
in interface IDatabaseCommands
public IGlobalAdminDatabaseCommands getGlobalAdmin()
IDatabaseCommands
getGlobalAdmin
in interface IDatabaseCommands
public IAdminDatabaseCommands getAdmin()
IDatabaseCommands
getAdmin
in interface IDatabaseCommands
public JsonDocument get(String key)
IDatabaseCommands
get
in interface IDatabaseCommands
key
- Key of the document you want to retrievepublic TransformerDefinition getTransformer(String name)
IDatabaseCommands
getTransformer
in interface IDatabaseCommands
name
- Transformer nameprotected TransformerDefinition directGetTransformer(String transformerName, OperationMetadata operationMetadata)
public IndexDefinition getIndex(String name)
IDatabaseCommands
getIndex
in interface IDatabaseCommands
name
- Name of an indexprotected IndexDefinition directGetIndex(String indexName, OperationMetadata operationMetadata)
public JsonDocument directGet(OperationMetadata operationMetadata, String key)
public MultiLoadResult get(String[] ids, String[] includes)
IDatabaseCommands
get
in interface IDatabaseCommands
ids
- Array of keys of the documents you want to retrieveincludes
- Array of paths in documents in which server should look for a 'referenced' documentpublic MultiLoadResult get(String[] ids, String[] includes, String transformer)
IDatabaseCommands
get
in interface IDatabaseCommands
ids
- Array of keys of the documents you want to retrieveincludes
- Array of paths in documents in which server should look for a 'referenced' documenttransformer
- Name of a transformer that should be used to transform the resultspublic MultiLoadResult get(String[] ids, String[] includes, String transformer, Map<String,RavenJToken> transformerParameters)
IDatabaseCommands
get
in interface IDatabaseCommands
ids
- Array of keys of the documents you want to retrieveincludes
- Array of paths in documents in which server should look for a 'referenced' documenttransformer
- Name of a transformer that should be used to transform the resultstransformerParameters
- Parameters that will be passed to transformerpublic MultiLoadResult get(String[] ids, String[] includes, String transformer, Map<String,RavenJToken> transformerParameters, boolean metadataOnly)
IDatabaseCommands
get
in interface IDatabaseCommands
ids
- Array of keys of the documents you want to retrieveincludes
- Array of paths in documents in which server should look for a 'referenced' documenttransformer
- Name of a transformer that should be used to transform the resultstransformerParameters
- Parameters that will be passed to transformermetadataOnly
- Specifies if only document metadata should be returnedprotected MultiLoadResult directGet(String[] ids, OperationMetadata operationMetadata, String[] includes, String transformer, Map<String,RavenJToken> transformerParameters, boolean metadataOnly)
public List<JsonDocument> getDocuments(int start, int pageSize)
IDatabaseCommands
getDocuments
in interface IDatabaseCommands
start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedpublic List<JsonDocument> getDocuments(int start, int pageSize, boolean metadataOnly)
IDatabaseCommands
getDocuments
in interface IDatabaseCommands
start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedpublic List<JsonDocument> getDocuments(Etag fromEtag, int pageSize)
IDatabaseCommands
getDocuments
in interface IDatabaseCommands
fromEtag
- Etag from which documents should startpageSize
- Maximum number of documents that will be retrievedpublic List<JsonDocument> getDocuments(Etag fromEtag, int pageSize, boolean metadataOnly)
IDatabaseCommands
getDocuments
in interface IDatabaseCommands
fromEtag
- Etag from which documents should startpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedpublic Operation updateByIndex(String indexName, IndexQuery queryToUpdate, PatchRequest[] patchRequests)
IDatabaseCommands
updateByIndex
in interface IDatabaseCommands
indexName
- Name of an index to perform a query onqueryToUpdate
- Query that will be performedpatchRequests
- Array of patches that will be executed on a query resultspublic Operation updateByIndex(String indexName, IndexQuery queryToUpdate, ScriptedPatchRequest patch)
IDatabaseCommands
updateByIndex
in interface IDatabaseCommands
indexName
- Name of an index to perform a query onqueryToUpdate
- Query that will be performedpatch
- JavaScript patch that will be executed on query resultspublic Operation updateByIndex(String indexName, IndexQuery queryToUpdate, PatchRequest[] patchRequests, BulkOperationOptions options)
IDatabaseCommands
updateByIndex
in interface IDatabaseCommands
indexName
- Name of an index to perform a query onqueryToUpdate
- Query that will be performedpatchRequests
- Array of patches that will be executed on a query resultsoptions
- Various operation options e.g. AllowStale or MaxOpsPerSecpublic Operation updateByIndex(String indexName, IndexQuery queryToUpdate, ScriptedPatchRequest patch, BulkOperationOptions options)
IDatabaseCommands
updateByIndex
in interface IDatabaseCommands
indexName
- Name of an index to perform a query onqueryToUpdate
- Query that will be performedpatch
- JavaScript patch that will be executed on query resultsoptions
- Various operation options e.g. AllowStale or MaxOpsPerSecpublic MultiLoadResult moreLikeThis(MoreLikeThisQuery query)
IDatabaseCommands
moreLikeThis
in interface IDatabaseCommands
query
- More like this query definition that will be executedpublic Long nextIdentityFor(String name)
IDatabaseCommands
nextIdentityFor
in interface IDatabaseCommands
protected Long directNextIdentityFor(String name, OperationMetadata operationMetadata)
public long seedIdentityFor(String name, long value)
IDatabaseCommands
seedIdentityFor
in interface IDatabaseCommands
protected Operation directUpdateByIndexImpl(OperationMetadata operationMetadata, String indexName, IndexQuery queryToUpdate, BulkOperationOptions options, String requestData, HttpMethods method)
public FacetResults getFacets(String index, IndexQuery query, String facetSetupDoc)
IDatabaseCommands
getFacets
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexfacetSetupDoc
- Document key that contains predefined FacetSetuppublic FacetResults getFacets(String index, IndexQuery query, String facetSetupDoc, int start)
IDatabaseCommands
getFacets
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexfacetSetupDoc
- Document key that contains predefined FacetSetupstart
- Number of results that should be skipped. Default: 0public FacetResults getFacets(String index, IndexQuery query, String facetSetupDoc, int start, Integer pageSize)
IDatabaseCommands
getFacets
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexfacetSetupDoc
- Document key that contains predefined FacetSetupstart
- Number of results that should be skipped. Default: 0pageSize
- Maximum number of results that will be retrieved. Default: null. If set, overrides Facet.MaxResultsprotected FacetResults directGetFacets(OperationMetadata operationMetadata, String index, IndexQuery query, String facetSetupDoc, int start, Integer pageSize)
public FacetResults[] getMultiFacets(FacetQuery[] facetedQueries)
IDatabaseCommands
getMultiFacets
in interface IDatabaseCommands
facetedQueries
- List of the faceted queries that will be executed on the server-sidepublic FacetResults getFacets(String index, IndexQuery query, List<Facet> facets)
IDatabaseCommands
getFacets
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexfacets
- List of facets required to perform a facet querypublic FacetResults getFacets(String index, IndexQuery query, List<Facet> facets, int start)
IDatabaseCommands
getFacets
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexfacets
- List of facets required to perform a facet querystart
- Number of results that should be skipped. Default: 0public FacetResults getFacets(String index, IndexQuery query, List<Facet> facets, int start, Integer pageSize)
IDatabaseCommands
getFacets
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexfacets
- List of facets required to perform a facet querystart
- Number of results that should be skipped. Default: 0pageSize
- Maximum number of results that will be retrieved. Default: null. If set, overrides Facet.MaxResultsprotected static String serializeFacetsToFacetsJsonString(List<Facet> facets)
protected FacetResults directGetFacets(OperationMetadata operationMetadata, String index, IndexQuery query, String facetsJson, int start, Integer pageSize, HttpMethods method)
public LogItem[] getLogs(boolean errorsOnly)
IDatabaseCommands
getLogs
in interface IDatabaseCommands
public ReplicationStatistics getReplicationInfo()
IDatabaseCommands
getReplicationInfo
in interface IDatabaseCommands
public LicensingStatus getLicenseStatus()
IDatabaseCommands
getLicenseStatus
in interface IDatabaseCommands
public BuildNumber getBuildNumber()
IDatabaseCommands
getBuildNumber
in interface IDatabaseCommands
public IndexMergeResults getIndexMergeSuggestions()
IDatabaseCommands
getIndexMergeSuggestions
in interface IDatabaseCommands
public List<JsonDocument> startsWith(String keyPrefix, String matches, int start, int pageSize)
IDatabaseCommands
startsWith
in interface IDatabaseCommands
keyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedpublic List<JsonDocument> startsWith(String keyPrefix, String matches, int start, int pageSize, boolean metadataOnly)
IDatabaseCommands
startsWith
in interface IDatabaseCommands
keyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedpublic List<JsonDocument> startsWith(String keyPrefix, String matches, int start, int pageSize, boolean metadataOnly, String exclude)
IDatabaseCommands
startsWith
in interface IDatabaseCommands
keyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)public List<JsonDocument> startsWith(String keyPrefix, String matches, int start, int pageSize, boolean metadataOnly, String exclude, RavenPagingInformation pagingInformation)
IDatabaseCommands
startsWith
in interface IDatabaseCommands
keyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sidepublic List<JsonDocument> startsWith(String keyPrefix, String matches, int start, int pageSize, boolean metadataOnly, String exclude, RavenPagingInformation pagingInformation, String transformer, Map<String,RavenJToken> transformerParameters)
IDatabaseCommands
startsWith
in interface IDatabaseCommands
keyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sidetransformer
- Name of a transformer that should be used to transform the resultstransformerParameters
- Parameters that will be passed to transformerpublic List<JsonDocument> startsWith(String keyPrefix, String matches, int start, int pageSize, boolean metadataOnly, String exclude, RavenPagingInformation pagingInformation, String transformer, Map<String,RavenJToken> transformerParameters, String skipAfter)
IDatabaseCommands
startsWith
in interface IDatabaseCommands
keyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedmetadataOnly
- Specifies if only document metadata should be returnedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sidetransformer
- Name of a transformer that should be used to transform the resultstransformerParameters
- Parameters that will be passed to transformerskipAfter
- Skip document fetching until given key is found and return documents after that key (default: null)protected List<JsonDocument> directStartsWith(OperationMetadata operationMetadata, String keyPrefix, String matches, int start, int pageSize, boolean metadataOnly, String exclude, RavenPagingInformation pagingInformation, String transformer, Map<String,RavenJToken> transformerParameters, String skipAfter)
public GetResponse[] multiGet(GetRequest[] requests)
IDatabaseCommands
multiGet
in interface IDatabaseCommands
protected GetResponse[] directMultiGetInternal(OperationMetadata operationMetadata, GetRequest[] requests, Reference<OperationMetadata> operationMetadataRef)
public QueryResult query(String index, IndexQuery query)
IDatabaseCommands
query
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexpublic QueryResult query(String index, IndexQuery query, String[] includes)
IDatabaseCommands
query
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexincludes
- An array of relative paths that specify related documents ids which should be included in a query resultpublic QueryResult query(String index, IndexQuery query, String[] includes, boolean metadataOnly)
IDatabaseCommands
query
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexincludes
- An array of relative paths that specify related documents ids which should be included in a query resultmetadataOnly
- True if returned documents should include only metadata without a document body.public QueryResult query(String index, IndexQuery query, String[] includes, boolean metadataOnly, boolean indexEntriesOnly)
IDatabaseCommands
query
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexincludes
- An array of relative paths that specify related documents ids which should be included in a query resultmetadataOnly
- True if returned documents should include only metadata without a document body.indexEntriesOnly
- True if query results should contain only index entries.protected QueryResult directQueryAsGet(String index, IndexQuery query, OperationMetadata operationMetadata, String[] includes, boolean metadataOnly, boolean includeEntries)
protected QueryResult directQueryAsPost(String index, IndexQuery query, OperationMetadata operationMetadata, String[] includes, boolean metadataOnly, boolean indexEntriesOnly)
public SuggestionQueryResult suggest(String index, SuggestionQuery suggestionQuery)
IDatabaseCommands
suggest
in interface IDatabaseCommands
index
- Name of an index to querysuggestionQuery
- Suggestion query definition containing all information required to query a specified indexprotected SuggestionQueryResult directSuggest(String index, SuggestionQuery suggestionQuery, OperationMetadata operationMetadata)
public BatchResult[] batch(List<ICommandData> commandDatas)
IDatabaseCommands
batch
in interface IDatabaseCommands
commandDatas
- Commands to processprotected BatchResult[] directBatch(List<ICommandData> commandDatas, OperationMetadata operationMetadata)
protected ConcurrencyException fetchConcurrencyException(ErrorResponseException e)
@Deprecated public AttachmentInformation[] getAttachments(int start, Etag startEtag, int pageSize)
IDatabaseCommands
getAttachments
in interface IDatabaseCommands
start
- Indicates how many attachments should be skippedstartEtag
- ETag from which to startpageSize
- Maximum number of attachments that will be downloaded@Deprecated protected AttachmentInformation[] directGetAttachments(int start, Etag startEtag, int pageSize, OperationMetadata operationMetadata)
@Deprecated public void putAttachment(String key, Etag etag, InputStream data, RavenJObject metadata)
IDatabaseCommands
putAttachment
in interface IDatabaseCommands
key
- Unique key under which attachment will be storedetag
- Current attachment etag, used for concurrency checks (null to skip check)data
- Attachment datametadata
- Attachment metadata@Deprecated protected void directPutAttachment(String key, RavenJObject metadata, Etag etag, InputStream data, OperationMetadata operationMetadata)
@Deprecated public Attachment getAttachment(String key)
IDatabaseCommands
getAttachment
in interface IDatabaseCommands
key
- Key of the attachment you want to download@Deprecated public Attachment headAttachment(String key)
IDatabaseCommands
headAttachment
in interface IDatabaseCommands
key
- Key of the attachment you want to download metadata for@Deprecated protected Attachment directGetAttachment(HttpMethods method, String key, OperationMetadata operationMetadata)
@Deprecated public void deleteAttachment(String key, Etag etag)
IDatabaseCommands
deleteAttachment
in interface IDatabaseCommands
key
- Key of an attachment to deleteetag
- Current attachment etag, used for concurrency checks (null to skip check)@Deprecated protected void directDeleteAttachment(String key, Etag etag, OperationMetadata operationMetadata)
public CleanCloseable disableAllCaching()
IDatabaseCommands
disableAllCaching
in interface IDatabaseCommands
public List<String> getTerms(String index, String field, String fromValue, int pageSize)
IDatabaseCommands
getTerms
in interface IDatabaseCommands
index
- Name of an indexfield
- Index fieldfromValue
- Starting point for a query, used for pagingpageSize
- Maximum number of terms that will be returnedprotected List<String> directGetTerms(OperationMetadata operationMetadata, String index, String field, String fromValue, int pageSize)
public ProfilingInformation getProfilingInformation()
IHoldProfilingInformation
getProfilingInformation
in interface IHoldProfilingInformation
public void addFailoverStatusChanged(EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs> event)
public void removeFailoverStatusChanged(EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs> event)
public CleanCloseable forceReadFromMaster()
IDatabaseCommands
forceReadFromMaster
in interface IDatabaseCommands
public JsonDocumentMetadata head(String key)
IDatabaseCommands
head
in interface IDatabaseCommands
key
- Key of a document to get metadata forpublic RavenJObjectIterator streamExport(ExportOptions options)
public RavenJObjectIterator streamQuery(String index, IndexQuery query, Reference<QueryHeaderInformation> queryHeaderInfo)
IDatabaseCommands
streamQuery
in interface IDatabaseCommands
index
- Name of an index to queryquery
- Query definition containing all information required to query a specified indexqueryHeaderInfo
- Information about performed querypublic RavenJObjectIterator directStreamQuery(OperationMetadata operationMetadata, String index, IndexQuery query, Reference<QueryHeaderInformation> queryHeaderInfo)
public static RavenJObjectIterator yieldStreamResults(org.apache.http.client.methods.CloseableHttpResponse webResponse)
public static RavenJObjectIterator yieldStreamResults(org.apache.http.client.methods.CloseableHttpResponse webResponse, int start, int pageSize, RavenPagingInformation pagingInformation, Function1<org.codehaus.jackson.JsonParser,Boolean> customizedEndResult)
public RavenJObjectIterator streamDocs()
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
public RavenJObjectIterator streamDocs(Etag fromEtag)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')public RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')public RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith, String matches)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)public RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith, String matches, int start)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpublic RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedpublic RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)public RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sidepublic RavenJObjectIterator streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation, String skipAfter)
IDatabaseCommands
streamDocs
in interface IDatabaseCommands
fromEtag
- ETag of a document from which stream should start (mutually exclusive with 'startsWith')startsWith
- Prefix for which documents should be streamed (mutually exclusive with 'fromEtag')matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedexclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sideskipAfter
- Skip document fetching until given key is found and return documents after that key (default: null)public RavenJObjectIterator directStreamDocs(OperationMetadata operationMetadata, Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation, String skipAfter)
public void delete(String key, Etag etag)
IDatabaseCommands
delete
in interface IDatabaseCommands
key
- The key of a document to be deletedetag
- current document etag, used for concurrency checks (null to skip check)protected void directDelete(OperationMetadata operationMetadata, String key, Etag etag)
public String urlFor(String documentKey)
IDatabaseCommands
urlFor
in interface IDatabaseCommands
public ILowLevelBulkInsertOperation getBulkInsertOperation(BulkInsertOptions options, IDatabaseChanges changes)
IDatabaseCommands
getBulkInsertOperation
in interface IDatabaseCommands
protected JsonDocumentMetadata directHead(OperationMetadata operationMetadata, String key)
public RavenJToken executeGetRequest(String requestUrl)
public HttpJsonRequest createRequest(HttpMethods method, String requestUrl)
IDatabaseCommands
createRequest
in interface IDatabaseCommands
public HttpJsonRequest createRequest(HttpMethods method, String requestUrl, boolean disableRequestCompression, boolean disableAuthentication, Long timeout)
createRequest
in interface IDatabaseCommands
public HttpJsonRequest createReplicationAwareRequest(String currentServerUrl, String requestUrl, HttpMethods method)
public HttpJsonRequest createReplicationAwareRequest(String currentServerUrl, String requestUrl, HttpMethods method, boolean disableRequestCompression)
@Deprecated public void updateAttachmentMetadata(String key, Etag etag, RavenJObject metadata)
IDatabaseCommands
updateAttachmentMetadata
in interface IDatabaseCommands
key
- Key under which attachment is storedetag
- Current attachment etag, used for concurrency checks (null to skip check)metadata
- Attachment metadata@Deprecated protected void directUpdateAttachmentMetadata(String key, RavenJObject metadata, Etag etag, OperationMetadata operationMetadata)
@Deprecated public List<Attachment> getAttachmentHeadersStartingWith(String idPrefix, int start, int pageSize)
IDatabaseCommands
getAttachmentHeadersStartingWith
in interface IDatabaseCommands
idPrefix
- Prefix for which attachments should be returnedstart
- Number of attachments that should be skippedpageSize
- Maximum number of attachments that will be returned@Deprecated protected List<Attachment> directGetAttachmentHeadersStartingWith(HttpMethods method, String idPrefix, int start, int pageSize, OperationMetadata operationMetadata)
protected void handleReplicationStatusChanges(Map<String,String> headers, String primaryUrl, String currentUrl)
public <S> S executeWithReplication(HttpMethods method, Function1<OperationMetadata,S> operation)
public Boolean tryResolveConflictByUsingRegisteredListeners(OperationMetadata operationMetadata, String key, Etag etag, List<String> conflictedIds, OperationMetadata opUrl)
IDatabaseCommands
tryResolveConflictByUsingRegisteredListeners
in interface IDatabaseCommands
public RavenJToken getOperationStatus(long id)
public boolean isInFailoverMode()
public DatabaseStatistics getStatistics()
IDatabaseCommands
getStatistics
in interface IDatabaseCommands
public boolean isExpect100Continue()
IHoldProfilingInformation
isExpect100Continue
in interface IHoldProfilingInformation
public void setExpect100Continue(boolean expect100Continue)
public ReplicationDocument directGetReplicationDestinations(OperationMetadata operationMetadata)
public HttpJsonRequestFactory getJsonRequestFactory()
Copyright © 2016. All Rights Reserved.