2 * Copyright 2015 Samsung Electronics All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.iotivity.simulator;
19 import java.util.Vector;
21 public class SimulatorResourceServer {
23 private String resourceName;
24 private String resourceURI;
25 private String resourceType;
26 private String interfaceType;
28 private long nativeHandle;
30 private SimulatorResourceServer(long nativeHandle) {
31 this.nativeHandle = nativeHandle;
34 public void setName(String resourceName) {
35 this.resourceName = resourceName;
38 private void setURI(String resourceURI) {
39 this.resourceURI = resourceURI;
42 private void setResourceType(String resourceType) {
43 this.resourceType = resourceType;
46 private void setInterfaceType(String interfaceType) {
47 this.interfaceType = interfaceType;
50 public String getName() {
54 public String getURI() {
58 public String getResourceType() {
62 public String getInterfaceType() {
67 protected void finalize() throws Throwable {
71 public native SimulatorResourceModel getModel();
73 public native void updateAttributeFromAllowedValues(String attrName,
76 public native void setRange(String attrName, int min, int max);
78 public native void addAttributeInteger(String key, int value);
80 public native void addAttributeDouble(String key, double value);
82 public native void addAttributeBoolean(String key, Boolean value);
84 public native void addAttributeStringN(String key, String value);
86 public native void updateAttributeInteger(String key, int value);
88 public native void updateAttributeDouble(String key, double value);
90 public native void updateAttributeBoolean(String key, Boolean value);
92 public native void updateAttributeStringN(String key, String value);
94 public native void setAllowedValuesInteger(String key, int[] allowedValues);
96 public native void setAllowedValuesDouble(String key, double[] allowedValues);
98 public native void setAllowedValuesStringN(String key,
99 String[] allowedValues);
101 public native int startResourceAutomation();
103 public native int startAttributeAutomation(String attrName);
105 public native void startAutomation(int automationId);
107 public native void removeAttribute(String key);
109 private native void dispose();