import android.content.Context;
import android.app.Activity;
-
+import java.util.EnumSet;
/**
* Data structure to provide the configuration.
*/
private QualityOfService mQualityOfService;
private String mSvrDbPath; //TODO: Instead of SVRDB file, it should be Persistent Storage.
//this is only for 0.9.2
+ private String mSvrDbPathDefault;
+ private String mSvrDbPathRescue;
+ private int mKeySize;
+ private byte[] mKey;
+ private int mTransportType;
/**
* @param activity app activity
* @param context app context
this.mPort = port;
this.mQualityOfService = qualityOfService;
this.mSvrDbPath = dbPath;
+ this.mTransportType = 0;
}
+ public PlatformConfig(Context context,
+ ServiceType serviceType,
+ ModeType modeType,
+ String ipAddress,
+ int port,
+ QualityOfService qualityOfService,
+ String dbPath,
+ String dbPathDefault,
+ String dbPathRescue,
+ int keySize,
+ byte[] key) {
+ this.mContext = context;
+ this.mServiceType = serviceType;
+ this.mModeType = modeType;
+ this.mIpAddress = ipAddress;
+ this.mPort = port;
+ this.mQualityOfService = qualityOfService;
+ this.mSvrDbPath = dbPath;
+ this.mSvrDbPathDefault = dbPathDefault;
+ this.mSvrDbPathRescue = dbPathRescue;
+ this.mKeySize = keySize;
+ this.mKey = key;
+ this.mTransportType = 0;
+ }
/**
* @param context app context
* @param serviceType indicate IN_PROC or OUT_OF_PROC
return mActivity;
}
+ public String getDBDefaultPath() {
+ return mSvrDbPathDefault;
+ }
+
+ public String getDBRescuePath() {
+ return mSvrDbPathRescue;
+ }
+
+ public int getKeySize()
+ {
+ return mKeySize;
+ }
+
+ public byte[] getKey()
+ {
+ return mKey;
+ }
+
+ public void setAvailableTransportType(EnumSet<OcConnectivityType> type) {
+ for (OcConnectivityType connType : OcConnectivityType.values()) {
+ if (type.contains(connType))
+ mTransportType |= connType.getValue();
+ }
+ }
+
+ public int getAvailableTransportType() {
+ return mTransportType;
+ }
}