Examples of SyncPolicy


Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

        policyDAO.save(policy);
    }

    @Test
    public void create() {
        SyncPolicy policy = new SyncPolicy();
        policy.setSpecification(new SyncPolicySpec());
        policy.setDescription("Sync policy");

        policy = policyDAO.save(policy);

        assertNotNull(policy);
        assertEquals(PolicyType.SYNC, policy.getType());
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

    private SyncPolicySpec getSyncPolicySpec(final AbstractSyncTask syncTask) {
        SyncPolicySpec syncPolicySpec;

        if (syncTask instanceof SyncTask) {
            final SyncPolicy syncPolicy = syncTask.getResource().getSyncPolicy() == null
                    ? policyDAO.getGlobalSyncPolicy()
                    : syncTask.getResource().getSyncPolicy();

            syncPolicySpec = syncPolicy == null ? null : syncPolicy.getSpecification(SyncPolicySpec.class);
        } else {
            syncPolicySpec = null;
        }

        // step required because the call <policy>.getSpecification() could return a null value
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

            final ExternalResource resource,
            final AttributableUtil attrUtil) {

        SyncPolicySpec syncPolicySpec = null;
        if (resource.getSyncPolicy() == null) {
            SyncPolicy globalSP = policyDAO.getGlobalSyncPolicy();
            if (globalSP != null) {
                syncPolicySpec = globalSP.getSpecification(SyncPolicySpec.class);
            }
        } else {
            syncPolicySpec = resource.getSyncPolicy().getSpecification(SyncPolicySpec.class);
        }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

        return (AccountPolicyTO) binder.getPolicyTO(policy);
    }

    @PreAuthorize("hasRole('POLICY_READ')")
    public SyncPolicyTO getGlobalSyncPolicy() {
        SyncPolicy policy = policyDAO.getGlobalSyncPolicy();
        if (policy == null) {
            throw new NotFoundException("No sync policy found");
        }

        return (SyncPolicyTO) binder.getPolicyTO(policy);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

    public void saveInvalidPolicy() {
        PasswordPolicySpec passwordPolicy = new PasswordPolicySpec();
        passwordPolicy.setMaxLength(8);
        passwordPolicy.setMinLength(6);

        SyncPolicy policy = new SyncPolicy();
        policy.setSpecification(passwordPolicy);
        policy.setDescription("sync policy");

        policyDAO.save(policy);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

        policyDAO.save(policy);
    }

    @Test
    public void create() {
        SyncPolicy policy = new SyncPolicy();

        final String syncURuleName = "net.tirasa.sync.correlation.TirasaURule";
        final String syncRRuleName = "net.tirasa.sync.correlation.TirasaRRule";

        SyncPolicySpec syncPolicySpec = new SyncPolicySpec();
        syncPolicySpec.setUserJavaRule(syncURuleName);
        syncPolicySpec.setRoleJavaRule(syncRRuleName);

        policy.setSpecification(syncPolicySpec);
        policy.setDescription("Sync policy");

        policy = policyDAO.save(policy);

        assertNotNull(policy);
        assertEquals(PolicyType.SYNC, policy.getType());
        assertEquals(syncURuleName, (policy.getSpecification(SyncPolicySpec.class)).getUserJavaRule());
        assertEquals(syncRRuleName, (policy.getSpecification(SyncPolicySpec.class)).getRoleJavaRule());
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

                }
                break;

            case GLOBAL_SYNC:
                // just one GLOBAL_SYNC policy
                final SyncPolicy syncPolicy = getGlobalSyncPolicy();

                if (syncPolicy != null && !syncPolicy.getId().equals(policy.getId())) {
                    throw new InvalidEntityException(PasswordPolicy.class, EntityViolationType.InvalidSyncPolicy,
                            "Global Synchronization policy already exists");
                }
                break;
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.SyncPolicy

                if (!(policyTO instanceof SyncPolicyTO)) {
                    throw new ClassCastException("Expected " + SyncPolicyTO.class.getName()
                            + ", found " + policyTO.getClass().getName());
                }
                if (policy == null) {
                    policy = (T) new SyncPolicy(isGlobal);
                }
                policy.setSpecification(((SyncPolicyTO) policyTO).getSpecification());
        }

        policy.setDescription(policyTO.getDescription());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.