Search in sources :

Example 6 with ApplicationTO

use of org.apache.syncope.common.lib.to.ApplicationTO in project syncope by apache.

the class ApplicationLogic method delete.

@PreAuthorize("hasRole('" + StandardEntitlement.APPLICATION_DELETE + "')")
public ApplicationTO delete(final String key) {
    Application application = applicationDAO.find(key);
    if (application == null) {
        LOG.error("Could not find application '" + key + "'");
        throw new NotFoundException(key);
    }
    ApplicationTO deleted = binder.getApplicationTO(application);
    applicationDAO.delete(key);
    return deleted;
}
Also used : NotFoundException(org.apache.syncope.core.persistence.api.dao.NotFoundException) ApplicationTO(org.apache.syncope.common.lib.to.ApplicationTO) Application(org.apache.syncope.core.persistence.api.entity.Application) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Aggregations

ApplicationTO (org.apache.syncope.common.lib.to.ApplicationTO)6 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)3 PrivilegeTO (org.apache.syncope.common.lib.to.PrivilegeTO)3 Collectors (java.util.stream.Collectors)2 Response (javax.ws.rs.core.Response)2 EntityTO (org.apache.syncope.common.lib.to.EntityTO)2 RoleTO (org.apache.syncope.common.lib.to.RoleTO)2 ClientExceptionType (org.apache.syncope.common.lib.types.ClientExceptionType)2 ApplicationService (org.apache.syncope.common.rest.api.service.ApplicationService)2 RoleService (org.apache.syncope.common.rest.api.service.RoleService)2 Application (org.apache.syncope.core.persistence.api.entity.Application)2 Test (org.junit.jupiter.api.Test)2 URI (java.net.URI)1 Iterator (java.util.Iterator)1 UUID (java.util.UUID)1 ApplicationDAO (org.apache.syncope.core.persistence.api.dao.ApplicationDAO)1 NotFoundException (org.apache.syncope.core.persistence.api.dao.NotFoundException)1 EntityFactory (org.apache.syncope.core.persistence.api.entity.EntityFactory)1 Privilege (org.apache.syncope.core.persistence.api.entity.Privilege)1 ApplicationDataBinder (org.apache.syncope.core.provisioning.api.data.ApplicationDataBinder)1