Examples of PrincipalRule


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

                    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

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

                                String locatorName = ((PrincipalRule) ruleMap
                                        .get("rule")).getLocatorName();
                                for (Iterator ruleIter = rules.iterator(); ruleIter
                                        .hasNext();)
                                {
                                    PrincipalRule rule = (PrincipalRule) ruleIter
                                            .next();
                                    if (rule.getLocatorName().equals(
                                            locatorName))
                                    {
                                        getServiceLocator().getProfiler()
                                                .deletePrincipalRule(rule);
                                        getServiceLocator()
                                                .getAuditActivity()
                                                .logAdminAuthorizationActivity(
                                                        getPortletRequest()
                                                                .getUserPrincipal()
                                                                .getName(),
                                                        getIPAddress(),
                                                        getSelectedPrincipal(),
                                                        AuditActivity.USER_DELETE_PROFILE,
                                                        rule.getProfilingRule()
                                                                .getId()
                                                                + "-"
                                                                + rule
                                                                        .getLocatorName(),
                                                        AdminPortletWebPage.USER_ADMINISTRATION);
                                    }
                                }
                            }
View Full Code Here

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

                {
                    for (Iterator it = getServiceLocator().getProfiler()
                            .getRulesForPrincipal(getPrincipal()).iterator(); it
                            .hasNext();)
                    {
                        PrincipalRule rule = (PrincipalRule) it.next();
                        Map ruleMap = new HashMap();
                        ruleMap.put("rule", rule);
                        ruleMap.put("checked", Boolean.FALSE);
                        this.userRules.add(ruleMap);
                    }
View Full Code Here

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

    }

    public ProfilingRule getRuleForPrincipal(Principal principal, String locatorName)
    {
        // lookup the rule for the given principal in our user/rule table
        PrincipalRule pr = lookupPrincipalRule(principal.getName(), locatorName);

        // if not found, fallback to the system wide rule
        if (pr == null)
        {
            return getDefaultRule();
        }

        // Now get the associated rule
        return pr.getProfilingRule();
    }
View Full Code Here

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

 
        Filter filter = persistentStore.newFilter();
        filter.addEqualTo("principalName", principal);
        filter.addEqualTo("locatorName", locatorName);
        Object query = persistentStore.newQuery(principalRuleClass, filter);
        PrincipalRule pr = (PrincipalRule) persistentStore.getObjectByQuery(query);
        if (pr == null)
        {
            pr = new PrincipalRuleImpl(); // TODO: factory
            pr.setPrincipalName(principal.getName());
            pr.setLocatorName(locatorName);
            pr.setProfilingRule(rule);
        }
        try
        {
            pr.setProfilingRule(rule);
            persistentStore.lockForWrite(pr);
        }
        catch (LockFailedException e)
        {
            tx.rollback();
View Full Code Here

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

     * @return The found PrincipalRule associated with the principal key or null
     *         if not found.
     */
    private PrincipalRule lookupPrincipalRule(String principal, String locatorName)
    {
        PrincipalRule pr = (PrincipalRule) principalRules.get(makePrincipalRuleKey(principal, locatorName));
        if (pr != null)
        {
            return pr;
        }
        Filter filter = persistentStore.newFilter();       
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();
            ix++;
        }
        return names;
    }
View Full Code Here

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

    {
        Map locators = new HashMap();
        Iterator it = getRulesForPrincipal(principal).iterator();
        while (it.hasNext())
        {
            PrincipalRule pr = (PrincipalRule)it.next();
            locators.put(pr.getLocatorName(), getProfile(context, pr.getLocatorName()));  
        }
        return locators;
    }
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.