Examples of JSPrincipal


Examples of org.apache.jetspeed.serializer.objects.JSPrincipal

           
            for (JetspeedPrincipal principal : principalManager.getPrincipals(""))
            {
                try
                {
                    JSPrincipal _tempPrincipal = createJSPrincipal(principal);
                    refs.getPrincipalMap(typeName).put(_tempPrincipal.getName(), _tempPrincipal);
                    snapshot.getPrincipals().add(_tempPrincipal);
                }
                catch (Exception e)
                {
                    throw new SerializerException(SerializerException.CREATE_SERIALIZED_OBJECT_FAILED.create(new String[] {
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSPrincipal

                _js.setType(perm.getType());
               
                for (JetspeedPrincipal principal : pm.getPrincipals(perm))
                {
                    String principalTypeName = principal.getType().getName();
                    JSPrincipal jsPrincipal = refs.getPrincipalMap(principalTypeName).get(principal.getName());
                    if (jsPrincipal != null)
                    {
                        // TODO: handle permission principals generically
                        if (JetspeedPrincipalType.ROLE.equals(principalTypeName))
                        {
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSPrincipal

            newPrincipal.addPrivateCredential(credential);
    }
   
    private JSPrincipal createJSPrincipal(JetspeedPrincipal principal) throws SecurityException
    {
        JSPrincipal _jsPrincipal = new JSPrincipal();
        _jsPrincipal.setPrincipal(principal);
        _jsPrincipal.setType(principal.getType().getName());
        _jsPrincipal.setName(principal.getName());
        _jsPrincipal.setMapped(principal.isMapped());
        _jsPrincipal.setEnabled(principal.isEnabled());
        _jsPrincipal.setReadonly(principal.isReadOnly());
        _jsPrincipal.setRemovable(principal.isRemovable());
        _jsPrincipal.setExtendable(principal.isExtendable());
       
        if (JetspeedPrincipalType.USER.equals(principal.getType()))
        {
            Credential credential = userManager.getPasswordCredential((User) principal);
            Subject subject = userManager.getSubject((User) principal);
           
            if (credential != null)
            {
                addJSPrincipalCredentials(true, _jsPrincipal, credential);
            }
           
            for (Object o : subject.getPublicCredentials())
            {
                credential = (Credential)o;
                addJSPrincipalCredentials(true, _jsPrincipal, credential);
            }
           
            for (Object o : subject.getPrivateCredentials())
            {
                credential = (Credential)o;
                addJSPrincipalCredentials(false, _jsPrincipal, credential);
            }
        }
       
        _jsPrincipal.setSecurityAttributes(principal.getSecurityAttributes().getAttributeMap());
       
        return _jsPrincipal;
    }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSPrincipal

           
            for (JetspeedPrincipal principal : principalManager.getPrincipals(""))
            {
                try
                {
                    JSPrincipal _tempPrincipal = createJSPrincipal(principal);
                    refs.getPrincipalMap(typeName).put(_tempPrincipal.getName(), _tempPrincipal);
                    snapshot.getPrincipals().add(_tempPrincipal);
                }
                catch (Exception e)
                {
                    throw new SerializerException(SerializerException.CREATE_SERIALIZED_OBJECT_FAILED.create(new String[] {
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSPrincipal

                _js.setType(perm.getType());
               
                for (JetspeedPrincipal principal : pm.getPrincipals(perm))
                {
                    String principalTypeName = principal.getType().getName();
                    JSPrincipal jsPrincipal = refs.getPrincipalMap(principalTypeName).get(principal.getName());
                    if (jsPrincipal != null)
                    {
                        // TODO: handle permission principals generically
                        if (JetspeedPrincipalType.ROLE.equals(principalTypeName))
                        {
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSPrincipal

            newPrincipal.addPrivateCredential(credential);
    }
   
    private JSPrincipal createJSPrincipal(JetspeedPrincipal principal) throws SecurityException
    {
        JSPrincipal _jsPrincipal = new JSPrincipal();
        _jsPrincipal.setPrincipal(principal);
        _jsPrincipal.setType(principal.getType().getName());
        _jsPrincipal.setName(principal.getName());
        _jsPrincipal.setMapped(principal.isMapped());
        _jsPrincipal.setEnabled(principal.isEnabled());
        _jsPrincipal.setReadonly(principal.isReadOnly());
        _jsPrincipal.setRemovable(principal.isRemovable());
        _jsPrincipal.setExtendable(principal.isExtendable());
       
        if (JetspeedPrincipalType.USER.equals(principal.getType().getName()))
        {
            Credential credential = userManager.getPasswordCredential((User) principal);
            Subject subject = userManager.getSubject((User) principal);
           
            if (credential != null)
            {
                addJSPrincipalCredentials(true, _jsPrincipal, credential);
            }
           
            for (Object o : subject.getPublicCredentials())
            {
                credential = (Credential)o;
                addJSPrincipalCredentials(true, _jsPrincipal, credential);
            }
           
            for (Object o : subject.getPrivateCredentials())
            {
                credential = (Credential)o;
                addJSPrincipalCredentials(false, _jsPrincipal, credential);
            }
        }
       
        _jsPrincipal.setSecurityAttributes(principal.getSecurityAttributes().getAttributeMap());
       
        return _jsPrincipal;
    }
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.