2 * //******************************************************************
\r
4 * // Copyright 2015 Intel Corporation.
\r
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
8 * // Licensed under the Apache License, Version 2.0 (the "License");
\r
9 * // you may not use this file except in compliance with the License.
\r
10 * // You may obtain a copy of the License at
\r
12 * // http://www.apache.org/licenses/LICENSE-2.0
\r
14 * // Unless required by applicable law or agreed to in writing, software
\r
15 * // distributed under the License is distributed on an "AS IS" BASIS,
\r
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 * // See the License for the specific language governing permissions and
\r
18 * // limitations under the License.
\r
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
23 package org.iotivity.base;
\r
25 import android.content.Context;
\r
28 * Data structure to provide the configuration.
\r
30 public class PlatformConfig {
\r
32 private Context mContext;
\r
33 private ServiceType mServiceType;
\r
34 private ModeType mModeType;
\r
35 private String mIpAddress;
\r
37 private QualityOfService mQualityOfService;
\r
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
\r
43 * @param serviceType indicate IN_PROC or OUT_OF_PROC
\r
44 * @param modeType indicate whether we want to do server, client or both
\r
45 * @param ipAddress ip address of server
\r
46 * if you specify 0.0.0.0 : it listens on any interface
\r
47 * @param port port of server
\r
48 * if you specifiy 0 : next available random port is used
\r
49 * if you specify 5683 : client discovery can work even if they don't
\r
51 * @param qualityOfService quality of service
\r
52 * @param dbPath Persistant storage file for SVR Database.
54 public PlatformConfig(Context context,
\r
55 ServiceType serviceType,
\r
59 QualityOfService qualityOfService,
61 this.mContext = context;
\r
62 this.mServiceType = serviceType;
\r
63 this.mModeType = modeType;
\r
64 this.mIpAddress = ipAddress;
\r
66 this.mQualityOfService = qualityOfService;
\r
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() {
\r
96 public ServiceType getServiceType() {
\r
97 return mServiceType;
\r
100 public ModeType getModeType() {
\r
104 public String getIpAddress() {
\r
108 public int getPort() {
\r
112 public QualityOfService getQualityOfService() {
\r
113 return mQualityOfService;
\r
116 public String getSvrDbPath() {