public static AccountDetailVO getAccountDetail(long csAccountId, long storagePoolId, AccountDetailsDao accountDetailsDao) { AccountDetailVO accountDetail = accountDetailsDao.findDetail(csAccountId, SolidFireUtil.getAccountKey(storagePoolId)); if (accountDetail == null || accountDetail.getValue() == null) { accountDetail = accountDetailsDao.findDetail(csAccountId, SolidFireUtil.ACCOUNT_ID); } return accountDetail; }
@Override public long getSolidFireAccountId(String csAccountUuid, String storagePoolUuid) { long csAccountId = util.getAccountIdForAccountUuid(csAccountUuid); long storagePoolId = util.getStoragePoolIdForStoragePoolUuid(storagePoolUuid); AccountDetailVO accountDetail = accountDetailsDao.findDetail(csAccountId, SolidFireUtil.getAccountKey(storagePoolId)); if (accountDetail == null) { throw new CloudRuntimeException("Unable to find SF account for storage " + storagePoolUuid + " for CS account " + csAccountUuid); } String sfAccountId = accountDetail.getValue(); return Long.parseLong(sfAccountId); }
throw new InvalidParameterValueException("unable to find account by id " + resourceId); AccountDetailVO accountDetailVO = _accountDetailsDao.findDetail(resourceId, name); if (accountDetailVO == null) { accountDetailVO = new AccountDetailVO(resourceId, name, value);