1 //******************************************************************
3 // Copyright 2014 MediaTek All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 package org.iotivity.base;
23 public class OCResource extends NativeInstance {
24 final private static String TAG = "OCResource";
26 System.loadLibrary("ocstack-jni");
29 public native OCStackResult get(AbstractGetCallback attributeHandler);
30 // public native OCStackResult get(AbstractGetCallback attributeHandler, PlatformConfig.QualityOfService QoS);
32 public native OCStackResult get(String resourceType, String resourceInterface, AbstractGetCallback attributeHandler);
33 // public native OCStackResult get(String resourceType, String resourceInterface, AbstractGetCallback attributeHandler, PlatformConfig.QualityOfService QoS);
35 public native OCStackResult put(OCRepresentation rep, AbstractPutCallback attributeHandler);
36 // public native OCStackResult put(OCRepresentation rep, AbstractPutCallback attributeHandler, PlatformConfig.QualityOfService QoS);
37 // public native OCStackResult put(String resourceType, String resourceInterface, OCRepresentation rep, AbstractPutCallback attributeHandler);
38 // public native OCStackResult put(String resourceType, String resourceInterface, OCRepresentation rep, AbstractPutCallback attributeHandler, PlatformConfig.QualityOfService QoS);
40 public native OCStackResult post(OCRepresentation rep, AbstractPostCallback attributeHandler);
41 // public native OCStackResult post(OCRepresentation rep, AbstractPostCallback attributeHandler, PlatformConfig.QualityOfService QoS);
42 // public native OCStackResult post(String resourceType, String resourceInterface, OCRepresentation rep, AbstractPostCallback attributeHandler);
43 // public native OCStackResult post(String resourceType, String resourceInterface, OCRepresentation rep, AbstractPostCallback attributeHandler, PlatformConfig.QualityOfService QoS);
45 public native OCStackResult observe(int observeType, AbstractObserveCallback observerHandler);
46 // public native OCStackResult observe(int observeType, AbstractObserveCallback observerHandler, PlatformConfig.QualityOfService QoS);
48 public native OCStackResult cancelObserve();
49 // public native OCStackResult cancelObserve(PlatformConfig.QualityOfService QoS);
51 public native String uri();
52 public native String host();
54 public native String[] getResourceInterfaces();
55 public native String[] getResourceTypes();
57 public OCResource(long instPtr) {
58 super.nativeHandle = instPtr;