12
12
13
13
/**
14
14
* A chain of PushHandlers that processes events in order.
15
+ * <p>
15
16
* Uses a context object for tracking the processed state.
17
+ * </p>
16
18
*/
17
19
@ Internal
18
20
public final class PushConsumerChain implements PushConsumer {
@@ -37,13 +39,14 @@ public final class PushConsumerChain implements PushConsumer {
37
39
context .setProcessed (false );
38
40
};
39
41
40
-
41
42
/**
42
- * Handler that allows only pub/sub related events to be propagated to the client.
43
+ * Handler that allows only pub/sub related events to be propagated to the client
44
+ * <p>
43
45
* Marks non-pub/sub events as processed, preventing their propagation.
46
+ * </p>
44
47
*/
45
- public static final PushConsumer PUBSUB_ONLY_HANDLER = new PushConsumer (){
46
- final Set <String > pubSubCommands = new HashSet <>();
48
+ public static final PushConsumer PUBSUB_ONLY_HANDLER = new PushConsumer () {
49
+ final Set <String > pubSubCommands = new HashSet <>();
47
50
{
48
51
pubSubCommands .add ("message" );
49
52
pubSubCommands .add ("pmessage" );
@@ -69,7 +72,6 @@ private boolean isPubSubType(String type) {
69
72
}
70
73
};
71
74
72
-
73
75
/**
74
76
* Create a new empty handler chain.
75
77
*/
@@ -79,7 +81,6 @@ public PushConsumerChain() {
79
81
80
82
/**
81
83
* Create a chain with the specified handlers.
82
- *
83
84
* @param consumers The handlers to add to the chain
84
85
*/
85
86
public PushConsumerChain (PushConsumer ... consumers ) {
@@ -88,7 +89,6 @@ public PushConsumerChain(PushConsumer... consumers) {
88
89
89
90
/**
90
91
* Create a chain with a single handler.
91
- *
92
92
* @param handler The handler to include in the chain
93
93
* @return A new handler chain with the specified handler
94
94
*/
@@ -98,7 +98,6 @@ public static PushConsumerChain of(PushConsumer handler) {
98
98
99
99
/**
100
100
* Create a chain with the specified handlers.
101
- *
102
101
* @param handlers The handlers to add to the chain
103
102
* @return A new handler chain with the specified handlers
104
103
*/
@@ -108,7 +107,6 @@ public static PushConsumerChain of(PushConsumer... handlers) {
108
107
109
108
/**
110
109
* Add a handler to be executed after this chain.
111
- *
112
110
* @param handler The handler to add
113
111
* @return A new chain with the handler added
114
112
*/
@@ -126,7 +124,6 @@ public PushConsumerChain then(PushConsumer handler) {
126
124
127
125
/**
128
126
* Add a handler to the end of the chain.
129
- *
130
127
* @param handler The handler to add
131
128
* @return this chain for method chaining
132
129
*/
@@ -139,7 +136,6 @@ public PushConsumerChain add(PushConsumer handler) {
139
136
140
137
/**
141
138
* Insert a handler at the specified position.
142
- *
143
139
* @param index The position to insert at (0-based)
144
140
* @param handler The handler to insert
145
141
* @return this chain for method chaining
@@ -153,7 +149,6 @@ public PushConsumerChain insert(int index, PushConsumer handler) {
153
149
154
150
/**
155
151
* Remove a handler from the chain.
156
- *
157
152
* @param handler The handler to remove
158
153
* @return true if the handler was removed
159
154
*/
@@ -163,7 +158,6 @@ public boolean remove(PushConsumer handler) {
163
158
164
159
/**
165
160
* Remove the handler at the specified position.
166
- *
167
161
* @param index The position to remove from (0-based)
168
162
* @return The removed handler
169
163
*/
@@ -173,7 +167,6 @@ public PushConsumer removeAt(int index) {
173
167
174
168
/**
175
169
* Get the handler at the specified position.
176
- *
177
170
* @param index The position to get (0-based)
178
171
* @return The handler at that position
179
172
*/
@@ -183,7 +176,6 @@ public PushConsumer get(int index) {
183
176
184
177
/**
185
178
* Get the number of handlers in the chain.
186
- *
187
179
* @return The number of handlers
188
180
*/
189
181
public int size () {
0 commit comments