1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.mitosis.service.protocol.message;
21
22
23 import org.apache.directory.shared.ldap.util.EqualsBuilder;
24 import org.apache.directory.shared.ldap.util.HashCodeBuilder;
25 import org.apache.directory.mitosis.common.CSNVector;
26 import org.apache.directory.mitosis.service.protocol.Constants;
27
28
29 public class BeginLogEntriesAckMessage extends ResponseMessage
30 {
31 private final CSNVector purgeVector;
32 private final CSNVector updateVector;
33
34
35 public BeginLogEntriesAckMessage( int sequence, int responseCode, CSNVector purgeVector, CSNVector updateVector )
36 {
37 super( sequence, responseCode );
38
39 if ( responseCode == Constants.OK )
40 {
41 assert purgeVector != null;
42 assert updateVector != null;
43
44 this.purgeVector = purgeVector;
45 this.updateVector = updateVector;
46 }
47 else
48 {
49 this.purgeVector = null;
50 this.updateVector = null;
51 }
52 }
53
54
55 public int getType()
56 {
57 return Constants.GET_UPDATE_VECTOR_ACK;
58 }
59
60
61 public CSNVector getPurgeVector()
62 {
63 return purgeVector;
64 }
65
66
67 public CSNVector getUpdateVector()
68 {
69 return updateVector;
70 }
71
72
73
74
75
76 public boolean equals( Object object )
77 {
78 if ( object == this )
79 {
80 return true;
81 }
82
83 if ( !( object instanceof BeginLogEntriesAckMessage ) )
84 {
85 return false;
86 }
87
88 BeginLogEntriesAckMessage rhs = ( BeginLogEntriesAckMessage ) object;
89
90 return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.purgeVector, rhs.purgeVector )
91 .append( this.updateVector, rhs.updateVector ).isEquals();
92 }
93
94
95
96
97
98
99 public int hashCode()
100 {
101 return new HashCodeBuilder( 537917217, 1652875233 ).appendSuper( super.hashCode() ).append( this.purgeVector )
102 .append( this.updateVector ).toHashCode();
103 }
104
105
106 public String toString()
107 {
108 return "[BeginLogEntriesAck] " + super.toString() + ", PV: " + purgeVector + ", UV: " + updateVector;
109 }
110 }