1 |
| package org.jboss.cache.pojo.test.propagation.impl; |
2 |
| |
3 |
| import org.jboss.cache.pojo.test.propagation.Node; |
4 |
| import org.jboss.cache.pojo.test.propagation.PropagationRule; |
5 |
| import org.jboss.cache.pojo.test.propagation.StateItem; |
6 |
| |
7 |
| import java.util.ArrayList; |
8 |
| import java.util.List; |
9 |
| |
10 |
| public class NodeImpl implements Node |
11 |
| { |
12 |
| private String rdn_; |
13 |
| |
14 |
| private String fdn_; |
15 |
| |
16 |
| private List childNodes_ = new ArrayList(); |
17 |
| |
18 |
| private Node parentNode_; |
19 |
| |
20 |
| private List stateItems_ = new ArrayList(); |
21 |
| |
22 |
| private StateItem summaryItem_; |
23 |
| |
24 |
| private transient PropagationRule rule_; |
25 |
| |
26 |
30
| public NodeImpl()
|
27 |
| { |
28 |
30
| rule_ = PropagationRuleFactory.getPropagationRule();
|
29 |
| } |
30 |
| |
31 |
20
| public void setNodeRDN(String rdn)
|
32 |
| { |
33 |
20
| this.rdn_ = rdn;
|
34 |
| } |
35 |
| |
36 |
88
| public String getNodeRDN()
|
37 |
| { |
38 |
88
| return this.rdn_;
|
39 |
| } |
40 |
| |
41 |
20
| public void setNodeFDN(String fdn)
|
42 |
| { |
43 |
20
| this.fdn_ = fdn;
|
44 |
| } |
45 |
| |
46 |
20
| public String getNodeFDN()
|
47 |
| { |
48 |
20
| return this.fdn_;
|
49 |
| } |
50 |
| |
51 |
16
| public void addChildNode(Node child)
|
52 |
| { |
53 |
16
| childNodes_.add(child);
|
54 |
| } |
55 |
| |
56 |
148
| public List getChildren()
|
57 |
| { |
58 |
148
| return childNodes_;
|
59 |
| } |
60 |
| |
61 |
16
| public void setParentNode(Node parent)
|
62 |
| { |
63 |
16
| parentNode_ = parent;
|
64 |
| } |
65 |
| |
66 |
20
| public Node getParentNode()
|
67 |
| { |
68 |
20
| return this.parentNode_;
|
69 |
| } |
70 |
| |
71 |
22
| public void addStateItem(StateItem stateItem)
|
72 |
| { |
73 |
22
| stateItems_.add(stateItem);
|
74 |
| } |
75 |
| |
76 |
20
| public void setSummaryStateItem(StateItem stateItem)
|
77 |
| { |
78 |
20
| this.summaryItem_ = stateItem;
|
79 |
| } |
80 |
| |
81 |
170
| public StateItem getSummaryStateItem()
|
82 |
| { |
83 |
170
| return this.summaryItem_;
|
84 |
| } |
85 |
| |
86 |
20
| public void setPropagationRule(PropagationRule rule)
|
87 |
| { |
88 |
20
| this.rule_ = rule;
|
89 |
| } |
90 |
| |
91 |
60
| public PropagationRule getPropagationRule()
|
92 |
| { |
93 |
60
| return rule_;
|
94 |
| } |
95 |
| |
96 |
| |
97 |
148
| public List getStateItems()
|
98 |
| { |
99 |
148
| return this.stateItems_;
|
100 |
| } |
101 |
| |
102 |
6
| public StateItem findStateItem(long itemId)
|
103 |
| { |
104 |
6
| StateItem retItem = null;
|
105 |
6
| int size = stateItems_.size();
|
106 |
14
| for (int idx = 0; idx < size; idx++)
|
107 |
| { |
108 |
14
| StateItem stateItem = (StateItem) stateItems_.get(idx);
|
109 |
14
| if (stateItem.getItemId() == itemId)
|
110 |
| { |
111 |
6
| retItem = stateItem;
|
112 |
6
| break;
|
113 |
| } |
114 |
| } |
115 |
| |
116 |
6
| return retItem;
|
117 |
| } |
118 |
| |
119 |
0
| public String toString()
|
120 |
| { |
121 |
0
| return getNodeFDN();
|
122 |
| } |
123 |
| } |