public native String getHost();
/**
+ * Method to get the endpoints information of this resource
+ *
+ * @return List of endpoints information
+ */
+ public native List<String> getAllHosts();
+
+ /**
* Method to get the URI for this resource
*
* @return resource URI
return m_sharedResource->host();
}
+std::vector< std::string > JniOcResource::getAllHosts() const
+{
+ return m_sharedResource->getAllHosts();
+}
+
std::string JniOcResource::uri()
{
return m_sharedResource->uri();
/*
* Class: org_iotivity_base_OcResource
+* Method: getAllHosts
+* Signature: ()Ljava/util/List;
+*/
+JNIEXPORT jobject JNICALL Java_org_iotivity_base_OcResource_getAllHosts
+ (JNIEnv *env, jobject thiz)
+{
+ LOGD("OcResource_getAllHosts");
+ JniOcResource *resource = JniOcResource::getJniOcResourcePtr(env, thiz);
+ if (!resource)
+ {
+ return nullptr;
+ }
+
+ std::vector<std::string> allHosts = resource->getAllHosts();
+
+ return JniUtils::convertStrVectorToJavaStrList(env, allHosts);
+}
+
+/*
+* Class: org_iotivity_base_OcResource
* Method: getUri
* Signature: ()Ljava/lang/String;
*/
void setHeaderOptions(const HeaderOptions &headerOptions);
void unsetHeaderOptions();
std::string host();
+ std::vector< std::string > getAllHosts() const;
std::string uri();
OCConnectivityType connectivityType() const;
bool isObservable();
/*
* Class: org_iotivity_base_OcResource
+ * Method: getAllHosts
+ * Signature: ()Ljava/util/List;
+ */
+ JNIEXPORT jobject JNICALL Java_org_iotivity_base_OcResource_getAllHosts
+ (JNIEnv *, jobject);
+
+ /*
+ * Class: org_iotivity_base_OcResource
* Method: getUri
* Signature: ()Ljava/lang/String;
*/