Package org.jets3t.service.acl

Examples of org.jets3t.service.acl.GroupGrantee


            org.jets3t.service.acl.Permission permission =
                org.jets3t.service.acl.Permission.parsePermission(grant.getPermission().toString());           
           
            Grantee grantee = grant.getGrantee();
            if (grantee instanceof Group) {
                GroupGrantee jets3tGrantee = new GroupGrantee();
                jets3tGrantee.setIdentifier(((Group)grantee).getURI());               
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof CanonicalUser) {
                CanonicalUser canonicalUser = (CanonicalUser) grantee;
                CanonicalGrantee jets3tGrantee = new CanonicalGrantee();
                jets3tGrantee.setIdentifier(canonicalUser.getID());
                jets3tGrantee.setDisplayName(canonicalUser.getDisplayName());
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof AmazonCustomerByEmail) {
                AmazonCustomerByEmail customerByEmail = (AmazonCustomerByEmail) grantee;
                EmailAddressGrantee jets3tGrantee = new EmailAddressGrantee();
                jets3tGrantee.setIdentifier(customerByEmail.getEmailAddress());
                acl.grantPermission(jets3tGrantee, permission);               
            } else {
                throw new S3ServiceException("Unrecognised grantee type: " + grantee.getClass());
            }
        }
View Full Code Here


            GrantAndPermission jets3tGaP = (GrantAndPermission) grantIter.next();
            GranteeInterface jets3tGrantee = jets3tGaP.getGrantee();
            Grant grant = new Grant();
           
            if (jets3tGrantee instanceof GroupGrantee) {
                GroupGrantee groupGrantee = (GroupGrantee) jets3tGrantee;
                Group group = new Group();
                group.setURI(groupGrantee.getIdentifier());
                grant.setGrantee(group);
            } else if (jets3tGrantee instanceof CanonicalGrantee) {
                CanonicalGrantee canonicalGrantee = (CanonicalGrantee) jets3tGrantee;
                CanonicalUser canonicalUser = new CanonicalUser();
                canonicalUser.setID(canonicalGrantee.getIdentifier());
View Full Code Here

                if ("AmazonCustomerByEmail".equals(attrs.getValue("xsi:type"))) {
                    currentGrantee = new EmailAddressGrantee();
                } else if ("CanonicalUser".equals(attrs.getValue("xsi:type"))) {
                    currentGrantee = new CanonicalGrantee();
                } else if ("Group".equals(attrs.getValue("xsi:type"))) {
                    currentGrantee = new GroupGrantee();
                }
            }
        }
View Full Code Here

      setDefaultEditor(GroupGrantee.class, groupCellEditor);
            setDefaultRenderer(GroupGrantee.class, new DefaultTableCellRenderer() {
                private static final long serialVersionUID = 4938391147702620699L;

                public Component getTableCellRendererComponent(JTable arg0, Object value, boolean arg2, boolean arg3, int arg4, int arg5) {
                    GroupGrantee groupGrantee = (GroupGrantee) value;
                    return super.getTableCellRendererComponent(arg0, groupGrantee.getIdentifier(), arg2, arg3, arg4, arg5);
                }
            });
            DefaultCellEditor permissionCellEditor = new DefaultCellEditor(permissionComboBox);
            permissionCellEditor.setClickCountToStart(2);
      setDefaultEditor(Permission.class, permissionCellEditor);
View Full Code Here

            org.jets3t.service.acl.Permission permission =
                org.jets3t.service.acl.Permission.parsePermission(grant.getPermission().toString());           
           
            Grantee grantee = grant.getGrantee();
            if (grantee instanceof Group) {
                GroupGrantee jets3tGrantee = new GroupGrantee();
                jets3tGrantee.setIdentifier(((Group)grantee).getURI());               
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof CanonicalUser) {
                CanonicalUser canonicalUser = (CanonicalUser) grantee;
                CanonicalGrantee jets3tGrantee = new CanonicalGrantee();
                jets3tGrantee.setIdentifier(canonicalUser.getID());
                jets3tGrantee.setDisplayName(canonicalUser.getDisplayName());
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof AmazonCustomerByEmail) {
                AmazonCustomerByEmail customerByEmail = (AmazonCustomerByEmail) grantee;
                EmailAddressGrantee jets3tGrantee = new EmailAddressGrantee();
                jets3tGrantee.setIdentifier(customerByEmail.getEmailAddress());
                acl.grantPermission(jets3tGrantee, permission);               
            } else {
                throw new S3ServiceException("Unrecognised grantee type: " + grantee.getClass());
            }
        }
View Full Code Here

            GrantAndPermission jets3tGaP = (GrantAndPermission) grantIter.next();
            GranteeInterface jets3tGrantee = jets3tGaP.getGrantee();
            Grant grant = new Grant();
           
            if (jets3tGrantee instanceof GroupGrantee) {
                GroupGrantee groupGrantee = (GroupGrantee) jets3tGrantee;
                Group group = new Group();
                group.setURI(groupGrantee.getIdentifier());
                grant.setGrantee(group);
            } else if (jets3tGrantee instanceof CanonicalGrantee) {
                CanonicalGrantee canonicalGrantee = (CanonicalGrantee) jets3tGrantee;
                CanonicalUser canonicalUser = new CanonicalUser();
                canonicalUser.setID(canonicalGrantee.getIdentifier());
View Full Code Here

                if ("AmazonCustomerByEmail".equals(attrs.getValue("xsi:type"))) {
                    currentGrantee = new EmailAddressGrantee();
                } else if ("CanonicalUser".equals(attrs.getValue("xsi:type"))) {
                    currentGrantee = new CanonicalGrantee();
                } else if ("Group".equals(attrs.getValue("xsi:type"))) {
                    currentGrantee = new GroupGrantee();
                }
            }
        }
View Full Code Here

      setDefaultEditor(GroupGrantee.class, groupCellEditor);
            setDefaultRenderer(GroupGrantee.class, new DefaultTableCellRenderer() {
                private static final long serialVersionUID = 4938391147702620699L;

                public Component getTableCellRendererComponent(JTable arg0, Object value, boolean arg2, boolean arg3, int arg4, int arg5) {
                    GroupGrantee groupGrantee = (GroupGrantee) value;
                    return super.getTableCellRendererComponent(arg0, groupGrantee.getIdentifier(), arg2, arg3, arg4, arg5);
                }
            });
            DefaultCellEditor permissionCellEditor = new DefaultCellEditor(permissionComboBox);
            permissionCellEditor.setClickCountToStart(2);
      setDefaultEditor(Permission.class, permissionCellEditor);
View Full Code Here

            org.jets3t.service.acl.Permission permission =
                org.jets3t.service.acl.Permission.parsePermission(grant.getPermission().toString());           
           
            Grantee grantee = grant.getGrantee();
            if (grantee instanceof Group) {
                GroupGrantee jets3tGrantee = new GroupGrantee();
                jets3tGrantee.setIdentifier(((Group)grantee).getURI());               
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof CanonicalUser) {
                CanonicalUser canonicalUser = (CanonicalUser) grantee;
                CanonicalGrantee jets3tGrantee = new CanonicalGrantee();
                jets3tGrantee.setIdentifier(canonicalUser.getID());
                jets3tGrantee.setDisplayName(canonicalUser.getDisplayName());
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof AmazonCustomerByEmail) {
                AmazonCustomerByEmail customerByEmail = (AmazonCustomerByEmail) grantee;
                EmailAddressGrantee jets3tGrantee = new EmailAddressGrantee();
                jets3tGrantee.setIdentifier(customerByEmail.getEmailAddress());
                acl.grantPermission(jets3tGrantee, permission);               
            } else {
                throw new S3ServiceException("Unrecognised grantee type: " + grantee.getClass());
            }
        }
View Full Code Here

            GrantAndPermission jets3tGaP = (GrantAndPermission) grantIter.next();
            GranteeInterface jets3tGrantee = jets3tGaP.getGrantee();
            Grant grant = new Grant();
           
            if (jets3tGrantee instanceof GroupGrantee) {
                GroupGrantee groupGrantee = (GroupGrantee) jets3tGrantee;
                Group group = new Group();
                group.setURI(groupGrantee.getIdentifier());
                grant.setGrantee(group);
            } else if (jets3tGrantee instanceof CanonicalGrantee) {
                CanonicalGrantee canonicalGrantee = (CanonicalGrantee) jets3tGrantee;
                CanonicalUser canonicalUser = new CanonicalUser();
                canonicalUser.setID(canonicalGrantee.getIdentifier());
View Full Code Here

TOP

Related Classes of org.jets3t.service.acl.GroupGrantee

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.