2 *******************************************************************
4 * Copyright 2015 Intel Corporation.
6 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
20 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 package org.iotivity.base;
26 * Data structure to provide the configuration.
28 public class PlatformConfig {
29 private ServiceType mServiceType;
30 private ModeType mModeType;
31 private String mIpAddress;
33 private QualityOfService mQualityOfService;
34 private String mSvrDbPath; //TODO: Instead of SVRDB file, it should be Persistent Storage.
35 //this is only for 0.9.2
37 * @param serviceType indicate IN_PROC or OUT_OF_PROC
38 * @param modeType indicate whether we want to do server, client or both
39 * @param ipAddress ip address of server
40 * if you specify 0.0.0.0 : it listens on any interface
41 * @param port port of server
42 * if you specifiy 0 : next available random port is used
43 * if you specify 5683 : client discovery can work even if they don't
45 * @param qualityOfService quality of service
46 * @param dbPath Persistant storage file for SVR Database.
48 public PlatformConfig(
49 ServiceType serviceType,
53 QualityOfService qualityOfService,
55 this.mServiceType = serviceType;
56 this.mModeType = modeType;
57 this.mIpAddress = ipAddress;
59 this.mQualityOfService = qualityOfService;
60 this.mSvrDbPath = dbPath;
64 * @param serviceType indicate IN_PROC or OUT_OF_PROC
65 * @param modeType indicate whether we want to do server, client or both
66 * @param ipAddress ip address of server
67 * if you specify 0.0.0.0 : it listens on any interface
68 * @param port port of server
69 * if you specifiy 0 : next available random port is used
70 * if you specify 5683 : client discovery can work even if they don't
72 * @param qualityOfService quality of service
74 // Avoid breaking building java samples due to persistent storage SVR DB changes.
75 public PlatformConfig(
76 ServiceType serviceType,
80 QualityOfService qualityOfService) {
81 this(serviceType,modeType,ipAddress,port,qualityOfService, "");
84 public ServiceType getServiceType() {
88 public ModeType getModeType() {
92 public String getIpAddress() {
96 public int getPort() {
100 public QualityOfService getQualityOfService() {
101 return mQualityOfService;
104 public String getSvrDbPath() {