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.clientcontroller;
20 * Supported connectivity types.
22 public enum SimulatorConnectivityType {
23 SIMULATOR_CT_DEFAULT(0),
25 /** IPv4 and IPv6, including 6LoWPAN. */
26 SIMULATOR_CT_ADAPTER_IP(1 << 16),
28 /** GATT over Bluetooth LE. */
29 SIMULATOR_CT_ADAPTER_GATT_BTLE(1 << 17),
31 /** RFCOMM over Bluetooth EDR. */
32 SIMULATOR_CT_ADAPTER_RFCOMM_BTEDR(1 << 18),
34 /** Remote Access over XMPP. */
35 SIMULATOR_CT_ADAPTER_REMOTE_ACCESS(1 << 19),
37 /** Insecure transport is the default (subject to change). */
39 /** secure the transport path. */
40 SIMULATOR_CT_FLAG_SECURE(1 << 4),
42 /** IPv4 & IPv6 autoselection is the default. */
44 /** IP adapter only. */
45 SIMULATOR_CT_IP_USE_V6(1 << 5),
47 /** IP adapter only. */
48 SIMULATOR_CT_IP_USE_V4(1 << 6),
51 * Link-Local multicast is the default multicast scope for IPv6. These are
52 * placed here to correspond to the IPv6 address bits.
55 /** IPv6 Interface-Local scope(loopback). */
56 SIMULATOR_CT_SCOPE_INTERFACE(0x1),
58 /** IPv6 Link-Local scope (default). */
59 SIMULATOR_CT_SCOPE_LINK(0x2),
61 /** IPv6 Realm-Local scope. */
62 SIMULATOR_CT_SCOPE_REALM(0x3),
64 /** IPv6 Admin-Local scope. */
65 SIMULATOR_CT_SCOPE_ADMIN(0x4),
67 /** IPv6 Site-Local scope. */
68 SIMULATOR_CT_SCOPE_SITE(0x5),
70 /** IPv6 Organization-Local scope. */
71 SIMULATOR_CT_SCOPE_ORG(0x8),
73 /** IPv6 Global scope. */
74 SIMULATOR_CT_SCOPE_GLOBAL(0xE);
78 private SimulatorConnectivityType(int value) {
82 public int getValue() {
87 * Method to get the {@link SimulatorConnectivityType} from an integer
91 * Integral value of {@link SimulatorConnectivityType}.
92 * @return {@link SimulatorConnectivityType} corresponding to the given
95 public static SimulatorConnectivityType getConnectivityType(int value) {
96 SimulatorConnectivityType result = null;
97 SimulatorConnectivityType[] types = SimulatorConnectivityType.values();
98 for (SimulatorConnectivityType type : types) {
99 if (type.getValue() == value) {