Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / android / android_api / base / src / main / java / org / iotivity / base / PlatformConfig.java
index 7fd9ac0..70d9df3 100644 (file)
@@ -35,6 +35,8 @@ public class PlatformConfig {
     private String mIpAddress;\r
     private int mPort;\r
     private QualityOfService mQualityOfService;\r
+    private String mSvrDbPath; //TODO: Instead of SVRDB file, it should be Persistent Storage.
+                              //this is only for 0.9.2
 \r
     /**\r
      * @param context          app context\r
@@ -47,19 +49,44 @@ public class PlatformConfig {
      *                         if you specify 5683 : client discovery can work even if they don't\r
      *                         specify port\r
      * @param qualityOfService quality of service\r
+     * @param dbPath           Persistant storage file for SVR Database.
      */\r
     public PlatformConfig(Context context,\r
                           ServiceType serviceType,\r
                           ModeType modeType,\r
                           String ipAddress,\r
                           int port,\r
-                          QualityOfService qualityOfService) {\r
+                          QualityOfService qualityOfService,
+                          String dbPath) {
         this.mContext = context;\r
         this.mServiceType = serviceType;\r
         this.mModeType = modeType;\r
         this.mIpAddress = ipAddress;\r
         this.mPort = port;\r
         this.mQualityOfService = qualityOfService;\r
+        this.mSvrDbPath = dbPath;
+    }
+
+    /**
+     * @param context          app context
+     * @param serviceType      indicate IN_PROC or OUT_OF_PROC
+     * @param modeType         indicate whether we want to do server, client or both
+     * @param ipAddress        ip address of server
+     *                         if you specify 0.0.0.0 : it listens on any interface
+     * @param port             port of server
+     *                         if you specifiy 0 : next available random port is used
+     *                         if you specify 5683 : client discovery can work even if they don't
+     *                         specify port
+     * @param qualityOfService quality of service
+     */
+    //Avoid breaking building java samples due to persistent storage SVR DB changes.
+    public PlatformConfig(Context context,
+                          ServiceType serviceType,
+                          ModeType modeType,
+                          String ipAddress,
+                          int port,
+                          QualityOfService qualityOfService) {
+        this(context,serviceType,modeType,ipAddress,port,qualityOfService, "");
     }\r
 \r
     public Context getContext() {\r
@@ -84,5 +111,9 @@ public class PlatformConfig {
 \r
     public QualityOfService getQualityOfService() {\r
         return mQualityOfService;\r
+    }
+
+    public String getSvrDbPath() {
+        return mSvrDbPath;
     }\r
 }\r