2 * //******************************************************************
4 * // Copyright 2015 Intel Corporation.
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * // Licensed under the Apache License, Version 2.0 (the "License");
9 * // you may not use this file except in compliance with the License.
10 * // You may obtain a copy of the License at
12 * // http://www.apache.org/licenses/LICENSE-2.0
14 * // Unless required by applicable law or agreed to in writing, software
15 * // distributed under the License is distributed on an "AS IS" BASIS,
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * // See the License for the specific language governing permissions and
18 * // limitations under the License.
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 #include "JniOcResourceIdentifier.h"
25 JniOcResourceIdentifier::JniOcResourceIdentifier(OC::OCResourceIdentifier resourceIdentifier)
26 : m_resourceIdentifier(resourceIdentifier)
29 JniOcResourceIdentifier::~JniOcResourceIdentifier()
31 LOGD("~JniOcResourceIdentifier()");
34 OC::OCResourceIdentifier JniOcResourceIdentifier::getOCResourceIdentifier()
36 return this->m_resourceIdentifier;
39 JniOcResourceIdentifier* JniOcResourceIdentifier::getJniOcResourceIdentifierPtr
40 (JNIEnv *env, jobject thiz)
42 JniOcResourceIdentifier *identifier = GetHandle<JniOcResourceIdentifier>(env, thiz);
43 if (env->ExceptionCheck())
45 LOGE("Failed to get native handle from OcResourceIdentifier");
49 ThrowOcException(JNI_NO_NATIVE_POINTER, "");
55 * Class: org_iotivity_base_OcResourceIdentifier
57 * Signature: (Lorg/iotivity/base/OcResourceIdentifier;)Z
59 JNIEXPORT jboolean JNICALL Java_org_iotivity_base_OcResourceIdentifier_equalsN
60 (JNIEnv *env, jobject jThiz, jobject jOther)
62 JniOcResourceIdentifier *thiz = JniOcResourceIdentifier::getJniOcResourceIdentifierPtr(env, jThiz);
63 if (!thiz) return false;
65 JniOcResourceIdentifier *other = JniOcResourceIdentifier::getJniOcResourceIdentifierPtr(env, jOther);
66 if (!other) return false;
68 if (thiz->getOCResourceIdentifier() == other->getOCResourceIdentifier())
79 * Class: org_iotivity_base_OcResourceIdentifier
83 JNIEXPORT void JNICALL Java_org_iotivity_base_OcResourceIdentifier_dispose
84 (JNIEnv *env, jobject thiz)
86 LOGD("JniOcResourceIdentifier_dispose");
87 JniOcResourceIdentifier *identifier = JniOcResourceIdentifier::getJniOcResourceIdentifierPtr(env, thiz);