Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / android / android_api / base / src / main / java / org / iotivity / base / PlatformConfig.java
1 /*\r
2  * //******************************************************************\r
3  * //\r
4  * // Copyright 2015 Intel Corporation.\r
5  * //\r
6  * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
7  * //\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
11  * //\r
12  * //      http://www.apache.org/licenses/LICENSE-2.0\r
13  * //\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
19  * //\r
20  * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
21  */\r
22 \r
23 package org.iotivity.base;\r
24 \r
25 import android.content.Context;\r
26 \r
27 /**\r
28  * Data structure to provide the configuration.\r
29  */\r
30 public class PlatformConfig {\r
31 \r
32     private Context mContext;\r
33     private ServiceType mServiceType;\r
34     private ModeType mModeType;\r
35     private String mIpAddress;\r
36     private int mPort;\r
37     private QualityOfService mQualityOfService;\r
38 \r
39     /**\r
40      * @param context          app context\r
41      * @param serviceType      indicate IN_PROC or OUT_OF_PROC\r
42      * @param modeType         indicate whether we want to do server, client or both\r
43      * @param ipAddress        ip address of server\r
44      *                         if you specify 0.0.0.0 : it listens on any interface\r
45      * @param port             port of server\r
46      *                         if you specifiy 0 : next available random port is used\r
47      *                         if you specify 5683 : client discovery can work even if they don't\r
48      *                         specify port\r
49      * @param qualityOfService quality of service\r
50      */\r
51     public PlatformConfig(Context context,\r
52                           ServiceType serviceType,\r
53                           ModeType modeType,\r
54                           String ipAddress,\r
55                           int port,\r
56                           QualityOfService qualityOfService) {\r
57         this.mContext = context;\r
58         this.mServiceType = serviceType;\r
59         this.mModeType = modeType;\r
60         this.mIpAddress = ipAddress;\r
61         this.mPort = port;\r
62         this.mQualityOfService = qualityOfService;\r
63     }\r
64 \r
65     public Context getContext() {\r
66         return mContext;\r
67     }\r
68 \r
69     public ServiceType getServiceType() {\r
70         return mServiceType;\r
71     }\r
72 \r
73     public ModeType getModeType() {\r
74         return mModeType;\r
75     }\r
76 \r
77     public String getIpAddress() {\r
78         return mIpAddress;\r
79     }\r
80 \r
81     public int getPort() {\r
82         return mPort;\r
83     }\r
84 \r
85     public QualityOfService getQualityOfService() {\r
86         return mQualityOfService;\r
87     }\r
88 }\r