Examples of SyncPolicySpec


Examples of org.apache.syncope.common.types.SyncPolicySpec

        return result;
    }

    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
        return syncPolicySpec == null ? new SyncPolicySpec() : syncPolicySpec;
    }
View Full Code Here

Examples of org.apache.syncope.common.types.SyncPolicySpec

            final String uid,
            final ConnectorObject connObj,
            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);
            }
View Full Code Here

Examples of org.apache.syncope.common.types.SyncPolicySpec

        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);
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

        // ---------------------------------
        // Get sync policy specification
        // ---------------------------------
        final SyncPolicy policy = syncTask.getResource().getSyncPolicy();
        final SyncPolicySpec policySpec = policy != null
                ? (SyncPolicySpec) policy.getSpecification()
                : null;
        // ---------------------------------

        final List<Long> result = new ArrayList<Long>();

        if (policySpec != null && !policySpec.getAlternativeSearchAttrs().isEmpty()) {

            // search external attribute name/value
            // about each specified name
            final ConnectorObject object = delta.getObject();

            final Map<String, Attribute> extValues = new HashMap<String, Attribute>();

            for (SchemaMapping mapping : syncTask.getResource().getMappings()) {
                extValues.put(SchemaMappingUtil.getIntAttrName(mapping), object.getAttributeByName(SchemaMappingUtil
                        .getExtAttrName(mapping)));
            }

            // search user by attributes specified into the policy
            NodeCond searchCondition = null;

            for (String schema : policySpec.getAlternativeSearchAttrs()) {
                Attribute value = extValues.get(schema);

                AttributeCond.Type type;
                String expression = null;
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

            case GLOBAL_SYNC:
            case SYNC:
            default:
                spec = ((SyncPolicyTO) policyTO).getSpecification() != null
                        ? ((SyncPolicyTO) policyTO).getSpecification()
                        : new SyncPolicySpec();
        }

        return spec;
    }
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

        // ---------------------------------
        // Get sync policy specification
        // ---------------------------------
        final SyncPolicy policy = syncTask.getResource().getSyncPolicy();
        final SyncPolicySpec policySpec = policy != null
                ? (SyncPolicySpec) policy.getSpecification()
                : null;
        // ---------------------------------

        final List<Long> result = new ArrayList<Long>();

        if (policySpec != null && !policySpec.getAlternativeSearchAttrs().isEmpty()) {

            // search external attribute name/value
            // about each specified name
            final ConnectorObject object = delta.getObject();

            final Map<String, Attribute> extValues = new HashMap<String, Attribute>();

            for (SchemaMapping mapping : syncTask.getResource().getMappings()) {
                extValues.put(SchemaMappingUtil.getIntAttrName(mapping), object.getAttributeByName(SchemaMappingUtil
                        .getExtAttrName(mapping)));
            }

            // search user by attributes specified into the policy
            NodeCond searchCondition = null;

            for (String schema : policySpec.getAlternativeSearchAttrs()) {
                Attribute value = extValues.get(schema);

                AttributeCond.Type type;
                String expression = null;
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

    }

    @Test
    public void createMissingDescription() {
        SyncPolicyTO policy = new SyncPolicyTO();
        policy.setSpecification(new SyncPolicySpec());

        Throwable t = null;
        try {
            restTemplate.postForObject(BASE_URL + "policy/sync/create", policy, PasswordPolicyTO.class);
            fail();
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

    }

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

        SyncPolicyTO policyTO = restTemplate.postForObject(BASE_URL + "policy/sync/create", policy, SyncPolicyTO.class);

        assertNotNull(policyTO);
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

            case GLOBAL_SYNC:
            case SYNC:
            default:
                spec = ((SyncPolicyTO) policyTO).getSpecification() != null
                        ? ((SyncPolicyTO) policyTO).getSpecification()
                        : new SyncPolicySpec();
        }

        return spec;
    }
View Full Code Here

Examples of org.apache.syncope.types.SyncPolicySpec

        // ---------------------------------
        // Get sync policy specification
        // ---------------------------------
        final SyncPolicy policy = syncTask.getResource().getSyncPolicy();
        final SyncPolicySpec policySpec = policy != null
                ? (SyncPolicySpec) policy.getSpecification()
                : null;
        // ---------------------------------

        final List<Long> result = new ArrayList<Long>();

        if (policySpec != null && !policySpec.getAlternativeSearchAttrs().isEmpty()) {

            // search external attribute name/value
            // about each specified name
            final ConnectorObject object = delta.getObject();

            final Map<String, Attribute> extValues = new HashMap<String, Attribute>();

            for (SchemaMapping mapping : syncTask.getResource().getMappings()) {
                extValues.put(SchemaMappingUtil.getIntAttrName(mapping), object.getAttributeByName(SchemaMappingUtil
                        .getExtAttrName(mapping)));
            }

            // search user by attributes specified into the policy
            NodeCond searchCondition = null;

            for (String schema : policySpec.getAlternativeSearchAttrs()) {
                Attribute value = extValues.get(schema);

                AttributeCond.Type type;
                String expression = null;
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.