Examples of EmailAddressGrantee


Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

   public void testEnableBucketLoggingOwner() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(S3AsyncClient.class, "enableBucketLogging", String.class, BucketLogging.class);
      GeneratedHttpRequest request = processor
               .createRequest(method, ImmutableList.<Object> of("bucket", new BucketLogging("mylogs", "access_log-", ImmutableSet
                        .<Grant> of(new Grant(new EmailAddressGrantee("adrian@jclouds.org"), Permission.FULL_CONTROL)))));

      assertRequestLineEquals(request, "PUT https://bucket." + url + "/?logging HTTP/1.1");
      assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
      assertPayloadEquals(request, Strings2.toStringAndClose(getClass().getResourceAsStream("/bucket_logging.xml")),
               "text/xml", false);
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

   }

   private void addGrantsToACL(AccessControlList acl) {
      String ownerId = acl.getOwner().getId();
      acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
      acl.addPermission(new EmailAddressGrantee(StubS3AsyncClient.TEST_ACL_EMAIL), Permission.READ_ACP);
      acl.addPermission(new CanonicalUserGrantee(ownerId), Permission.WRITE_ACP);
   }
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

      try {
         assertNull(getApi().getBucketLogging(bucketName));

         setupAclForBucketLoggingTarget(targetBucket);
         final BucketLogging logging = new BucketLogging(targetBucket, "access_log-",
               ImmutableSet.<Grant> of(new Grant(new EmailAddressGrantee(StubS3AsyncClient.TEST_ACL_EMAIL),
                     Permission.FULL_CONTROL)));

         getApi().enableBucketLogging(bucketName, logging);

         assertConsistencyAware(new Runnable() {
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

public class BucketLoggingHandlerTest extends BaseHandlerTest {
   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/bucket_logging.xml");

      BucketLogging expected = new BucketLogging("mylogs", "access_log-", ImmutableSet.<Grant> of(new Grant(
            new EmailAddressGrantee("adrian@jclouds.org"), Permission.FULL_CONTROL)));
      BucketLoggingHandler handler = injector.getInstance(BucketLoggingHandler.class);
      BucketLogging result = factory.create(handler).parse(is);

      assertEquals(result.getTargetBucket(), expected.getTargetBucket());
      assertEquals(result.getTargetGrants(), expected.getTargetGrants());
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

         CanonicalUser owner = new CanonicalUser(currentId);
         owner.setDisplayName(currentDisplayName);
         acl.setOwner(owner);
      } else if (qName.equals("Grantee")) {
         if ("AmazonCustomerByEmail".equals(currentGranteeType)) {
            currentGrantee = new EmailAddressGrantee(currentId);
         } else if ("CanonicalUser".equals(currentGranteeType)) {
            currentGrantee = new CanonicalUserGrantee(currentId, currentDisplayName);
         } else if ("Group".equals(currentGranteeType)) {
            currentGrantee = new GroupGrantee(URI.create(currentId));
         }
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

         this.targetBucket = currentOrNull(currentText);
      } else if (qName.equals("TargetPrefix")) {
         this.targetPrefix = currentOrNull(currentText);
      } else if (qName.equals("Grantee")) {
         if ("AmazonCustomerByEmail".equals(currentGranteeType)) {
            currentGrantee = new EmailAddressGrantee(currentId);
         } else if ("CanonicalUser".equals(currentGranteeType)) {
            currentGrantee = new CanonicalUserGrantee(currentId, currentDisplayName);
         } else if ("Group".equals(currentGranteeType)) {
            currentGrantee = new GroupGrantee(URI.create(currentId));
         }
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

         CanonicalUser owner = new CanonicalUser(currentId);
         owner.setDisplayName(currentDisplayName);
         acl.setOwner(owner);
      } else if (qName.equals("Grantee")) {
         if ("AmazonCustomerByEmail".equals(currentGranteeType)) {
            currentGrantee = new EmailAddressGrantee(currentId);
         } else if ("CanonicalUser".equals(currentGranteeType)) {
            currentGrantee = new CanonicalUserGrantee(currentId, currentDisplayName);
         } else if ("Group".equals(currentGranteeType)) {
            currentGrantee = new GroupGrantee(URI.create(currentId));
         }
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

   public void testEnableBucketLoggingOwner() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(S3AsyncClient.class, "enableBucketLogging", String.class, BucketLogging.class);
      GeneratedHttpRequest request = processor
               .createRequest(method, ImmutableList.<Object> of("bucket", new BucketLogging("mylogs", "access_log-", ImmutableSet
                        .<Grant> of(new Grant(new EmailAddressGrantee("adrian@jclouds.org"), Permission.FULL_CONTROL)))));

      assertRequestLineEquals(request, "PUT https://bucket." + url + "/?logging HTTP/1.1");
      assertNonPayloadHeadersEqual(request, "Host: bucket." + url + "\n");
      assertPayloadEquals(request, Strings2.toStringAndClose(getClass().getResourceAsStream("/bucket_logging.xml")),
               "text/xml", false);
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

public class BucketLoggingHandlerTest extends BaseHandlerTest {
   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/bucket_logging.xml");

      BucketLogging expected = new BucketLogging("mylogs", "access_log-", ImmutableSet.<Grant> of(new Grant(
            new EmailAddressGrantee("adrian@jclouds.org"), Permission.FULL_CONTROL)));
      BucketLoggingHandler handler = injector.getInstance(BucketLoggingHandler.class);
      BucketLogging result = factory.create(handler).parse(is);

      assertEquals(result.getTargetBucket(), expected.getTargetBucket());
      assertEquals(result.getTargetGrants(), expected.getTargetGrants());
View Full Code Here

Examples of org.jclouds.s3.domain.AccessControlList.EmailAddressGrantee

         this.targetBucket = currentOrNull(currentText);
      } else if (qName.equals("TargetPrefix")) {
         this.targetPrefix = currentOrNull(currentText);
      } else if (qName.equals("Grantee")) {
         if ("AmazonCustomerByEmail".equals(currentGranteeType)) {
            currentGrantee = new EmailAddressGrantee(currentId);
         } else if ("CanonicalUser".equals(currentGranteeType)) {
            currentGrantee = new CanonicalUserGrantee(currentId, currentDisplayName);
         } else if ("Group".equals(currentGranteeType)) {
            currentGrantee = new GroupGrantee(URI.create(currentId));
         }
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.