-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created model class for subscription identifier and implemented decod…
…e and verification in SUBSCRIBE
- Loading branch information
Showing
4 changed files
with
130 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
broker/src/main/java/io/moquette/broker/subscriptions/SubscriptionIdentifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.moquette.broker.subscriptions; | ||
|
||
/** | ||
* Models the subscription identifier for MQTT5 Subscription. | ||
* */ | ||
public final class SubscriptionIdentifier { | ||
private final int subscriptionId; | ||
|
||
public SubscriptionIdentifier(int value) { | ||
if (value <= 0 || value > 268435455) { | ||
throw new IllegalArgumentException("Value MUST be > 0 and <= 268435455"); | ||
} | ||
subscriptionId = value; | ||
} | ||
|
||
public int value() { | ||
return subscriptionId; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters