Examples of BucketMetadata


Examples of org.jclouds.s3.domain.BucketMetadata

   public ListenableFuture<? extends Set<BucketMetadata>> listOwnedBuckets() {
      return immediateFuture(Sets.newLinkedHashSet(Iterables.transform(containerToBlobs.keySet(),
               new Function<String, BucketMetadata>() {
                  public BucketMetadata apply(String name) {
                     return new BucketMetadata(name, null, null);
                  }

               })));
   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

   public ListenableFuture<? extends Set<BucketMetadata>> listOwnedBuckets() {
      return immediateFuture(Sets.newLinkedHashSet(Iterables.transform(containerToBlobs.keySet(),
               new Function<String, BucketMetadata>() {
                  public BucketMetadata apply(String name) {
                     return new BucketMetadata(name, null, null);
                  }

               })));
   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

   void bucketExists() throws Exception {
      String bucketName = getContainerName();
      try {
         Set<BucketMetadata> list = getApi().listOwnedBuckets();
         BucketMetadata firstBucket = Iterables.get(list, 0);
         BucketMetadata toMatch = new BucketMetadata(bucketName, new Date(), firstBucket.getOwner());
         assert list.contains(toMatch);
      } finally {
         returnContainer(bucketName);
      }
   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

      expected.setName("mycontainer");
      expected.setType(StorageType.CONTAINER);
      expected.setLocation(region);
     
      assertEquals(
               fn.apply(ImmutableSet.of(new BucketMetadata("mycontainer", null, null))).toString(),
               new PageSetImpl<StorageMetadata>(ImmutableSet.<StorageMetadata> of(expected), null).toString());

   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

   }

   @Test
   public void testCanParseListAllMyBuckets() throws HttpException {
      Set<BucketMetadata> s3Buckets = runParseListAllMyBuckets();
      BucketMetadata container1 = Iterables.get(s3Buckets, 0);
      assert container1.getName().equals("adrianjbosstest");
      Date expectedDate1 = new SimpleDateFormatDateService().iso8601DateParse("2009-03-12T02:00:07.000Z");
      Date date1 = container1.getCreationDate();
      assert date1.equals(expectedDate1);
      BucketMetadata container2 = (BucketMetadata) s3Buckets.toArray()[1];
      assert container2.getName().equals("adrianjbosstest2");
      Date expectedDate2 = new SimpleDateFormatDateService().iso8601DateParse("2009-03-12T02:00:09.000Z");
      Date date2 = container2.getCreationDate();
      assert date2.equals(expectedDate2);
      assert s3Buckets.size() == 2;
      CanonicalUser owner = new CanonicalUser("e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0");
      assert container1.getOwner().equals(owner);
      assert container2.getOwner().equals(owner);
   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

      if (qName.equals("ID")) { // owner stuff
         currentOwner = new CanonicalUser(currentOrNull(currentText));
      } else if (qName.equals("DisplayName")) {
         currentOwner.setDisplayName(currentOrNull(currentText));
      } else if (qName.equals("Bucket")) {
         buckets.add(new BucketMetadata(currentName, currentCreationDate, currentOwner));
      } else if (qName.equals("Name")) {
         currentName = currentOrNull(currentText);
      } else if (qName.equals("CreationDate")) {
         currentCreationDate = dateParser.iso8601DateParse(currentOrNull(currentText));
      }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

      if (qName.equals("ID")) { // owner stuff
         currentOwner = new CanonicalUser(currentOrNull(currentText));
      } else if (qName.equals("DisplayName")) {
         currentOwner.setDisplayName(currentOrNull(currentText));
      } else if (qName.equals("Bucket")) {
         buckets.add(new BucketMetadata(currentName, currentCreationDate, currentOwner));
      } else if (qName.equals("Name")) {
         currentName = currentOrNull(currentText);
      } else if (qName.equals("CreationDate")) {
         currentCreationDate = dateParser.iso8601DateParse(currentOrNull(currentText));
      }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

      expected.setName("mycontainer");
      expected.setType(StorageType.CONTAINER);
      expected.setLocation(region);
     
      assertEquals(
               fn.apply(ImmutableSet.of(new BucketMetadata("mycontainer", null, null))).toString(),
               new PageSetImpl<StorageMetadata>(ImmutableSet.<StorageMetadata> of(expected), null).toString());

   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

   }

   @Test
   public void testCanParseListAllMyBuckets() throws HttpException {
      Set<BucketMetadata> s3Buckets = runParseListAllMyBuckets();
      BucketMetadata container1 = Iterables.get(s3Buckets, 0);
      assert container1.getName().equals("adrianjbosstest");
      Date expectedDate1 = new SimpleDateFormatDateService().iso8601DateParse("2009-03-12T02:00:07.000Z");
      Date date1 = container1.getCreationDate();
      assert date1.equals(expectedDate1);
      BucketMetadata container2 = (BucketMetadata) s3Buckets.toArray()[1];
      assert container2.getName().equals("adrianjbosstest2");
      Date expectedDate2 = new SimpleDateFormatDateService().iso8601DateParse("2009-03-12T02:00:09.000Z");
      Date date2 = container2.getCreationDate();
      assert date2.equals(expectedDate2);
      assert s3Buckets.size() == 2;
      CanonicalUser owner = new CanonicalUser("e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0");
      assert container1.getOwner().equals(owner);
      assert container2.getOwner().equals(owner);
   }
View Full Code Here

Examples of org.jclouds.s3.domain.BucketMetadata

   void bucketExists() throws Exception {
      String bucketName = getContainerName();
      try {
         Set<BucketMetadata> list = getApi().listOwnedBuckets();
         BucketMetadata firstBucket = Iterables.get(list, 0);
         BucketMetadata toMatch = new BucketMetadata(bucketName, new Date(), firstBucket.getOwner());
         assert list.contains(toMatch);
      } finally {
         returnContainer(bucketName);
      }
   }
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.