Package org.apache.syncope.common.services

Examples of org.apache.syncope.common.services.UserService


    public void suspend(final String etag, final long userId, final List<StatusBean> statuses) {
        StatusMod statusMod = StatusUtils.buildStatusMod(statuses, false);
        statusMod.setType(StatusMod.ModType.SUSPEND);
        synchronized (this) {
            UserService service = getService(etag, UserService.class);
            service.status(userId, statusMod);
            resetClient(UserService.class);
        }
    }
View Full Code Here


    public void reactivate(final String etag, final long userId, final List<StatusBean> statuses) {
        StatusMod statusMod = StatusUtils.buildStatusMod(statuses, true);
        statusMod.setType(StatusMod.ModType.REACTIVATE);
        synchronized (this) {
            UserService service = getService(etag, UserService.class);
            service.status(userId, statusMod);
            resetClient(UserService.class);
        }
    }
View Full Code Here

        return getService(UserService.class).bulk(action);
    }

    public void unlink(final String etag, final long userId, final List<StatusBean> statuses) {
        synchronized (this) {
            UserService service = getService(etag, UserService.class);
            service.bulkDeassociation(userId, ResourceDeassociationActionType.UNLINK,
                    CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
                            ResourceName.class));
            resetClient(UserService.class);
        }
    }
View Full Code Here

        }
    }

    public void link(final String etag, final long userId, final List<StatusBean> statuses) {
        synchronized (this) {
            UserService service = getService(etag, UserService.class);

            final ResourceAssociationMod associationMod = new ResourceAssociationMod();
            associationMod.getTargetResources().addAll(
                    CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
                            ResourceName.class));
            service.bulkAssociation(userId, ResourceAssociationActionType.LINK, associationMod);

            resetClient(UserService.class);
        }
    }
View Full Code Here

    }

    public BulkActionResult deprovision(final String etag, final long userId, final List<StatusBean> statuses) {
        BulkActionResult result;
        synchronized (this) {
            UserService service = getService(etag, UserService.class);
            result = service.bulkDeassociation(userId, ResourceDeassociationActionType.DEPROVISION,
                    CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
                            ResourceName.class)).
                    readEntity(BulkActionResult.class);
            resetClient(UserService.class);
        }
View Full Code Here

    public BulkActionResult provision(final String etag, final long userId,
            final List<StatusBean> statuses, final boolean changepwd, final String password) {

        BulkActionResult result;
        synchronized (this) {
            UserService service = getService(etag, UserService.class);

            final ResourceAssociationMod associationMod = new ResourceAssociationMod();
            associationMod.getTargetResources().addAll(
                    CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
                            ResourceName.class));
            associationMod.setChangePwd(changepwd);
            associationMod.setPassword(password);

            result = service.bulkAssociation(userId, ResourceAssociationActionType.PROVISION, associationMod).
                    readEntity(BulkActionResult.class);
            resetClient(UserService.class);
        }
        return result;
    }
View Full Code Here

    }

    public BulkActionResult unassign(final String etag, final long userId, final List<StatusBean> statuses) {
        BulkActionResult result;
        synchronized (this) {
            UserService service = getService(etag, UserService.class);
            result = service.bulkDeassociation(userId, ResourceDeassociationActionType.UNASSIGN,
                    CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
                            ResourceName.class)).
                    readEntity(BulkActionResult.class);
            resetClient(UserService.class);
        }
View Full Code Here

    public BulkActionResult assign(final String etag, final long userId,
            final List<StatusBean> statuses, final boolean changepwd, final String password) {

        BulkActionResult result;
        synchronized (this) {
            UserService service = getService(etag, UserService.class);

            final ResourceAssociationMod associationMod = new ResourceAssociationMod();
            associationMod.getTargetResources().addAll(
                    CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
                            ResourceName.class));
            associationMod.setChangePwd(changepwd);
            associationMod.setPassword(password);

            result = service.bulkAssociation(userId, ResourceAssociationActionType.ASSIGN, associationMod).
                    readEntity(BulkActionResult.class);
            resetClient(UserService.class);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.services.UserService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.