Search in sources :

Example 11 with AssociationPatch

use of org.apache.syncope.common.lib.patch.AssociationPatch in project syncope by apache.

the class AbstractAnyRestClient method link.

public BulkActionResult link(final String etag, final String key, final List<StatusBean> statuses) {
    BulkActionResult result;
    synchronized (this) {
        AnyService<?> service = getService(etag, getAnyServiceClass());
        StatusPatch statusPatch = StatusUtils.buildStatusPatch(statuses);
        AssociationPatch associationPatch = new AssociationPatch.Builder().key(key).action(ResourceAssociationAction.LINK).onSyncope(statusPatch.isOnSyncope()).resources(statusPatch.getResources()).build();
        result = service.associate(associationPatch).readEntity(BulkActionResult.class);
        resetClient(getAnyServiceClass());
    }
    return result;
}
Also used : StatusPatch(org.apache.syncope.common.lib.patch.StatusPatch) BulkActionResult(org.apache.syncope.common.lib.to.BulkActionResult) AssociationPatch(org.apache.syncope.common.lib.patch.AssociationPatch)

Aggregations

AssociationPatch (org.apache.syncope.common.lib.patch.AssociationPatch)11 BulkActionResult (org.apache.syncope.common.lib.to.BulkActionResult)11 AccessControlException (java.security.AccessControlException)8 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)8 Test (org.junit.jupiter.api.Test)8 NamingException (javax.naming.NamingException)4 ForbiddenException (javax.ws.rs.ForbiddenException)4 GroupTO (org.apache.syncope.common.lib.to.GroupTO)4 UserTO (org.apache.syncope.common.lib.to.UserTO)4 StatusPatch (org.apache.syncope.common.lib.patch.StatusPatch)3 DeassociationPatch (org.apache.syncope.common.lib.patch.DeassociationPatch)2