-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into file_rename
- Loading branch information
Showing
70 changed files
with
901 additions
and
235 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
app/src/main/java/com/gojek/courier/app/data/network/CourierService.kt
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
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
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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
package com.gojek.courier | ||
|
||
enum class QoS(val value: Int) { | ||
ZERO(0), | ||
ONE(1), | ||
TWO(2) | ||
enum class QoS(val value: Int, val type: Int) { | ||
// http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718100 | ||
ZERO(0, 0), | ||
|
||
// http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718100 | ||
ONE(1, 1), | ||
|
||
// http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718100 | ||
TWO(2, 2), | ||
|
||
/** Like QoS1, Message delivery is acknowledged with PUBACK, but unlike QoS1 messages are | ||
neither persisted nor retried at send after one attempt. | ||
The message arrives at the receiver either once or not at all **/ | ||
ONE_WITHOUT_PERSISTENCE_AND_NO_RETRY(0, 3), | ||
|
||
/** Like QoS1, Message delivery is acknowledged with PUBACK, but unlike QoS1 messages are | ||
not persisted. The messages are retried within active connection if delivery is not acknowledged.**/ | ||
ONE_WITHOUT_PERSISTENCE_AND_RETRY(0, 4) | ||
} |
19 changes: 19 additions & 0 deletions
19
courier-core/src/main/java/com/gojek/courier/callback/NoOpSendMessageCallback.kt
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,19 @@ | ||
package com.gojek.courier.callback | ||
|
||
object NoOpSendMessageCallback : SendMessageCallback { | ||
override fun onMessageSendTrigger() { | ||
// no-op | ||
} | ||
|
||
override fun onMessageWrittenOnSocket() { | ||
// no-op | ||
} | ||
|
||
override fun onMessageSendSuccess() { | ||
// no-op | ||
} | ||
|
||
override fun onMessageSendFailure(error: Throwable) { | ||
// no-op | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
courier-core/src/main/java/com/gojek/courier/callback/SendMessageCallback.kt
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,8 @@ | ||
package com.gojek.courier.callback | ||
|
||
interface SendMessageCallback { | ||
fun onMessageSendTrigger() | ||
fun onMessageWrittenOnSocket() | ||
fun onMessageSendSuccess() | ||
fun onMessageSendFailure(error: Throwable) | ||
} |
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
6 changes: 6 additions & 0 deletions
6
courier/src/main/java/com/gojek/courier/annotation/Callback.kt
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,6 @@ | ||
package com.gojek.courier.annotation | ||
|
||
@MustBeDocumented | ||
@Target(AnnotationTarget.VALUE_PARAMETER) | ||
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) | ||
annotation class Callback |
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
Oops, something went wrong.