Examples of PrincipalRule


Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

            String locatorName)
    {
        Criteria c = new Criteria();
        c.addEqualTo("principalName", principal.getName());
        c.addEqualTo("locatorName", locatorName);
        PrincipalRule pr = (PrincipalRule) getPersistenceBrokerTemplate()
                .getObjectByQuery(
                        QueryFactory.newQuery(getPrincipalRuleClass(), c));

        if (pr == null)
        {
            pr = new PrincipalRuleImpl(); // TODO: factory
            pr.setPrincipalName(principal.getName());
            pr.setLocatorName(locatorName);
            pr.setProfilingRule(rule);
        }
        rule.setResolvers(resolvers);
        pr.setProfilingRule(rule);
        getPersistenceBrokerTemplate().store(pr);
        principalRules.put(makePrincipalRuleKey(principal.getName(),
                locatorName), pr);
        // track cached principal rules
        trackCachedPrincipalRulesPut(principal.getName(), pr);
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

     *         if not found.
     */
    private PrincipalRule lookupPrincipalRule(String principal,
            String locatorName)
    {
        PrincipalRule pr = (PrincipalRule) principalRules
                .get(makePrincipalRuleKey(principal, locatorName));
        if (pr != null) { return pr; }
        Criteria c = new Criteria();
        c.addEqualTo("principalName", principal);
        c.addEqualTo("locatorName", locatorName);

        pr = (PrincipalRule) getPersistenceBrokerTemplate().getObjectByQuery(
                QueryFactory.newQuery(getPrincipalRuleClass(), c));
        if (pr != null) pr.getProfilingRule().setResolvers(resolvers);

        principalRules.put(makePrincipalRuleKey(principal, locatorName), pr);
        // track cached principal rules
        trackCachedPrincipalRulesPut(principal, pr);
        return pr;
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

        String[] names = new String[result.size()];
        Iterator it = result.iterator();
        int ix = 0;
        while (it.hasNext())
        {
            PrincipalRule pr = (PrincipalRule) it.next();
            names[ix] = pr.getLocatorName();
            pr.getProfilingRule().setResolvers(resolvers);
            ix++;
        }
        return names;
    }
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

        rules = getPersistenceBrokerTemplate().getCollectionByQuery(
                QueryFactory.newQuery(getPrincipalRuleClass(), c));
        Iterator r = rules.iterator();
        while (r.hasNext())
        {
            PrincipalRule pr = (PrincipalRule) r.next();
            ProfilingRule rule = pr.getProfilingRule();
            if (rule != null) rule.setResolvers(resolvers);
        }
        this.rulesPerPrincipal.put(principal.getName(), rules);
        return rules;
    }
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

        Collection rules = getRulesForPrincipal(principal);

        Iterator it = rules.iterator();
        while (it.hasNext())
        {
            PrincipalRule pr = (PrincipalRule) it.next();
            locators.put(pr.getLocatorName(), getProfile(context, pr
                    .getLocatorName()));
        }
        return locators;
    }
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

        Collection rules = getRulesForPrincipal(DEFAULT_RULE_PRINCIPAL);

        Iterator it = rules.iterator();
        while (it.hasNext())
        {
            PrincipalRule pr = (PrincipalRule) it.next();
            locators.put(pr.getLocatorName(), getDefaultProfile(context, pr
                    .getLocatorName()));
        }
        return locators;
    }
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

     */
    public PrincipalRule createPrincipalRule() throws ClassNotFoundException
    {
        try
        {
            PrincipalRule principalRule = (PrincipalRule) beanFactory.getBean(
                    this.principalRuleBean, PrincipalRule.class);
            return principalRule;
        } catch (Exception e)
        {
            log.error("Failed to create principalRule for " + principalRuleBean
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

                {
                    rulesPerPrincipal.remove(principalName);
                    Iterator it = rules.iterator();
                    while (it.hasNext())
                    {
                        PrincipalRule rule = (PrincipalRule)it.next();
                        String key = this.makePrincipalRuleKey(rule.getPrincipalName(), rule.getLocatorName());
                        principalRules.remove(key);
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

                    JSPrincipalRule pr = (JSPrincipalRule) _itRoles.next();
                    ProfilingRule pRule = pm.getRule(pr.getRule());
                   
                    try
                    {
                      PrincipalRule p1 = pm.createPrincipalRule();
                      p1.setLocatorName(pr.getLocator());
                      p1.setProfilingRule(pRule);
                      p1.setPrincipalName(principal.getName());
                      pm.storePrincipalRule(p1);
                    }
                    catch (Exception eRole)
                    {
                      eRole.printStackTrace();
View Full Code Here

Examples of org.apache.jetspeed.profiler.rules.PrincipalRule

            {
                Collection col = pm.getRulesForPrincipal(principal);
                Iterator _itCol = col.iterator();
                while (_itCol.hasNext())
                {
                    PrincipalRule p1 = (PrincipalRule) _itCol.next();
                    JSPrincipalRule pr = new JSPrincipalRule(p1
                            .getLocatorName(), p1.getProfilingRule().getId());
                    _user.getRules().add(pr);
                }
            }
        }
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.