public class C4Database extends C4NativePeer
| Constructor and Description |
|---|
C4Database(long handle) |
C4Database(String path,
int flags,
String storageEngine,
int versioning,
int algorithm,
byte[] encryptionKey) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTransaction() |
void |
close() |
void |
compact() |
static void |
copyDb(String sourcePath,
String destinationPath,
int flags,
String storageEngine,
int versioning,
int algorithm,
byte[] encryptionKey) |
C4Document |
create(String docID,
byte[] body,
int revisionFlags) |
C4Document |
create(String docID,
FLSliceResult body,
int flags) |
C4DatabaseObserver |
createDatabaseObserver(C4DatabaseObserverListener listener,
Object context) |
C4DocumentObserver |
createDocumentObserver(String docID,
C4DocumentObserverListener listener,
Object context) |
boolean |
createIndex(String name,
String expressionsJSON,
int indexType,
String language,
boolean ignoreDiacritics) |
C4Replicator |
createLocalReplicator(C4Database otherLocalDB,
int push,
int pull,
byte[] options,
C4ReplicatorListener listener,
C4ReplicationFilter pushFilter,
C4ReplicationFilter pullFilter,
AbstractReplicator replicatorContext) |
C4Query |
createQuery(String expression) |
C4Replicator |
createRemoteReplicator(String scheme,
String host,
int port,
String path,
String remoteDatabaseName,
int push,
int pull,
byte[] options,
C4ReplicatorListener listener,
C4ReplicationFilter pushFilter,
C4ReplicationFilter pullFilter,
AbstractReplicator replicatorContext,
SocketFactory socketFactoryContext,
int framing) |
C4Replicator |
createTargetReplicator(C4Socket openSocket,
int push,
int pull,
byte[] options,
C4ReplicatorListener listener,
Object replicatorContext) |
void |
delete() |
static void |
deleteDbAtPath(String path) |
void |
deleteIndex(String name) |
FLSliceResult |
encodeJSON(byte[] jsonData) |
void |
endTransaction(boolean commit) |
C4DocEnumerator |
enumerateAllDocs(int flags) |
C4DocEnumerator |
enumerateChanges(long since,
int flags) |
void |
free() |
C4Document |
get(String docID) |
C4Document |
get(String docID,
boolean mustExist) |
C4BlobStore |
getBlobStore() |
C4Document |
getBySequence(long sequence) |
String |
getCookies(URI uri) |
long |
getDocumentCount() |
long |
getExpiration(String docID) |
FLSharedKeys |
getFLSharedKeys() |
FLValue |
getIndexes() |
long |
getLastSequence() |
int |
getMaxRevTreeDepth() |
String |
getPath() |
byte[] |
getPrivateUUID() |
byte[] |
getPublicUUID() |
FLEncoder |
getSharedFleeceEncoder() |
long |
nextDocExpiration() |
boolean |
performMaintenance(MaintenanceType type) |
void |
purgeDoc(String docID) |
long |
purgeExpiredDocs() |
C4Document |
put(byte[] body,
String docID,
int revFlags,
boolean existingRevision,
boolean allowConflict,
String[] history,
boolean save,
int maxRevTreeDepth,
int remoteDBID) |
C4Document |
put(FLSliceResult body,
String docID,
int revFlags,
boolean existingRevision,
boolean allowConflict,
String[] history,
boolean save,
int maxRevTreeDepth,
int remoteDBID) |
static void |
rawFreeDocument(long rawDoc) |
C4RawDocument |
rawGet(String storeName,
String docID) |
void |
rawPut(String storeName,
String key,
String meta,
byte[] body) |
void |
rekey(int keyType,
byte[] newKey) |
void |
setCookie(URI uri,
String setCookieHeader) |
void |
setExpiration(String docID,
long timestamp) |
void |
setMaxRevTreeDepth(int maxRevTreeDepth) |
accumulateAndGet, addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, incrementAndGet, intValue, lazySet, longValue, set, toString, updateAndGet, weakCompareAndSetbyteValue, shortValuepublic C4Database(String path, int flags, String storageEngine, int versioning, int algorithm, byte[] encryptionKey) throws LiteCoreException
LiteCoreExceptionpublic C4Database(long handle)
public static void copyDb(String sourcePath, String destinationPath, int flags, String storageEngine, int versioning, int algorithm, byte[] encryptionKey) throws LiteCoreException
LiteCoreExceptionpublic static void rawFreeDocument(long rawDoc)
throws LiteCoreException
LiteCoreExceptionpublic static void deleteDbAtPath(String path) throws LiteCoreException
LiteCoreExceptionpublic void free()
public void close()
throws LiteCoreException
LiteCoreExceptionpublic void delete()
throws LiteCoreException
LiteCoreExceptionpublic void rekey(int keyType,
byte[] newKey)
throws LiteCoreException
LiteCoreException@Nullable public String getPath()
public long getDocumentCount()
public long getLastSequence()
public long nextDocExpiration()
public long purgeExpiredDocs()
public void purgeDoc(String docID) throws LiteCoreException
LiteCoreExceptionpublic int getMaxRevTreeDepth()
public void setMaxRevTreeDepth(int maxRevTreeDepth)
public byte[] getPublicUUID()
throws LiteCoreException
LiteCoreExceptionpublic byte[] getPrivateUUID()
throws LiteCoreException
LiteCoreExceptionpublic void compact()
throws LiteCoreException
LiteCoreExceptionpublic void beginTransaction()
throws LiteCoreException
LiteCoreExceptionpublic void endTransaction(boolean commit)
throws LiteCoreException
LiteCoreExceptionpublic C4RawDocument rawGet(String storeName, String docID) throws LiteCoreException
LiteCoreExceptionpublic void rawPut(String storeName, String key, String meta, byte[] body) throws LiteCoreException
LiteCoreExceptionpublic FLEncoder getSharedFleeceEncoder()
public FLSliceResult encodeJSON(byte[] jsonData) throws LiteCoreException
LiteCoreExceptionpublic final FLSharedKeys getFLSharedKeys()
public C4DocEnumerator enumerateChanges(long since, int flags) throws LiteCoreException
LiteCoreExceptionpublic C4DocEnumerator enumerateAllDocs(int flags) throws LiteCoreException
LiteCoreExceptionpublic C4Document get(String docID) throws LiteCoreException
LiteCoreExceptionpublic C4Document get(String docID, boolean mustExist) throws LiteCoreException
LiteCoreExceptionpublic C4Document getBySequence(long sequence) throws LiteCoreException
LiteCoreExceptionpublic void setExpiration(String docID, long timestamp) throws LiteCoreException
LiteCoreExceptionpublic long getExpiration(String docID) throws LiteCoreException
LiteCoreExceptionpublic C4Document put(byte[] body, String docID, int revFlags, boolean existingRevision, boolean allowConflict, String[] history, boolean save, int maxRevTreeDepth, int remoteDBID) throws LiteCoreException
LiteCoreExceptionpublic C4Document put(FLSliceResult body, String docID, int revFlags, boolean existingRevision, boolean allowConflict, String[] history, boolean save, int maxRevTreeDepth, int remoteDBID) throws LiteCoreException
LiteCoreException@NonNull public C4Document create(String docID, byte[] body, int revisionFlags) throws LiteCoreException
LiteCoreException@NonNull public C4Document create(String docID, FLSliceResult body, int flags) throws LiteCoreException
LiteCoreException@NonNull public C4DatabaseObserver createDatabaseObserver(C4DatabaseObserverListener listener, Object context)
@NonNull public C4DocumentObserver createDocumentObserver(String docID, C4DocumentObserverListener listener, Object context)
@NonNull public C4BlobStore getBlobStore() throws LiteCoreException
LiteCoreExceptionpublic C4Query createQuery(String expression) throws LiteCoreException
LiteCoreExceptionpublic boolean createIndex(String name, String expressionsJSON, int indexType, String language, boolean ignoreDiacritics) throws LiteCoreException
LiteCoreExceptionpublic void deleteIndex(String name) throws LiteCoreException
LiteCoreExceptionpublic FLValue getIndexes() throws LiteCoreException
LiteCoreExceptionpublic boolean performMaintenance(MaintenanceType type) throws LiteCoreException
LiteCoreException@NonNull public C4Replicator createRemoteReplicator(@Nullable String scheme, @Nullable String host, int port, @Nullable String path, @Nullable String remoteDatabaseName, int push, int pull, @NonNull byte[] options, @Nullable C4ReplicatorListener listener, @Nullable C4ReplicationFilter pushFilter, @Nullable C4ReplicationFilter pullFilter, @NonNull AbstractReplicator replicatorContext, @Nullable SocketFactory socketFactoryContext, int framing) throws LiteCoreException
LiteCoreException@NonNull public C4Replicator createLocalReplicator(@NonNull C4Database otherLocalDB, int push, int pull, @NonNull byte[] options, @Nullable C4ReplicatorListener listener, @Nullable C4ReplicationFilter pushFilter, @Nullable C4ReplicationFilter pullFilter, @NonNull AbstractReplicator replicatorContext) throws LiteCoreException
LiteCoreExceptionpublic C4Replicator createTargetReplicator(@NonNull C4Socket openSocket, int push, int pull, @Nullable byte[] options, @Nullable C4ReplicatorListener listener, @NonNull Object replicatorContext) throws LiteCoreException
LiteCoreExceptionpublic void setCookie(@NonNull
URI uri,
@NonNull
String setCookieHeader)
throws LiteCoreException
LiteCoreException@Nullable public String getCookies(@NonNull URI uri) throws LiteCoreException
LiteCoreException