Search in sources :

Example 6 with AccountDetailVO

use of com.cloud.user.AccountDetailVO in project cloudstack by apache.

the class SolidFirePrimaryDataStoreDriver method getCreateSolidFireAccountId.

private long getCreateSolidFireAccountId(SolidFireUtil.SolidFireConnection sfConnection, long csAccountId, long storagePoolId) {
    AccountDetailVO accountDetail = SolidFireUtil.getAccountDetail(csAccountId, storagePoolId, accountDetailsDao);
    if (accountDetail == null || accountDetail.getValue() == null) {
        AccountVO account = accountDao.findById(csAccountId);
        String sfAccountName = SolidFireUtil.getSolidFireAccountName(account.getUuid(), account.getAccountId());
        SolidFireUtil.SolidFireAccount sfAccount = SolidFireUtil.getAccount(sfConnection, sfAccountName);
        if (sfAccount == null) {
            sfAccount = createSolidFireAccount(sfConnection, sfAccountName);
        }
        SolidFireUtil.updateCsDbWithSolidFireAccountInfo(account.getId(), sfAccount, storagePoolId, accountDetailsDao);
        accountDetail = SolidFireUtil.getAccountDetail(csAccountId, storagePoolId, accountDetailsDao);
    }
    return Long.parseLong(accountDetail.getValue());
}
Also used : AccountDetailVO(com.cloud.user.AccountDetailVO) SolidFireUtil(org.apache.cloudstack.storage.datastore.util.SolidFireUtil) AccountVO(com.cloud.user.AccountVO)

Aggregations

AccountDetailVO (com.cloud.user.AccountDetailVO)6 AccountVO (com.cloud.user.AccountVO)4 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)4 ClusterDetailsVO (com.cloud.dc.ClusterDetailsVO)3 ClusterVO (com.cloud.dc.ClusterVO)3 DataCenterVO (com.cloud.dc.DataCenterVO)3 DomainDetailVO (com.cloud.domain.DomainDetailVO)2 DomainVO (com.cloud.domain.DomainVO)2 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)2 DB (com.cloud.utils.db.DB)2 TransactionLegacy (com.cloud.utils.db.TransactionLegacy)2 Date (java.sql.Date)2 PreparedStatement (java.sql.PreparedStatement)2 ImageStoreVO (org.apache.cloudstack.storage.datastore.db.ImageStoreVO)2 StoragePoolVO (org.apache.cloudstack.storage.datastore.db.StoragePoolVO)2 ActionEvent (com.cloud.event.ActionEvent)1 StoragePoolVO (com.cloud.storage.datastore.db.StoragePoolVO)1 Pair (com.cloud.utils.Pair)1 InvalidParameterValueException (com.cloud.utils.exception.InvalidParameterValueException)1 SQLException (java.sql.SQLException)1