blob: 79620e16e6d1c8a3a0b35d5a8b488471b17dc6fe [file] [log] [blame]
Matt Jeanneretcab955f2019-04-10 15:45:57 -04001/*
2 * Copyright 2018-present Open Networking Foundation
3
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package model
17
18type Revision interface {
19 Finalize(bool)
Matt Jeanneret384d8c92019-05-06 14:27:31 -040020 IsDiscarded() bool
Matt Jeanneretcab955f2019-04-10 15:45:57 -040021 SetConfig(revision *DataRevision)
22 GetConfig() *DataRevision
23 Drop(txid string, includeConfig bool)
24 StorageDrop(txid string, includeConfig bool)
Matt Jeanneret384d8c92019-05-06 14:27:31 -040025 ChildDrop(childType string, childHash string)
Matt Jeanneretcab955f2019-04-10 15:45:57 -040026 SetChildren(name string, children []Revision)
27 GetChildren(name string) []Revision
28 SetAllChildren(children map[string][]Revision)
29 GetAllChildren() map[string][]Revision
30 SetHash(hash string)
31 GetHash() string
32 ClearHash()
33 SetupWatch(key string)
34 SetName(name string)
35 GetName() string
36 SetBranch(branch *Branch)
37 GetBranch() *Branch
38 Get(int) interface{}
39 GetData() interface{}
40 GetNode() *node
41 LoadFromPersistence(path string, txid string) []Revision
42 UpdateData(data interface{}, branch *Branch) Revision
43 UpdateChildren(name string, children []Revision, branch *Branch) Revision
44 UpdateAllChildren(children map[string][]Revision, branch *Branch) Revision
45}