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
LiteCoreException
public C4Database(long handle)
public static void copyDb(String sourcePath, String destinationPath, int flags, String storageEngine, int versioning, int algorithm, byte[] encryptionKey) throws LiteCoreException
LiteCoreException
public static void rawFreeDocument(long rawDoc) throws LiteCoreException
LiteCoreException
public static void deleteDbAtPath(String path) throws LiteCoreException
LiteCoreException
public void free()
public C4Database retain()
public void close() throws LiteCoreException
LiteCoreException
public void delete() throws LiteCoreException
LiteCoreException
public void rekey(int keyType, byte[] newKey) throws LiteCoreException
LiteCoreException
public String getPath()
public long getDocumentCount()
public long getLastSequence()
public long nextDocExpiration()
public int purgeExpiredDocs()
public void purgeDoc(String docID) throws LiteCoreException
LiteCoreException
public int getMaxRevTreeDepth()
public void setMaxRevTreeDepth(int maxRevTreeDepth)
public byte[] getPublicUUID() throws LiteCoreException
LiteCoreException
public byte[] getPrivateUUID() throws LiteCoreException
LiteCoreException
public void compact() throws LiteCoreException
LiteCoreException
public void beginTransaction() throws LiteCoreException
LiteCoreException
public void endTransaction(boolean commit) throws LiteCoreException
LiteCoreException
public C4RawDocument rawGet(String storeName, String docID) throws LiteCoreException
LiteCoreException
public void rawPut(String storeName, String key, String meta, byte[] body) throws LiteCoreException
LiteCoreException
public FLEncoder getSharedFleeceEncoder()
public FLSliceResult encodeJSON(byte[] jsonData) throws LiteCoreException
LiteCoreException
public final FLSharedKeys getFLSharedKeys()
public C4DocEnumerator enumerateChanges(long since, int flags) throws LiteCoreException
LiteCoreException
public C4DocEnumerator enumerateAllDocs(int flags) throws LiteCoreException
LiteCoreException
public C4Document get(String docID, boolean mustExist) throws LiteCoreException
LiteCoreException
public C4Document getBySequence(long sequence) throws LiteCoreException
LiteCoreException
public void setExpiration(String docID, long timestamp) throws LiteCoreException
LiteCoreException
public long getExpiration(String docID) throws LiteCoreException
LiteCoreException
public C4Document put(byte[] body, String docID, int revFlags, boolean existingRevision, boolean allowConflict, String[] history, boolean save, int maxRevTreeDepth, int remoteDBID) throws LiteCoreException
LiteCoreException
public 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
LiteCoreException
public C4Query createQuery(String expression) throws LiteCoreException
LiteCoreException
public boolean createIndex(String name, String expressionsJSON, int indexType, String language, boolean ignoreDiacritics) throws LiteCoreException
LiteCoreException
public void deleteIndex(String name) throws LiteCoreException
LiteCoreException
public FLValue getIndexes() throws LiteCoreException
LiteCoreException
public 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
LiteCoreException
public C4Replicator createReplicator(C4Socket openSocket, int push, int pull, byte[] options, C4ReplicatorListener listener, Object replicatorContext) throws LiteCoreException
LiteCoreException