blob: dcaafe55ac5eeb2e95569c9be7460ba38444ba0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package org.openecomp.sdc.be.model.operations.impl;
import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
import org.openecomp.sdc.be.model.operations.StorageException;
import org.springframework.stereotype.Component;
@Component
public class OperationUtils {
private final TitanDao titanDao;
public OperationUtils(TitanDao titanDao) {
this.titanDao = titanDao;
}
public <T> T onTitanOperationFailure(TitanOperationStatus status) {
titanDao.rollback();
throw new StorageException(status);
}
}
|