@react-native-agconnect/clouddb
Version:
React Native AGC CloudDB
65 lines (53 loc) • 1.69 kB
JavaScript
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
*/
import { NativeModules } from 'react-native';
const {AGCCloudDBModule} = NativeModules;
export default class AGCCloudDBZoneConfig {
static CloudDBZoneSyncProperty = {
CLOUDDBZONE_CLOUD_CACHE: AGCCloudDBModule.CloudDBZoneSyncProperty.CLOUDDBZONE_CLOUD_CACHE,
CLOUDDBZONE_LOCAL_ONLY: AGCCloudDBModule.CloudDBZoneSyncProperty.CLOUDDBZONE_LOCAL_ONLY,
}
static CloudDBZoneAccessProperty = {
CLOUDDBZONE_PUBLIC: AGCCloudDBModule.CloudDBZoneAccessProperty.CLOUDDBZONE_PUBLIC,
}
constructor(cloudDBZoneName, cloudDBZoneSyncProperty, cloudDBZoneAccessProperty) {
this.cloudDBZoneName = cloudDBZoneName;
this.accessProperty = cloudDBZoneAccessProperty;
this.syncProperty = cloudDBZoneSyncProperty;
this.persistenceEnabled = true;
this.capacity = 104857600;
this.isEncrypted = false;
this.key = "";
this.reKey = "";
}
getCloudDBZoneName() {
return this.cloudDBZoneName;
}
getSyncProperty() {
return this.syncProperty;
}
getAccessProperty() {
return this.accessProperty;
}
isEncrypted() {
return this.isEncrypted;
}
setEncryptedKey(key, reKey) {
this.isEncrypted = true;
this.key = key;
this.reKey = reKey;
}
setPersistenceEnabled(enabled) {
this.persistenceEnabled = enabled;
}
getPersistenceEnabled() {
return this.persistenceEnabled;
}
setCapacity(capacity) {
this.capacity = capacity
}
getCapacity() {
return this.capacity
}
}