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;
25 import android.content.Context;
28 * Data structure to provide the configuration.
30 public class PlatformConfig {
32 private Context mContext;
33 private ServiceType mServiceType;
34 private ModeType mModeType;
35 private String mIpAddress;
37 private QualityOfService mQualityOfService;
38 private String mSvrDbPath; //TODO: Instead of SVRDB file, it should be Persistent Storage.
39 //this is only for 0.9.2
42 * @param context app context
43 * @param serviceType indicate IN_PROC or OUT_OF_PROC
44 * @param modeType indicate whether we want to do server, client or both
45 * @param ipAddress ip address of server
46 * if you specify 0.0.0.0 : it listens on any interface
47 * @param port port of server
48 * if you specifiy 0 : next available random port is used
49 * if you specify 5683 : client discovery can work even if they don't
51 * @param qualityOfService quality of service
52 * @param dbPath Persistant storage file for SVR Database.
54 public PlatformConfig(Context context,
55 ServiceType serviceType,
59 QualityOfService qualityOfService,
61 this.mContext = context;
62 this.mServiceType = serviceType;
63 this.mModeType = modeType;
64 this.mIpAddress = ipAddress;
66 this.mQualityOfService = qualityOfService;
67 this.mSvrDbPath = dbPath;
71 * @param context app context
72 * @param serviceType indicate IN_PROC or OUT_OF_PROC
73 * @param modeType indicate whether we want to do server, client or both
74 * @param ipAddress ip address of server
75 * if you specify 0.0.0.0 : it listens on any interface
76 * @param port port of server
77 * if you specifiy 0 : next available random port is used
78 * if you specify 5683 : client discovery can work even if they don't
80 * @param qualityOfService quality of service
82 //Avoid breaking building java samples due to persistent storage SVR DB changes.
83 public PlatformConfig(Context context,
84 ServiceType serviceType,
88 QualityOfService qualityOfService) {
89 this(context,serviceType,modeType,ipAddress,port,qualityOfService, "");
92 public Context getContext() {
96 public ServiceType getServiceType() {
100 public ModeType getModeType() {
104 public String getIpAddress() {
108 public int getPort() {
112 public QualityOfService getQualityOfService() {
113 return mQualityOfService;
116 public String getSvrDbPath() {