public OTDetails getOTAccountDetails(String accountID) {
System.out.println("In getOTAccountDetails: ");
OTDetails otDetails = new OTDetails();
if (!Utility.VerifyStringVal(accountID)) {
System.out.println("Failure: accountID is null.");
return otDetails;
}
// ---------------------------------------------
otDetails.setAccountID(accountID);
// ---------------------------------------------
String strServerID = otapiJNI.OTAPI_Basic_GetAccountWallet_ServerID(accountID);
if (!Utility.VerifyStringVal(strServerID)) {
System.out.println("Failure: serverID is null for accountID: " + accountID);
return otDetails;
}
otDetails.setServerID(strServerID);
String serverName = otapiJNI.OTAPI_Basic_GetServer_Name(strServerID);
if (!Utility.VerifyStringVal(serverName)) {
System.out.println("Failure: serverName is null for serverID: " + strServerID);
return otDetails;
}
otDetails.setServerName(serverName);
// ---------------------------------------------
String strAssetID = otapiJNI.OTAPI_Basic_GetAccountWallet_AssetTypeID(accountID);
if (!Utility.VerifyStringVal(strAssetID)) {
System.out.println("Failure: assetID is null for accountID: " + accountID);
return otDetails;
}
otDetails.setAssetID(strAssetID);
String assetName = otapiJNI.OTAPI_Basic_GetAssetType_Name(strAssetID);
if (!Utility.VerifyStringVal(assetName)) {
System.out.println("Failure: assetName is null for assetID: " + strAssetID);
return otDetails;
}
otDetails.setAssetName(assetName);
// ---------------------------------------------
String strAccountName = otapiJNI.OTAPI_Basic_GetAccountWallet_Name(accountID);
if (!Utility.VerifyStringVal(strAccountName)) {
System.out.println("Failure: strAccountName is null for accountID: " + accountID);
return otDetails;
}
otDetails.setAccountName(strAccountName);
// ---------------------------------------------
String strNymID = otapiJNI.OTAPI_Basic_GetAccountWallet_NymID(accountID);
if (!Utility.VerifyStringVal(strNymID)) {
System.out.println("Failure: nymID is null for accountID: " + accountID);
return otDetails;
}
otDetails.setNymID(strNymID);
String strNymName = !Utility.VerifyStringVal(strNymID) ? "" : otapiJNI.OTAPI_Basic_GetNym_Name(strNymID);
if (!Utility.VerifyStringVal(strNymName)) {
System.out.println("Failure: strNymName is null for nymID: " + strNymID);
return otDetails;
}
otDetails.setNymName(strNymName);
// ----------------------------------
try {
if (Helpers.getIntermediaryFiles(strServerID, strNymID, accountID)) {
otDetails.setInboxData(getInboxData(accountID));
otDetails.setOutboxData(getOutboxData(accountID));
} else {
System.out.println("getOTAccountDetails: Failed in Utility.getIntermediaryFiles()");
}
} catch (InterruptedException ex) {
Logger.getLogger(OpenTransactionAccount.class.getName()).log(Level.SEVERE, null, ex);
}
// ----------------------------------
String strBalance = otapiJNI.OTAPI_Basic_GetAccountWallet_Balance(accountID);
if (!Utility.VerifyStringVal(strBalance)) {
System.out.println("Failure: strBalance is null for accountID: " + accountID);
return otDetails;
}
otDetails.setBalance(strBalance);
// ---------------------------------------------
if (otapiJNI.OTAPI_Basic_IsBasketCurrency(otapiJNI.OTAPI_Basic_GetAccountWallet_AssetTypeID(accountID))) {
otDetails.setBasketName(otapiJNI.OTAPI_Basic_GetAssetType_Name(otapiJNI.OTAPI_Basic_GetAccountWallet_AssetTypeID(accountID)) == null ? ""
: otapiJNI.OTAPI_Basic_GetAssetType_Name(otapiJNI.OTAPI_Basic_GetAccountWallet_AssetTypeID(accountID)));
}
return otDetails;
}