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.mitosis.operation.Operation;
24 import org.apache.directory.mitosis.service.protocol.Constants;
25 import org.apache.directory.shared.ldap.util.EqualsBuilder;
26 import org.apache.directory.shared.ldap.util.HashCodeBuilder;
27
28
29 public class LogEntryMessage extends BaseMessage
30 {
31 private final Operation operation;
32
33
34 public LogEntryMessage( int sequence, Operation operation )
35 {
36 super( sequence );
37 this.operation = operation;
38 }
39
40
41 public int getType()
42 {
43 return Constants.LOG_ENTRY;
44 }
45
46
47 public Operation getOperation()
48 {
49 return operation;
50 }
51
52
53
54
55
56 public boolean equals( Object object )
57 {
58 if ( object == this )
59 {
60 return true;
61 }
62
63 if ( !( object instanceof LogEntryMessage ) )
64 {
65 return false;
66 }
67
68 LogEntryMessage rhs = ( LogEntryMessage ) object;
69
70 return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.operation, rhs.operation )
71 .isEquals();
72 }
73
74
75
76
77
78
79 public int hashCode()
80 {
81 return new HashCodeBuilder( 633013569, -1063609843 ).appendSuper( super.hashCode() ).append( this.operation )
82 .toHashCode();
83 }
84
85
86 public String toString()
87 {
88 return "[LogEntry] " + super.toString() + ", " + operation;
89 }
90 }