Package org.jclouds.openstack.swift.v1.options

Examples of org.jclouds.openstack.swift.v1.options.ListContainerOptions$Builder


   }

   protected void deleteAllObjectsInContainer(String regionId, final String containerName) {
      Uninterruptibles.sleepUninterruptibly(10, TimeUnit.SECONDS);
     
      ObjectList objects = api.objectApiInRegionForContainer(regionId, containerName).list(new ListContainerOptions());
      if (objects == null) {
         return;
      }
      List<String> pathsToDelete = Lists.transform(objects, new Function<SwiftObject, String>() {
         public String apply(SwiftObject input) {
View Full Code Here


   }

   public void testListWithOptions() throws Exception {
      String lexicographicallyBeforeName = name.substring(0, name.length() - 1);
      for (String regionId : regions) {
         ListContainerOptions options = ListContainerOptions.Builder.marker(lexicographicallyBeforeName);
         Container container = api.containerApiInRegion(regionId).list(options).get(0);
         assertEquals(container.getName(), name);
         assertTrue(container.getObjectCount() == 0);
         assertTrue(container.getBytesUsed() == 0);
      }
View Full Code Here

   }

   public void testListWithOptions() throws Exception {
      String lexicographicallyBeforeName = name.substring(0, name.length() - 1);
      for (String regionId : regions) {
         ListContainerOptions options = ListContainerOptions.Builder.marker(lexicographicallyBeforeName);
         
         CDNContainer cdnContainer = api.cdnApiInRegion(regionId).list(options).get(0);
         assertCDNContainerNotNull(cdnContainer);
         assertTrue(cdnContainer.isEnabled());
      }
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/cdn_container_list_at.json"))));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         ListContainerOptions options = ListContainerOptions.Builder.marker("cdn-container-3");
         ImmutableList<CDNContainer> containers = api.cdnApiInRegion("DFW").list(options).toList();

         for(CDNContainer container : containers) {
            assertCDNContainerNotNull(container);
         }
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         ListContainerOptions options = ListContainerOptions.Builder.marker("cdn-container-3");
         FluentIterable<CDNContainer> containers = api.cdnApiInRegion("DFW").list(options);

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "GET", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/?format=json&enabled_only=true&marker=cdn-container-3");
View Full Code Here

   public void testListWithOptions() throws Exception {
      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/container_list.json"))));

      ListContainerOptions options = ListContainerOptions.Builder.marker("test");
      assertNotNull(options);
     
      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ImmutableList<Container> containers = api.containerApiInRegion("DFW").list(options).toList();
View Full Code Here

            .addHeader(CONTAINER_READ, CONTAINER_ACL_ANYBODY_READ)
            .setBody(stringFromResource("/object_list.json"))));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ObjectList objects = api.objectApiInRegionForContainer("DFW", "myContainer").list(new ListContainerOptions());
         assertEquals(objects, parsedObjectsForUrl(server.getUrl("/").toString()));
         assertEquals(objects.getContainer().getName(), "myContainer");
         assertTrue(objects.getContainer().getAnybodyRead().get());

         assertEquals(server.getRequestCount(), 2);
View Full Code Here

   public void testListWithOptions() throws Exception {
      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/container_list.json"))));

      ListContainerOptions options = ListContainerOptions.Builder.marker("test");
      assertNotNull(options);
     
      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ImmutableList<Container> containers = api.getContainerApiForRegion("DFW").list(options).toList();
View Full Code Here

   }

   public void testListWithOptions() throws Exception {
      String lexicographicallyBeforeName = name.substring(0, name.length() - 1);
      for (String regionId : regions) {
         ListContainerOptions options = ListContainerOptions.Builder.marker(lexicographicallyBeforeName);
         Container container = api.getContainerApiForRegion(regionId).list(options).get(0);
         assertEquals(container.getName(), name);
         assertTrue(container.getObjectCount() == 0);
         assertTrue(container.getBytesUsed() == 0);
      }
View Full Code Here

            .addHeader(CONTAINER_READ, CONTAINER_ACL_ANYBODY_READ)
            .setBody(stringFromResource("/object_list.json"))));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ObjectList objects = api.getObjectApiForRegionAndContainer("DFW", "myContainer").list(new ListContainerOptions());
         assertEquals(objects, parsedObjectsForUrl(server.getUrl("/").toString()));
         assertEquals(objects.getContainer().getName(), "myContainer");
         assertTrue(objects.getContainer().getAnybodyRead().get());

         assertEquals(server.getRequestCount(), 2);
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.v1.options.ListContainerOptions$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.