Examples of PolicyDatabase


Examples of com.adito.policyframework.PolicyDatabase

        return sender.getSentMessageCount();
    }

    private void sendByPolicy(MessageSender sender, Recipient recipient) throws Exception, UserDatabaseException {
        UserDatabase userDatabase = UserDatabaseManager.getInstance().getUserDatabase(recipient.getRealmName());
        PolicyDatabase policyDatabase = PolicyDatabaseFactory.getInstance();
        Realm realm = userDatabase.getRealm();
        Policy policy = policyDatabase.getPolicyByName(recipient.getRecipientAlias(), realm.getResourceId());
        int everyonePolicyId = policyDatabase.getEveryonePolicyIDForRealm(realm);
       
        if (everyonePolicyId == policy.getResourceId()) {
            sendToPrincipals(sender, userDatabase, userDatabase.allRoles());
            sendToPrincipals(sender, userDatabase, userDatabase.allUsers());
        } else {
            List<Principal> principals = policyDatabase.getPrincipalsGrantedPolicy(policy, realm);
            sendToPrincipals(sender, userDatabase, principals);
        }
    }
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.