Package org.apache.jetspeed.security.om

Examples of org.apache.jetspeed.security.om.InternalGroupPrincipal


     * @see org.apache.jetspeed.security.spi.GroupSecurityHandler#getGroupPrincipal(java.lang.String)
     */
    public Principal getGroupPrincipal(String groupFullPathName)
    {
        GroupPrincipal groupPrincipal = null;
        InternalGroupPrincipal internalGroup = commonQueries
                .getInternalGroupPrincipal(GroupPrincipalImpl
                        .getFullPathFromPrincipalName(groupFullPathName));
        if (null != internalGroup)
        {
            groupPrincipal = new GroupPrincipalImpl(GroupPrincipalImpl
                    .getPrincipalNameFromFullPath(internalGroup.getFullPath()));
        }
        return groupPrincipal;
    }
View Full Code Here


     */
    public void setGroupPrincipal(GroupPrincipal groupPrincipal)
            throws SecurityException
    {
        String fullPath = groupPrincipal.getFullPath();
        InternalGroupPrincipal internalGroup = new InternalGroupPrincipalImpl(
                fullPath);
        commonQueries.setInternalGroupPrincipal(internalGroup, false);
    }
View Full Code Here

     * @see org.apache.jetspeed.security.spi.GroupSecurityHandler#removeGroupPrincipal(org.apache.jetspeed.security.GroupPrincipal)
     */
    public void removeGroupPrincipal(GroupPrincipal groupPrincipal)
            throws SecurityException
    {
        InternalGroupPrincipal internalGroup = commonQueries
                .getInternalGroupPrincipal(groupPrincipal.getFullPath());
        if (null != internalGroup)
        {
            commonQueries.removeInternalGroupPrincipal(internalGroup);
        }
View Full Code Here

    {
        List groupPrincipals = new LinkedList();
        Iterator result = commonQueries.getInternalGroupPrincipals(filter);
        while (result.hasNext())
        {
            InternalGroupPrincipal internalGroup = (InternalGroupPrincipal) result
                    .next();
            String path = internalGroup.getFullPath();
            if (path == null)
            {
                continue;
            }
            groupPrincipals
                    .add(new GroupPrincipalImpl(GroupPrincipalImpl
                            .getPrincipalNameFromFullPath(internalGroup
                                    .getFullPath())));
        }
        return groupPrincipals;
    }
View Full Code Here

     * @see org.apache.jetspeed.security.spi.GroupSecurityHandler#getGroupPrincipal(java.lang.String)
     */
    public GroupPrincipal getGroupPrincipal(String groupFullPathName)
    {
        GroupPrincipal groupPrincipal = null;
        InternalGroupPrincipal internalGroup = commonQueries
                .getInternalGroupPrincipal(GroupPrincipalImpl
                        .getFullPathFromPrincipalName(groupFullPathName));
        if (null != internalGroup)
        {
            groupPrincipal = new GroupPrincipalImpl(GroupPrincipalImpl
                    .getPrincipalNameFromFullPath(internalGroup.getFullPath()), internalGroup.isEnabled(), internalGroup.isMappingOnly());
        }
        return groupPrincipal;
    }
View Full Code Here

     */
    public void setGroupPrincipal(GroupPrincipal groupPrincipal)
            throws SecurityException
    {
        String fullPath = groupPrincipal.getFullPath();
        InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(fullPath);
        if ( null == internalGroup )
        {
            internalGroup = new InternalGroupPrincipalImpl(fullPath);
            internalGroup.setEnabled(groupPrincipal.isEnabled());
            commonQueries.setInternalGroupPrincipal(internalGroup, false);
        }
        else if ( !internalGroup.isMappingOnly() )
        {
            if ( internalGroup.isEnabled() != groupPrincipal.isEnabled() )
            {
                internalGroup.setEnabled(groupPrincipal.isEnabled());
                commonQueries.setInternalGroupPrincipal(internalGroup, false);
            }
        }
        else
        {
View Full Code Here

     * @see org.apache.jetspeed.security.spi.GroupSecurityHandler#removeGroupPrincipal(org.apache.jetspeed.security.GroupPrincipal)
     */
    public void removeGroupPrincipal(GroupPrincipal groupPrincipal)
            throws SecurityException
    {
        InternalGroupPrincipal internalGroup = commonQueries
                .getInternalGroupPrincipal(groupPrincipal.getFullPath());
        if (null != internalGroup)
        {
            commonQueries.removeInternalGroupPrincipal(internalGroup);
        }
View Full Code Here

    {
        List groupPrincipals = new LinkedList();
        Iterator result = commonQueries.getInternalGroupPrincipals(filter);
        while (result.hasNext())
        {
            InternalGroupPrincipal internalGroup = (InternalGroupPrincipal) result
                    .next();
            String path = internalGroup.getFullPath();
            if (path == null)
            {
                continue;
            }
            groupPrincipals
                    .add(new GroupPrincipalImpl(GroupPrincipalImpl.getPrincipalNameFromFullPath(internalGroup.getFullPath()),
                                internalGroup.isEnabled(), internalGroup.isMappingOnly())
                            );
        }
        return groupPrincipals;
    }
View Full Code Here

    public InternalGroupPrincipal getInternalGroupPrincipal(String groupFullPathName)
    {
        Criteria filter = new Criteria();
        filter.addEqualTo("fullPath", groupFullPathName);
        Query query = QueryFactory.newQuery(InternalGroupPrincipalImpl.class, filter);
        InternalGroupPrincipal internalGroup = (InternalGroupPrincipal) getPersistenceBrokerTemplate().getObjectByQuery(query);
        return internalGroup;
    }
View Full Code Here

        Preferences preferences = Preferences.userRoot().node(
                GroupPrincipalImpl.getFullPathFromPrincipalName(groupFullPathName));
        String[] fullPaths = groupHierarchyResolver.resolve(preferences);
        for (int i = 0; i < fullPaths.length; i++)
        {
            InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(fullPaths[i]);
            if (null != internalGroup)
            {
                Collection internalRoles = internalGroup.getRolePrincipals();
                if (null != internalRoles)
                {
                    Iterator internalRolesIter = internalRoles.iterator();
                    while (internalRolesIter.hasNext())
                    {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.om.InternalGroupPrincipal

Copyright © 2018 www.massapicom. 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.