Examples of CanonicalGrantee


Examples of org.jets3t.service.acl.CanonicalGrantee

                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

Examples of org.jets3t.service.acl.CanonicalGrantee

                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());
                canonicalUser.setDisplayName(canonicalGrantee.getDisplayName());
                grant.setGrantee(canonicalUser);
            } else if (jets3tGrantee instanceof EmailAddressGrantee) {
                EmailAddressGrantee emailGrantee = (EmailAddressGrantee) jets3tGrantee;
                AmazonCustomerByEmail customerByEmail = new AmazonCustomerByEmail();
                customerByEmail.setEmailAddress(emailGrantee.getIdentifier());
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

                insideACL = true;
            } else if (name.equals("Grantee")) {
                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

Examples of org.jets3t.service.acl.CanonicalGrantee

        // Grant access by email address. Note that this only works email address of AWS S3 members.
        acl.grantPermission(new EmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);

        // Grant control of ACL settings to a known AWS S3 member.
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_READ_ACP);
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_WRITE_ACP);

        /*
         * Bucket Policies -- offer a greater degree of access control for a bucket.
         */
 
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

        } else if ("Cancel".equals(e.getActionCommand())) {
            updatedAccessControlList = null;
            this.setVisible(false);
        } else if ("addCanonicalGrantee".equals(e.getActionCommand())) {
            int rowIndex = canonicalGranteeTableModel.addGrantee(
                new CanonicalGrantee("NewCanonicalId"), Permission.PERMISSION_READ);
            canonicalGranteeTable.setRowSelectionInterval(rowIndex, rowIndex);
        } else if ("removeCanonicalGrantee".equals(e.getActionCommand())) {
            if (canonicalGranteeTable.getSelectedRow() >= 0) {
                canonicalGranteeTableModel.removeGrantAndPermission(canonicalGranteeTable.getSelectedRow());
            }
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

        // TEST DATA
        AccessControlList acl = new AccessControlList();
        S3Owner owner = new S3Owner("1234567890", "Some Name");
        acl.setOwner(owner);

        GranteeInterface grantee = new CanonicalGrantee();
        grantee.setIdentifier("zzz");
        acl.grantPermission(grantee, Permission.PERMISSION_WRITE);

        grantee = new CanonicalGrantee();
        grantee.setIdentifier("abc");
        ((CanonicalGrantee)grantee).setDisplayName("jamesmurty");
        acl.grantPermission(grantee, Permission.PERMISSION_FULL_CONTROL);
        grantee = new CanonicalGrantee();
        grantee.setIdentifier("aaa");
        acl.grantPermission(grantee, Permission.PERMISSION_READ);
        grantee = GroupGrantee.ALL_USERS;
        acl.grantPermission(grantee, Permission.PERMISSION_READ);
        grantee = GroupGrantee.AUTHENTICATED_USERS;
        acl.grantPermission(grantee, Permission.PERMISSION_WRITE);
        grantee = new EmailAddressGrantee();
        grantee.setIdentifier("james@test.com");
        acl.grantPermission(grantee, Permission.PERMISSION_READ);
        grantee = new EmailAddressGrantee();
        grantee.setIdentifier("james@test2.com");
        acl.grantPermission(grantee, Permission.PERMISSION_FULL_CONTROL);

        JFrame f = new JFrame("Cockpit");
        S3Bucket bucket = new S3Bucket();
        bucket.setName("SomeReallyLongAndWackyBucketNamePath.HereItIs");
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

            // New object to insert.
            currentGrantees.add(insertRow, gap);
            if (grantee instanceof GroupGrantee) {
                this.insertRow(insertRow, new Object[] {grantee, permission});
            } else if (grantee instanceof CanonicalGrantee) {
                CanonicalGrantee canonicalGrantee = (CanonicalGrantee) grantee;
                this.insertRow(insertRow, new Object[] {canonicalGrantee.getIdentifier(),
                    canonicalGrantee.getDisplayName(), permission});
            } else {
                this.insertRow(insertRow, new Object[] {grantee.getIdentifier(), permission});
            }
            return insertRow;
        }
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

                bucketLoggingStatus.setTargetBucketName(targetBucket);
                bucketLoggingStatus.setLogfilePrefix(targetPrefix);
            }
            // Handle TargetGrants ACLs
            else if (name.equals("ID")) {
                currentGrantee = new CanonicalGrantee();
                currentGrantee.setIdentifier(elementText);
            } else if (name.equals("EmailAddress")) {
                currentGrantee = new EmailAddressGrantee();
                currentGrantee.setIdentifier(elementText);
            } else if (name.equals("URI")) {
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

        } else if (name.equals("DisplayName") && !insideACL) {
            owner.setDisplayName(elementText);
        }
        // ACL details.
        else if (name.equals("ID")) {
            currentGrantee = new CanonicalGrantee();
            currentGrantee.setIdentifier(elementText);
        } else if (name.equals("EmailAddress")) {
            currentGrantee = new EmailAddressGrantee();
            currentGrantee.setIdentifier(elementText);
        } else if (name.equals("URI")) {
View Full Code Here

Examples of org.jets3t.service.acl.CanonicalGrantee

        Set<GrantAndPermission> grants = new HashSet<GrantAndPermission>(Arrays.asList(acl.getGrantAndPermissions()));
        assertEquals(grants.size(), 3);
        Set<GrantAndPermission> grantSet = new HashSet<GrantAndPermission>();
        for (int i = 1; i <= 3; ++i) {
            grantSet.add(new GrantAndPermission(new CanonicalGrantee(Integer.toString(i)), Permission.PERMISSION_READ));
        }
    }
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.