Package org.apache.syncope.common.to

Examples of org.apache.syncope.common.to.PropagationRequestTO


                ? "active"
                : "created", userTO.getStatus());
        long userId = userTO.getId();

        // Suspend with effect on syncope, ldap and db => user should be suspended in syncope and all resources
        PropagationRequestTO propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(true);
        propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);
        propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
        userTO = userService.suspend(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("suspended", userTO.getStatus());

        ConnObjectTO connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId);
        assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));

        connObjectTO = readConnectorObject(RESOURCE_NAME_LDAP, userId);
        assertNotNull(connObjectTO);

        // Suspend and reactivate only on ldap => db and syncope should still show suspended
        propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(false);
        propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
        userTO = userService.suspend(userId, propagationRequestTO);
        userTO = userService.reactivate(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("suspended", userTO.getStatus());

        connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId);
        assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));

        // Reactivate on syncope and db => syncope and db should show the user as active
        propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(true);
        propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);

        userTO = userService.reactivate(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("active", userTO.getStatus());
View Full Code Here


        // 2. request to change password only on testdb (no Syncope, no testdb2)
        UserMod userMod = new UserMod();
        userMod.setId(userTO.getId());
        userMod.setPassword(getUUIDString());
        PropagationRequestTO pwdPropRequest = new PropagationRequestTO();
        pwdPropRequest.addResource(RESOURCE_NAME_TESTDB);
        userMod.setPwdPropRequest(pwdPropRequest);

        userTO = userService.update(userMod.getId(), userMod);

        // 3a. Chech that only a single propagation took place
View Full Code Here

                ? "active"
                : "created", userTO.getStatus());
        long userId = userTO.getId();

        // Suspend with effect on syncope, ldap and db => user should be suspended in syncope and all resources
        PropagationRequestTO propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(true);
        propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);
        propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
        userTO = userService.suspend(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("suspended", userTO.getStatus());

        ConnObjectTO connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId);
        assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));

        connObjectTO = readConnectorObject(RESOURCE_NAME_LDAP, userId);
        assertNotNull(connObjectTO);

        // Suspend and reactivate only on ldap => db and syncope should still show suspended
        propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(false);
        propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
        userTO = userService.suspend(userId, propagationRequestTO);
        userTO = userService.reactivate(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("suspended", userTO.getStatus());

        connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId);
        assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));

        // Reactivate on syncope and db => syncope and db should show the user as active
        propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(true);
        propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);

        userTO = userService.reactivate(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("active", userTO.getStatus());
View Full Code Here

        // 2. request to change password only on testdb (no Syncope, no testdb2)
        UserMod userMod = new UserMod();
        userMod.setId(userTO.getId());
        userMod.setPassword(getUUIDString());
        PropagationRequestTO pwdPropRequest = new PropagationRequestTO();
        pwdPropRequest.addResource(RESOURCE_NAME_TESTDB);
        userMod.setPwdPropRequest(pwdPropRequest);

        userTO = userService.update(userMod.getId(), userMod);

        // 3a. Chech that only a single propagation took place
View Full Code Here

    }

    public static PropagationRequestTO buildPropagationRequestTO(final Collection<StatusBean> statuses,
            final Boolean enable) {

        PropagationRequestTO propagationRequestTO = new PropagationRequestTO();

        for (StatusBean status : statuses) {
            if (enable == null
                    || (enable && !status.getStatus().isActive()) || (!enable && status.getStatus().isActive())) {

                if ("Syncope".equals(status.getResourceName())) {
                    propagationRequestTO.setOnSyncope(true);
                } else {
                    propagationRequestTO.addResource(status.getResourceName());
                }

            }
        }
View Full Code Here

        statusBeansListView.setReuseItems(true);
        checkGroup.add(statusBeansListView);
    }

    public PropagationRequestTO getPropagationRequestTO() {
        PropagationRequestTO result = null;

        Collection<StatusBean> statusBeans = checkGroup.getModel().getObject();
        if (statusBeans != null && !statusBeans.isEmpty()) {
            result = StatusUtils.buildPropagationRequestTO(statusBeans);
View Full Code Here

        //modify virtual attribute
        userMod.addVirtualAttributeToBeRemoved("virtualdata");
        userMod.addVirtualAttributeToBeUpdated(attributeMod("virtualdata", "test@testoneone.com"));

        // check Syncope change password
        PropagationRequestTO pwdPropRequest = new PropagationRequestTO();
        pwdPropRequest.setOnSyncope(true);
        pwdPropRequest.addResource(RESOURCE_NAME_WS2);
        userMod.setPwdPropRequest(pwdPropRequest);

        toBeUpdated = userService.update(userMod.getId(), userMod);
        assertNotNull(toBeUpdated);
        assertEquals("test@testoneone.com", toBeUpdated.getVirtualAttributes().get(0).getValues().get(0));
View Full Code Here

        // 2. update virtual attribute
        UserMod userMod = new UserMod();
        userMod.setId(userTO.getId());

        PropagationRequestTO propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setResources(Collections.<String>emptySet());
        propagationRequestTO.setOnSyncope(Boolean.FALSE);

        userMod.setPwdPropRequest(propagationRequestTO);

        // change virtual attribute value
        final AttributeMod virtualDataMod = new AttributeMod();
View Full Code Here

        //modify virtual attribute
        userMod.addVirtualAttributeToBeRemoved("virtualdata");
        userMod.addVirtualAttributeToBeUpdated(attributeMod("virtualdata", "test@testoneone.com"));

        // check Syncope change password
        PropagationRequestTO pwdPropRequest = new PropagationRequestTO();
        pwdPropRequest.setOnSyncope(true);
        pwdPropRequest.addResource(RESOURCE_NAME_WS2);
        userMod.setPwdPropRequest(pwdPropRequest);

        toBeUpdated = userService.update(userMod.getId(), userMod);
        assertNotNull(toBeUpdated);
        assertEquals("test@testoneone.com", toBeUpdated.getVirtualAttributes().get(0).getValues().get(0));
View Full Code Here

                ? "active"
                : "created", userTO.getStatus());
        long userId = userTO.getId();

        // Suspend with effect on syncope, ldap and db => user should be suspended in syncope and all resources
        PropagationRequestTO propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(true);
        propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);
        propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
        userTO = userService.suspend(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("suspended", userTO.getStatus());

        ConnObjectTO connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId, AttributableType.USER);
        assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));

        connObjectTO = readConnectorObject(RESOURCE_NAME_LDAP, userId, AttributableType.USER);
        assertNotNull(connObjectTO);

        // Suspend and reactivate only on ldap => db and syncope should still show suspended
        propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(false);
        propagationRequestTO.addResource(RESOURCE_NAME_LDAP);
        userService.suspend(userId, propagationRequestTO);
        userTO = userService.reactivate(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("suspended", userTO.getStatus());

        connObjectTO = readConnectorObject(RESOURCE_NAME_TESTDB, userId, AttributableType.USER);
        assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));

        // Reactivate on syncope and db => syncope and db should show the user as active
        propagationRequestTO = new PropagationRequestTO();
        propagationRequestTO.setOnSyncope(true);
        propagationRequestTO.addResource(RESOURCE_NAME_TESTDB);

        userTO = userService.reactivate(userId, propagationRequestTO);
        assertNotNull(userTO);
        assertEquals("active", userTO.getStatus());
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.to.PropagationRequestTO

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.