42c7b790a9e2cb84bfbf1132894169522415c810
[platform/upstream/iotivity.git] / service / simulator / java / sdk / src / org / oic / simulator / server / SimulatorCollectionResource.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.oic.simulator.server;
18
19 import java.util.Vector;
20
21 import org.oic.simulator.InvalidArgsException;
22 import org.oic.simulator.SimulatorException;
23
24 public final class SimulatorCollectionResource extends SimulatorResource {
25
26     private SimulatorCollectionResource(long nativeHandle) {
27         mNativeHandle = nativeHandle;
28     }
29
30     /**
31      * API to add child resource to collection.
32      *
33      * @param resource
34      *            Child resource to be added to collection.
35      *
36      * @throws InvalidArgsException
37      *             This exception will be thrown on invalid input.
38      * @throws SimulatorException
39      *             This exception will be thrown on occurrence of error in
40      *             native.
41      */
42     public native void addChildResource(SimulatorResource resource)
43             throws InvalidArgsException, SimulatorException;
44
45     /**
46      * API to remove child resource from collection.
47      *
48      * @param resource
49      *            Child resource to be removed from collection.
50      *
51      * @throws InvalidArgsException
52      *             This exception will be thrown on invalid input.
53      * @throws SimulatorException
54      *             This exception will be thrown on occurrence of error in
55      *             native.
56      */
57     public native void removeChildResource(SimulatorResource resource)
58             throws InvalidArgsException, SimulatorException;
59
60     /**
61      * API to remove child resource from collection.
62      *
63      * @param uri
64      *            URI of child resource to be removed from collection.
65      *
66      * @throws InvalidArgsException
67      *             This exception will be thrown on invalid input.
68      * @throws SimulatorException
69      *             This exception will be thrown on occurrence of error in
70      *             native.
71      */
72     public native void removeChildResourceByUri(String uri)
73             throws InvalidArgsException, SimulatorException;
74
75     /**
76      * API to get list of child resources.
77      *
78      * @return Vector of child resources {@link SimulatorResource}.
79      *
80      * @throws SimulatorException
81      *             This exception will be thrown on occurrence of error in
82      *             native.
83      */
84     public native Vector<SimulatorResource> getChildResource()
85             throws SimulatorException;
86 }