Examples of addOrUpdatePolicy()


Examples of org.wso2.carbon.identity.entitlement.policy.PolicyAdmin.addOrUpdatePolicy()

            policy.setActive(policy.isActive());
            if (getPolicy(policy.getPolicyId()) != null) {
                throw new IdentityException(
                        "An Entitlement Policy with the given ID already exists");
            }
            policyAdmin.addOrUpdatePolicy(policy);
            entitlementEngine.getRegistryModule().init(null);
        } else {
            throw new IdentityException("Invalid Entitlement Policy");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.identity.entitlement.policy.PolicyAdmin.addOrUpdatePolicy()

                .getInstance(getGovernanceUserRegistry(), CarbonContext.getCurrentContext().getTenantId());
        policyObj = PolicyReader.getInstance(null, null).getPolicy(policy.getPolicy());
        if (policyObj != null) {
            policyAdmin = new PolicyAdmin(new PolicyStore(getGovernanceUserRegistry()));
            policy.setPolicyId(policyObj.getId().toASCIIString());
            policyAdmin.addOrUpdatePolicy(policy);
            // Reload the policies to the memory.
            entitlementEngine.getRegistryModule().init(null);
        } else {
            throw new IdentityException("Invalid Policy");
        }
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.