Examples of Entitlement


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

        // attributes, derived attributes, virtual attributes and resources
        fill(role, roleTO, AttributableUtil.getInstance(AttributableType.ROLE), scce);

        // entitlements
        Entitlement entitlement;
        for (String entitlementName : roleTO.getEntitlements()) {
            entitlement = entitlementDAO.find(entitlementName);
            if (entitlement == null) {
                LOG.warn("Ignoring invalid entitlement {}", entitlementName);
            } else {
View Full Code Here

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

        // entitlements
        if (roleMod.getEntitlements() != null) {
            role.getEntitlements().clear();
            for (String entitlementName : roleMod.getEntitlements()) {
                Entitlement entitlement = entitlementDAO.find(entitlementName);
                if (entitlement == null) {
                    LOG.warn("Ignoring invalid entitlement {}", entitlementName);
                } else {
                    role.addEntitlement(entitlement);
                }
View Full Code Here

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

        // attributes, derived attributes, virtual attributes and resources
        fill(role, roleTO, AttributableUtil.getInstance(AttributableType.ROLE), scce);

        // entitlements
        Entitlement entitlement;
        for (String entitlementName : roleTO.getEntitlements()) {
            entitlement = entitlementDAO.find(entitlementName);
            if (entitlement == null) {
                LOG.warn("Ignoring invalid entitlement {}", entitlementName);
            } else {
View Full Code Here

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

            role.setInheritAccountPolicy(roleMod.getInheritAccountPolicy());
        }

        // entitlements
        role.getEntitlements().clear();
        Entitlement entitlement;
        for (String entitlementName : roleMod.getEntitlements()) {
            entitlement = entitlementDAO.find(entitlementName);
            if (entitlement == null) {
                LOG.warn("Ignoring invalid entitlement {}", entitlementName);
            } else {
View Full Code Here

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

        return entityManager.merge(entitlement);
    }

    @Override
    public Entitlement saveEntitlementRole(final SyncopeRole role) {
        Entitlement roleEnt = new Entitlement();
        roleEnt.setName(EntitlementUtil.getEntitlementNameFromRoleId(role.getId()));
        roleEnt.setDescription("Entitlement for managing role " + role.getId());

        return save(roleEnt);
    }
View Full Code Here

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

        return save(roleEnt);
    }

    @Override
    public void delete(final String name) {
        Entitlement entitlement = find(name);
        if (entitlement == null) {
            return;
        }

        delete(entitlement);
View Full Code Here

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

        assertEquals("did not get expected number of entitlements ", 79, list.size());
    }

    @Test
    public void findByName() {
        Entitlement entitlement = entitlementDAO.find("base");
        assertNotNull("did not find expected entitlement", entitlement);
    }
View Full Code Here

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

        assertNotNull("did not find expected entitlement", entitlement);
    }

    @Test
    public void save() {
        Entitlement entitlement = new Entitlement();
        entitlement.setName("another");

        entitlementDAO.save(entitlement);

        Entitlement actual = entitlementDAO.find("another");
        assertNotNull("expected save to work", actual);
        assertEquals(entitlement, actual);
    }
View Full Code Here

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

        assertEquals(entitlement, actual);
    }

    @Test
    public void delete() {
        Entitlement entitlement = entitlementDAO.find("base");
        assertNotNull("did not find expected entitlement", entitlement);

        List<SyncopeRole> roles = roleDAO.findByEntitlement(entitlement);
        assertEquals("expected two roles", 2, roles.size());
View Full Code Here

Examples of org.candlepin.gutterball.model.snapshot.Entitlement

        int entQuantity = entJson.get("quantity").asInt();
        Date startDate = context.parseDate(poolJson.get("startDate").asText());
        Date endDate = context.parseDate(poolJson.get("endDate").asText());

        Entitlement ent = new Entitlement(entQuantity, startDate, endDate);
        ent.setProductId(getValue(poolJson, "productId"));
        ent.setDerivedProductId(getValue(poolJson, "derivedProductId"));
        ent.setProductName(getValue(poolJson, "productName"));
        ent.setDerivedProductName(getValue(poolJson, "derivedProductName"));
        ent.setRestrictedToUsername(getValue(poolJson, "restrictedToUsername"));
        ent.setContractNumber(getValue(poolJson, "contractNumber"));
        ent.setAccountNumber(getValue(poolJson, "accountNumber"));
        ent.setOrderNumber(getValue(poolJson, "orderNumber"));
        ent.setAttributes(getFlattenedProductAttributes(poolJson));
        //ent.setSourceEntitlement(getEntitlement(poolJson.get("sourceEntitlement"), context));
        ent.setProvidedProducts(flattenProvidedProducts(poolJson));
        ent.setDerivedProvidedProducts(flattenDerivedProvidedProducts(poolJson));
        ent.setDerivedProductAttributes(getDerivedProductAttributes(poolJson));

        return ent;
    }
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.