Open Kilda Java Documentation
DumpStateManager.java
Go to the documentation of this file.
1 /* Copyright 2017 Telstra Open Source
2  *
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 package org.openkilda.messaging.ctrl.state.visitor;
17 
18 
27 
28 import java.util.List;
33 public class DumpStateManager {
34 
35  private CacheBoltState cacheBoltState;
36  private CrudBoltState crudBoltState;
37  private OFELinkBoltState ofeLinkBoltState;
38  private TransactionBoltState transactionBoltState;
39  private ResorceCacheBoltState resorceCacheBoltState;
40 
41  private DumpStateVisitor addVisitor = new DumpStateVisitor(this);
42 
43  public static DumpStateManager fromResponsesList(List<CtrlResponse> responses) {
44  DumpStateManager dumpStateManager = new DumpStateManager();
45  responses.forEach(
46  r -> dumpStateManager.add(((DumpStateResponseData) r.getData()).getState()));
47  return dumpStateManager;
48  }
49 
50  public void add(AbstractDumpState abstractDumpState) {
51  abstractDumpState.accept(addVisitor);
52  }
53 
55  return cacheBoltState;
56  }
57 
58  public void setCacheBoltState(CacheBoltState cacheBoltState) {
59  this.cacheBoltState = cacheBoltState;
60  }
61 
63  return crudBoltState;
64  }
65 
66  public void setCrudBoltState(CrudBoltState crudBoltState) {
67  this.crudBoltState = crudBoltState;
68  }
69 
71  return ofeLinkBoltState;
72  }
73 
74  public void setOfeLinkBoltState(OFELinkBoltState ofeLinkBoltState) {
75  this.ofeLinkBoltState = ofeLinkBoltState;
76  }
77 
79  return transactionBoltState;
80  }
81 
83  TransactionBoltState transactionBoltState) {
84  this.transactionBoltState = transactionBoltState;
85  }
86 
88  return resorceCacheBoltState;
89  }
90 
92  ResorceCacheBoltState resorceCacheBoltState) {
93  this.resorceCacheBoltState = resorceCacheBoltState;
94  }
95 }
static DumpStateManager fromResponsesList(List< CtrlResponse > responses)
abstract void accept(DumpStateVisitor visitor)
void setTransactionBoltState(TransactionBoltState transactionBoltState)
void setResorceCacheBoltState(ResorceCacheBoltState resorceCacheBoltState)
void setOfeLinkBoltState(OFELinkBoltState ofeLinkBoltState)