1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_BIND_EVENT_H 17 #define OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_BIND_EVENT_H 18 19 #include <string> 20 21 #include "eventcenter/event.h" 22 #include "snapshot.h" 23 24 namespace OHOS::DistributedData { 25 class API_EXPORT BindEvent : public Event { 26 public: 27 enum : int32_t { 28 BIND_SNAPSHOT = EVT_BIND, 29 COMPENSATE_SYNC, 30 RECOVER_SYNC, 31 }; 32 33 struct BindEventInfo { 34 uint32_t tokenId = 0; 35 int32_t instanceId = 0; 36 int32_t user; 37 std::string bundleName; 38 std::string storeName; 39 std::string tableName; 40 VBucket primaryKey; 41 std::string filed; 42 std::string assetName; 43 }; 44 45 BindEvent(int32_t evtId, BindEventInfo&& bindInfo); 46 47 ~BindEvent() = default; 48 const BindEventInfo& GetBindInfo() const; 49 50 private: 51 BindEventInfo bindInfo_; 52 }; 53 } // namespace OHOS::DistributedData 54 #endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_BIND_EVENT_H 55