public abstract class C4Database extends C4NativePeer
Modifier and Type | Field and Description |
---|---|
static String |
DB_EXTENSION |
Modifier and Type | Method and Description |
---|---|
void |
beginTransaction() |
abstract void |
close() |
void |
closeDb() |
static void |
copyDb(String sourcePath,
String parentDir,
String name,
int flags,
int algorithm,
byte[] encryptionKey) |
C4Document |
create(String docID,
FLSliceResult body,
int flags) |
C4DatabaseObserver |
createDatabaseObserver(Object context,
C4DatabaseObserverListener listener) |
C4DocumentObserver |
createDocumentObserver(String docID,
Object context,
C4DocumentObserverListener listener) |
void |
createIndex(String name,
String queryExpression,
AbstractIndex.QueryLanguage queryLanguage,
AbstractIndex.IndexType indexType,
String language,
boolean ignoreDiacritics) |
C4Query |
createJsonQuery(String expression) |
C4Replicator |
createLocalReplicator(C4Database otherLocalDB,
int push,
int pull,
byte[] options,
C4ReplicatorListener listener,
C4ReplicationFilter pushFilter,
C4ReplicationFilter pullFilter,
AbstractReplicator replicatorContext) |
C4Query |
createN1qlQuery(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 |
deleteDb() |
void |
deleteIndex(String name) |
static void |
deleteNamedDb(String directory,
String name) |
void |
endTransaction(boolean commit) |
C4Document |
get(String docID) |
C4Document |
get(String docID,
boolean mustExist) |
C4BlobStore |
getBlobStore() |
String |
getCookies(URI uri) |
static C4Database |
getDatabase(String parentDirPath,
String name,
int flags,
int algorithm,
byte[] encryptionKey) |
static File |
getDatabaseFile(File directory,
String name) |
String |
getDbDirectory() |
String |
getDbFileName() |
String |
getDbName() |
String |
getDbPath() |
long |
getDocumentCount() |
long |
getExpiration(String docID) |
FLValue |
getIndexesInfo() |
byte[] |
getPublicUUID() |
FLEncoder |
getSharedFleeceEncoder() |
static C4Database |
getUnmanagedDatabase(long peer) |
boolean |
performMaintenance(MaintenanceType type) |
void |
purgeDoc(String docID) |
C4Document |
put(byte[] body,
String docID,
int revFlags,
boolean existingRevision,
boolean allowConflict,
String[] history,
boolean save,
int maxRevTreeDepth,
int remoteDBID) |
void |
rekey(int keyType,
byte[] newKey) |
void |
setCookie(URI uri,
String setCookieHeader,
boolean acceptParentDomain) |
void |
setExpiration(String docID,
long timestamp) |
toString
public static final String DB_EXTENSION
public static void copyDb(@NonNull String sourcePath, @NonNull String parentDir, @NonNull String name, int flags, int algorithm, @Nullable byte[] encryptionKey) throws LiteCoreException
LiteCoreException
public static void deleteNamedDb(@NonNull String directory, @NonNull String name) throws LiteCoreException
LiteCoreException
@NonNull public static File getDatabaseFile(@NonNull File directory, @NonNull String name)
@NonNull public static C4Database getUnmanagedDatabase(long peer)
@NonNull public static C4Database getDatabase(@NonNull String parentDirPath, @NonNull String name, int flags, int algorithm, @Nullable byte[] encryptionKey) throws LiteCoreException
LiteCoreException
public abstract void close()
@Nullable public String getDbPath()
@Nullable public String getDbDirectory()
@Nullable public String getDbFileName()
@Nullable public String getDbName()
public void rekey(int keyType, byte[] newKey) throws LiteCoreException
LiteCoreException
public void closeDb() throws LiteCoreException
LiteCoreException
public void deleteDb() throws LiteCoreException
LiteCoreException
public long getDocumentCount()
public void purgeDoc(String docID) throws LiteCoreException
LiteCoreException
@NonNull public byte[] getPublicUUID() throws LiteCoreException
LiteCoreException
public void beginTransaction() throws LiteCoreException
LiteCoreException
public void endTransaction(boolean commit) throws LiteCoreException
LiteCoreException
@NonNull public FLEncoder getSharedFleeceEncoder()
@NonNull public C4Document get(@NonNull String docID) throws LiteCoreException
LiteCoreException
public void setExpiration(@NonNull String docID, long timestamp) throws LiteCoreException
LiteCoreException
public long getExpiration(@NonNull String docID) throws LiteCoreException
LiteCoreException
@NonNull public C4Document create(@NonNull String docID, @Nullable FLSliceResult body, int flags) throws LiteCoreException
LiteCoreException
@NonNull public C4DatabaseObserver createDatabaseObserver(@NonNull Object context, @NonNull C4DatabaseObserverListener listener)
@NonNull public C4DocumentObserver createDocumentObserver(@NonNull String docID, @NonNull Object context, @NonNull C4DocumentObserverListener listener)
@NonNull public C4BlobStore getBlobStore() throws LiteCoreException
LiteCoreException
@NonNull public C4Query createJsonQuery(@NonNull String expression) throws LiteCoreException
LiteCoreException
@NonNull public C4Query createN1qlQuery(@NonNull String expression) throws LiteCoreException
LiteCoreException
public void createIndex(@NonNull String name, @NonNull String queryExpression, @NonNull AbstractIndex.QueryLanguage queryLanguage, @NonNull AbstractIndex.IndexType indexType, @Nullable String language, boolean ignoreDiacritics) throws LiteCoreException
LiteCoreException
public void deleteIndex(String name) throws LiteCoreException
LiteCoreException
@NonNull public FLValue getIndexesInfo() 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, @Nullable 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, @Nullable byte[] options, @Nullable C4ReplicatorListener listener, @Nullable C4ReplicationFilter pushFilter, @Nullable C4ReplicationFilter pullFilter, @NonNull AbstractReplicator replicatorContext) throws LiteCoreException
LiteCoreException
@NonNull 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, boolean acceptParentDomain) throws LiteCoreException
LiteCoreException
@Nullable public String getCookies(@NonNull URI uri) throws LiteCoreException
LiteCoreException
@NonNull public C4Document get(@NonNull String docID, boolean mustExist) throws LiteCoreException
LiteCoreException
@NonNull public C4Document put(@NonNull byte[] body, @NonNull String docID, int revFlags, boolean existingRevision, boolean allowConflict, @NonNull String[] history, boolean save, int maxRevTreeDepth, int remoteDBID) throws LiteCoreException
LiteCoreException