use of org.apache.syncope.core.persistence.api.dao.NotFoundException in project syncope by apache.
the class ReportLogic method deleteExecution.
@PreAuthorize("hasRole('" + StandardEntitlement.REPORT_DELETE + "')")
@Override
public ExecTO deleteExecution(final String executionKey) {
ReportExec reportExec = reportExecDAO.find(executionKey);
if (reportExec == null) {
throw new NotFoundException("Report execution " + executionKey);
}
ExecTO reportExecToDelete = binder.getExecTO(reportExec);
reportExecDAO.delete(reportExec);
return reportExecToDelete;
}
use of org.apache.syncope.core.persistence.api.dao.NotFoundException in project syncope by apache.
the class ResourceHistoryLogic method restore.
@PreAuthorize("hasRole('" + StandardEntitlement.RESOURCE_HISTORY_RESTORE + "')")
public void restore(final String key) {
ExternalResourceHistoryConf resourceHistoryConf = resourceHistoryConfDAO.find(key);
if (resourceHistoryConf == null) {
throw new NotFoundException("Resource History Conf '" + key + "'");
}
binder.update(resourceHistoryConf.getEntity(), resourceHistoryConf.getConf());
}
use of org.apache.syncope.core.persistence.api.dao.NotFoundException in project syncope by apache.
the class ResourceHistoryLogic method delete.
@PreAuthorize("hasRole('" + StandardEntitlement.RESOURCE_HISTORY_DELETE + "')")
public void delete(final String key) {
ExternalResourceHistoryConf resourceHistoryConf = resourceHistoryConfDAO.find(key);
if (resourceHistoryConf == null) {
throw new NotFoundException("Resource History Conf '" + key + "'");
}
resourceHistoryConfDAO.delete(key);
}
use of org.apache.syncope.core.persistence.api.dao.NotFoundException in project syncope by apache.
the class AnyTypeClassLogic method update.
@PreAuthorize("hasRole('" + StandardEntitlement.ANYTYPECLASS_UPDATE + "')")
public AnyTypeClassTO update(final AnyTypeClassTO anyTypeClassTO) {
AnyTypeClass anyType = anyTypeClassDAO.find(anyTypeClassTO.getKey());
if (anyType == null) {
LOG.error("Could not find anyTypeClass '" + anyTypeClassTO.getKey() + "'");
throw new NotFoundException(anyTypeClassTO.getKey());
}
binder.update(anyType, anyTypeClassTO);
anyType = anyTypeClassDAO.save(anyType);
return binder.getAnyTypeClassTO(anyType);
}
use of org.apache.syncope.core.persistence.api.dao.NotFoundException in project syncope by apache.
the class ConfigurationLogic method get.
@PreAuthorize("hasRole('" + StandardEntitlement.CONFIGURATION_GET + "')")
@Transactional(readOnly = true)
public AttrTO get(final String schema) {
AttrTO result;
Optional<? extends CPlainAttr> conf = confDAO.find(schema);
if (conf.isPresent()) {
result = binder.getAttrTO(conf.get());
} else {
PlainSchema plainSchema = plainSchemaDAO.find(schema);
if (plainSchema == null) {
throw new NotFoundException("Configuration schema " + schema);
}
result = new AttrTO();
result.setSchema(schema);
}
return result;
}
Aggregations