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, weakCompareAndSet
byteValue, shortValue
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 void close() throws LiteCoreException
LiteCoreException
public void delete() throws LiteCoreException
LiteCoreException
public 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
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) 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 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
LiteCoreException
public C4Replicator createTargetReplicator(@NonNull C4Socket openSocket, int push, int pull, @Nullable byte[] options, @Nullable C4ReplicatorListener listener, @NonNull Object replicatorContext) throws LiteCoreException
LiteCoreException
public void setCookie(@NonNull URI uri, @NonNull String setCookieHeader) throws LiteCoreException
LiteCoreException
@Nullable public String getCookies(@NonNull URI uri) throws LiteCoreException
LiteCoreException