public class C4Database extends Object
| 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) |
C4Query |
createQuery(String expression) |
C4Replicator |
createReplicator(C4Socket openSocket,
int push,
int pull,
byte[] options,
C4ReplicatorListener listener,
Object replicatorContext) |
C4Replicator |
createReplicator(String schema,
String host,
int port,
String path,
String remoteDatabaseName,
C4Database otherLocalDB,
int push,
int pull,
byte[] options,
C4ReplicatorListener listener,
C4ReplicationFilter pushFilter,
C4ReplicationFilter pullFilter,
AbstractReplicator replicatorContext,
SocketFactory socketFactoryContext,
int framing) |
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,
boolean mustExist) |
C4BlobStore |
getBlobStore() |
C4Document |
getBySequence(long sequence) |
long |
getDocumentCount() |
long |
getExpiration(String docID) |
FLSharedKeys |
getFLSharedKeys() |
FLValue |
getIndexes() |
long |
getLastSequence() |
int |
getMaxRevTreeDepth() |
String |
getPath() |
byte[] |
getPrivateUUID() |
byte[] |
getPublicUUID() |
FLEncoder |
getSharedFleeceEncoder() |
long |
nextDocExpiration() |
void |
purgeDoc(String docID) |
int |
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) |
C4Database |
retain() |
void |
setExpiration(String docID,
long timestamp) |
void |
setMaxRevTreeDepth(int maxRevTreeDepth) |
public 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 C4Database retain()
public void close()
throws LiteCoreException
LiteCoreExceptionpublic void delete()
throws LiteCoreException
LiteCoreExceptionpublic void rekey(int keyType,
byte[] newKey)
throws LiteCoreException
LiteCoreExceptionpublic String getPath()
public long getDocumentCount()
public long getLastSequence()
public long nextDocExpiration()
public int 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, 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 C4Replicator createReplicator(String schema, String host, int port, String path, String remoteDatabaseName, C4Database otherLocalDB, int push, int pull, byte[] options, C4ReplicatorListener listener, C4ReplicationFilter pushFilter, C4ReplicationFilter pullFilter, AbstractReplicator replicatorContext, SocketFactory socketFactoryContext, int framing) throws LiteCoreException
LiteCoreExceptionpublic C4Replicator createReplicator(C4Socket openSocket, int push, int pull, byte[] options, C4ReplicatorListener listener, Object replicatorContext) throws LiteCoreException
LiteCoreException