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.oic.simulator.server;
19 import java.util.Vector;
21 import org.oic.simulator.InvalidArgsException;
22 import org.oic.simulator.SimulatorException;
25 * This class represents a collection type resource which provides a set of APIs
26 * that are specific to collection resource for adding/removing child resources
27 * and obtaining all child resources from the collection.
29 public final class SimulatorCollectionResource extends SimulatorResource {
31 private SimulatorCollectionResource(long nativeHandle) {
32 mNativeHandle = nativeHandle;
36 * API to add child resource to collection.
39 * Child resource to be added to collection.
41 * @throws InvalidArgsException
42 * This exception will be thrown on invalid input.
43 * @throws SimulatorException
44 * This exception will be thrown on occurrence of error in
47 public native void addChildResource(SimulatorResource resource)
48 throws InvalidArgsException, SimulatorException;
51 * API to remove child resource from collection.
54 * Child resource to be removed from collection.
56 * @throws InvalidArgsException
57 * This exception will be thrown on invalid input.
58 * @throws SimulatorException
59 * This exception will be thrown on occurrence of error in
62 public native void removeChildResource(SimulatorResource resource)
63 throws InvalidArgsException, SimulatorException;
66 * API to remove child resource from collection.
69 * URI of child resource to be removed from collection.
71 * @throws InvalidArgsException
72 * This exception will be thrown on invalid input.
73 * @throws SimulatorException
74 * This exception will be thrown on occurrence of error in
77 public native void removeChildResourceByUri(String uri)
78 throws InvalidArgsException, SimulatorException;
81 * API to get list of child resources.
83 * @return Vector of child resources {@link SimulatorResource}.
85 * @throws SimulatorException
86 * This exception will be thrown on occurrence of error in
89 public native Vector<SimulatorResource> getChildResource()
90 throws SimulatorException;