Skip to content
Snippets Groups Projects
Commit fb2c6d34 authored by Kamal Bramwell's avatar Kamal Bramwell
Browse files

Updated Bindings adapter classes

parent 4437edff
No related branches found
No related tags found
No related merge requests found
Showing
with 225 additions and 6 deletions
...@@ -6,8 +6,9 @@ import kotlinx.coroutines.flow.Flow ...@@ -6,8 +6,9 @@ import kotlinx.coroutines.flow.Flow
interface GroupsApi { interface GroupsApi {
val groupMessages: Flow<Message> val groupMessages: Flow<Message>
fun sendInvitation() fun sendInvitation()
fun retryInvitation() fun resendInvitation()
fun acceptInvitation() fun joinGroup()
fun leaveGroup()
fun sendMessage() fun sendMessage()
fun retryMessage() fun retryMessage()
} }
\ No newline at end of file
package io.elixxir.dapp.bindings.data package io.elixxir.dapp.bindings.data
internal interface Cmix { import bindings.ReceptionIdentity
import io.elixxir.dapp.bindings.model.Connection
import io.elixxir.dapp.bindings.model.NetworkFollowerStatus
import io.elixxir.dapp.bindings.model.NodeRegistrationStatus
internal interface Cmix {
fun connect(): Connection
fun startNetworkFollower()
fun stopNetworkFollower()
fun isNetworkHealthy(): Boolean
fun registerHealthCallback()
fun unregisterHealthCallback()
fun getNodeRegistrationStatus(): NodeRegistrationStatus
fun makeReceptionIdentity(): ReceptionIdentity
fun getNetworkFollowerStatus(): NetworkFollowerStatus
} }
package io.elixxir.dapp.bindings.data package io.elixxir.dapp.bindings.data
import bindings.ReceptionIdentity
import io.elixxir.dapp.bindings.model.Connection
import io.elixxir.dapp.bindings.model.NetworkFollowerStatus
import io.elixxir.dapp.bindings.model.NodeRegistrationStatus
import bindings.Cmix as CoreCmix import bindings.Cmix as CoreCmix
@JvmInline @JvmInline
internal value class CmixAdapter(private val cmix: CoreCmix) : Cmix internal value class CmixAdapter(private val cmix: CoreCmix) : Cmix {
\ No newline at end of file
override fun connect(): Connection {
TODO("Not yet implemented")
}
override fun startNetworkFollower() {
TODO("Not yet implemented")
}
override fun stopNetworkFollower() {
TODO("Not yet implemented")
}
override fun isNetworkHealthy(): Boolean {
TODO("Not yet implemented")
}
override fun registerHealthCallback() {
TODO("Not yet implemented")
}
override fun unregisterHealthCallback() {
TODO("Not yet implemented")
}
override fun getNodeRegistrationStatus(): NodeRegistrationStatus {
TODO("Not yet implemented")
}
override fun makeReceptionIdentity(): ReceptionIdentity {
TODO("Not yet implemented")
}
override fun getNetworkFollowerStatus(): NetworkFollowerStatus {
TODO("Not yet implemented")
}
}
\ No newline at end of file
package io.elixxir.dapp.bindings.data package io.elixxir.dapp.bindings.data
import io.elixxir.dapp.bindings.model.ReceptionIdentity
internal interface E2e { internal interface E2e {
val payloadSize: Long
fun getReceptionId(): ReceptionIdentity
fun getContact()
fun callAllReceivedRequests()
fun confirmRequest()
fun deleteAllRequests()
fun deleteRequest()
fun deleteSendRequests()
fun getAllPartnerIds()
fun hasAuthenticatedChannel()
fun registerListener()
fun reset()
fun sendRequest()
fun verifyOwnership()
fun sendE2e()
} }
...@@ -10,16 +10,67 @@ internal value class E2eAdapter(private val e2e: CoreE2e) : E2e { ...@@ -10,16 +10,67 @@ internal value class E2eAdapter(private val e2e: CoreE2e) : E2e {
e2e.confirm(userId) e2e.confirm(userId)
} }
fun deleteAllRequests() { override fun deleteAllRequests() {
e2e.deleteAllRequests() e2e.deleteAllRequests()
} }
override fun deleteRequest() {
TODO("Not yet implemented")
}
override fun deleteSendRequests() {
TODO("Not yet implemented")
}
override fun getAllPartnerIds() {
TODO("Not yet implemented")
}
override fun hasAuthenticatedChannel() {
TODO("Not yet implemented")
}
override fun registerListener() {
TODO("Not yet implemented")
}
override fun reset() {
TODO("Not yet implemented")
}
override fun sendRequest() {
TODO("Not yet implemented")
}
override fun verifyOwnership() {
TODO("Not yet implemented")
}
override fun sendE2e() {
TODO("Not yet implemented")
}
fun deleteReceivedRequests() { fun deleteReceivedRequests() {
e2e.deleteReceiveRequests() e2e.deleteReceiveRequests()
} }
fun getReceptionId(): ReceptionIdentity { override val payloadSize: Long
get() = TODO("Not yet implemented")
override fun getReceptionId(): ReceptionIdentity {
return ReceptionIdentity(e2e.receptionID) return ReceptionIdentity(e2e.receptionID)
} }
override fun getContact() {
TODO("Not yet implemented")
}
override fun callAllReceivedRequests() {
TODO("Not yet implemented")
}
override fun confirmRequest() {
TODO("Not yet implemented")
}
} }
\ No newline at end of file
package io.elixxir.dapp.bindings.data
import io.elixxir.dapp.group.model.GroupId
internal interface GroupChat {
fun getGroup(groupId: GroupId)
fun joinGroup()
fun leaveGroup()
fun makeGroup()
fun resendInvitation()
}
\ No newline at end of file
package io.elixxir.dapp.bindings.data
import io.elixxir.dapp.group.model.GroupId
import bindings.GroupChat as CoreGroupChat
internal class GroupChatAdapter(private val groupChat: CoreGroupChat) : GroupChat {
override fun getGroup(groupId: GroupId) {
TODO("Not yet implemented")
}
override fun joinGroup() {
TODO("Not yet implemented")
}
override fun leaveGroup() {
TODO("Not yet implemented")
}
override fun makeGroup() {
TODO("Not yet implemented")
}
override fun resendInvitation() {
TODO("Not yet implemented")
}
}
\ No newline at end of file
package io.elixxir.dapp.bindings.model
internal interface AuthenticatedConnection : Connection {
fun isAuthenticated()
}
\ No newline at end of file
package io.elixxir.dapp.bindings.model
internal interface Connection {
fun getId(): Long
fun getPartner(): ByteArray
fun registerListener()
fun sendE2e()
fun close()
}
\ No newline at end of file
package io.elixxir.dapp.bindings.model
import bindings.Connection as CoreConnection
@JvmInline
value class ConnectionAdapter(private val connection: CoreConnection) : Connection {
override fun getId(): Long {
TODO("Not yet implemented")
}
override fun getPartner(): ByteArray {
TODO("Not yet implemented")
}
override fun registerListener() {
TODO("Not yet implemented")
}
override fun sendE2e() {
TODO("Not yet implemented")
}
override fun close() {
TODO("Not yet implemented")
}
}
\ No newline at end of file
package io.elixxir.dapp.bindings.model
import io.elixxir.dapp.group.model.GroupId
internal interface Group {
val id: GroupId
val name: String
val initMessage: String
val members: List<String>
val creationTimeMs: Long
}
\ No newline at end of file
package io.elixxir.dapp.bindings.model
class NodeRegistrationStatus {
}
\ No newline at end of file
package io.elixxir.dapp.group.model
@JvmInline
value class GroupId(val value: ByteArray)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment