make NodeStatus a plain data class
This commit is contained in:
parent
acf5b3579b
commit
4861ec5a40
6 changed files with 75 additions and 63 deletions
|
@ -428,3 +428,34 @@ jobject newVirtualNetworkDNS(JNIEnv *env, const ZT_VirtualNetworkDNS &dns)
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
jobject newNodeStatus(JNIEnv *env, const ZT_NodeStatus &status) {
|
||||
|
||||
jstring pubIdentStr = env->NewStringUTF(status.publicIdentity);
|
||||
if(env->ExceptionCheck() || pubIdentStr == NULL)
|
||||
{
|
||||
LOGE("Exception creating new string");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
jstring secIdentStr = env->NewStringUTF(status.secretIdentity);
|
||||
if(env->ExceptionCheck() || secIdentStr == NULL)
|
||||
{
|
||||
LOGE("Exception creating new string");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
jobject nodeStatusObj = env->NewObject(
|
||||
NodeStatus_class,
|
||||
NodeStatus_ctor,
|
||||
status.address,
|
||||
pubIdentStr,
|
||||
secIdentStr,
|
||||
status.online);
|
||||
if(env->ExceptionCheck() || nodeStatusObj == NULL) {
|
||||
LOGE("Exception creating new NodeStatus");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return nodeStatusObj;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue