/***
* creates new records for new push settings and migrates the old ones into the profile n.1
* @param db
*/
private void multiPushProfileSettings(ODatabaseRecordTx db) {
IndexPushConfiguration idx;
try {
idx = new IndexPushConfiguration();
} catch (IndexNotFoundException e) {
throw new RuntimeException(e);
}
//load the old settings
String sandbox=null;
if(idx.get("push.sandbox.enable")==null) sandbox="true";
else sandbox=idx.get("push.sandbox.enable").toString();
//String sandbox = StringUtils.defaultString(()idx.get("push.sandbox.enable"),"true");
String appleTimeout=null;
if(idx.get("push.apple.timeout")==null) appleTimeout="0";
else appleTimeout=idx.get("push.apple.timeout").toString();
//StringUtils.defaultString((String)idx.get("push.apple.timeout"),null);
String sandboxAndroidApiKey= StringUtils.defaultString((String)idx.get("sandbox.android.api.key"),null);
String sandBoxIosCertificatePassword = StringUtils.defaultString((String)idx.get("sandbox.ios.certificate.password"),null);
String prodAndroidApiKey= StringUtils.defaultString((String)idx.get("production.android.api.key"),null);
String prodBoxIosCertificatePassword = StringUtils.defaultString((String)idx.get("production.ios.certificate.password"),null);
//Houston we have a problem. Here we have to handle the iOS certificates that are files!
Object sandBoxIosCertificate = getValueAsFileContainer(idx.get("sandbox.ios.certificate"));
Object prodBoxIosCertificate = getValueAsFileContainer(idx.get("production.ios.certificate"));
try{
//set the new profile1 settings
Push.PROFILE1_PRODUCTION_ANDROID_API_KEY._setValue(prodAndroidApiKey);
if(prodBoxIosCertificate != null) Push.PROFILE1_PRODUCTION_IOS_CERTIFICATE._setValue(prodBoxIosCertificate);