Package org.jclouds.openstack.swift.v1.domain

Examples of org.jclouds.openstack.swift.v1.domain.Container$Builder


         }
      }
   }

   static void containerHasMetadata(ContainerApi containerApi, String name, Map<String, String> meta) {
      Container container = containerApi.get(name);
      for (Entry<String, String> entry : meta.entrySet()) {
         // note keys are returned in lower-case!
         assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue(),
               container + " didn't have metadata: " + entry);
      }
   }
View Full Code Here


   }

   private void getContainer() {
      System.out.format("Get Container%n");

      Container container = cloudFiles.getContainerApiForRegion(REGION).get(CONTAINER);
      System.out.format("  %s%n", container);
   }
View Full Code Here

      CreateContainerOptions options = CreateContainerOptions.Builder.headers(headers);

      containerApi.create(CONTAINER, options);
      System.out.format("  %s%n", CONTAINER);

      Container container = containerApi.get(CONTAINER);
      System.out.format("    %s%n", container.getMetadata());
   }
View Full Code Here

            "Access-Control-Allow-Headers", "X-My-Other-Header");

      containerApi.updateMetadata(CONTAINER, corsMetadata);
      System.out.format("  %s%n", CONTAINER);

      Container container = containerApi.get(CONTAINER);
      System.out.format("    %s%n", container.getMetadata());
   }
View Full Code Here

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.getContainerApiForRegion("DFW").create("myContainer", anybodyRead().metadata(metadata)));
        
         Container container = api.getContainerApiForRegion("DFW").get("myContainer");
         assertEquals(container.getName(), "myContainer");
         assertEquals(container.getObjectCount(), 42l);
         assertEquals(container.getBytesUsed(), 323479l);
         for (Entry<String, String> entry : container.getMetadata().entrySet()) {
            assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
         }
         assertEquals(server.getRequestCount(), 3);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");
         assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");
View Full Code Here

            .addHeader(CONTAINER_METADATA_PREFIX + "Apiname", "swift")
            .addHeader(CONTAINER_METADATA_PREFIX + "Apiversion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Container container = api.getContainerApiForRegion("DFW").get("myContainer");
         assertEquals(container.getName(), "myContainer");
         assertEquals(container.getObjectCount(), 42l);
         assertEquals(container.getBytesUsed(), 323479l);
         for (Entry<String, String> entry : container.getMetadata().entrySet()) {
            assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
         }

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");
View Full Code Here

      return new PageSetImpl<StorageMetadata>(containers, null);
   }

   @Override
   public boolean containerExists(String container) {
      Container val = api.getContainerApi(regionId).get(container);
      containerCache.put(container, Optional.fromNullable(val));
      return val != null;
   }
View Full Code Here

      api.getObjectApi(regionId, containerName).delete(directory);
   }

   @Override
   public long countBlobs(String containerName) {
      Container container = api.getContainerApi(regionId).get(containerName);
      // undefined if container doesn't exist, so default to zero
      return container != null ? container.getObjectCount() : 0;
   }
View Full Code Here

   private ToSwiftObject toSwiftObject;

   @Override
   public ObjectList apply(HttpResponse from) {
      List<SwiftObject> objects = Lists.transform(json.apply(from), toSwiftObject);
      Container container = parseContainer.apply(from);
      return ObjectList.create(objects, container);
   }
View Full Code Here

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.getContainerApi("DFW").create("myContainer", anybodyRead().metadata(metadata)));

         Container container = api.getContainerApi("DFW").get("myContainer");
         assertEquals(container.getName(), "myContainer");
         assertEquals(container.getObjectCount(), 42l);
         assertEquals(container.getBytesUsed(), 323479l);
         for (Entry<String, String> entry : container.getMetadata().entrySet()) {
            assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
         }
         assertEquals(server.getRequestCount(), 3);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");
         assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.v1.domain.Container$Builder

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.