Package org.jclouds.rackspace.cloudfiles.v1.handlers

Examples of org.jclouds.rackspace.cloudfiles.v1.handlers.CloudFilesErrorHandler


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


      }
   }

   public void testGet() throws Exception {
      for (String regionId : regions) {
         CDNContainer container = api.getCDNApiForRegion(regionId).get(name);
         assertCDNContainerNotNull(container);
         assertTrue(container.isEnabled());
      }
   }
View Full Code Here

      for (String regionId : regions) {
         // enable with a ttl
         assertNotNull(api.getCDNApiForRegion(regionId).enable(name, 777777));
        
         // now get the container
         CDNContainer original = api.getCDNApiForRegion(regionId).get(name);
         assertTrue(original.isEnabled());
         assertCDNContainerNotNull(original);

         // update options
         UpdateCDNContainerOptions opts = new UpdateCDNContainerOptions()
                                                .ttl(1234567)
                                                .logRetention(true)
                                                .enabled(false);
         // update the container
         assertTrue(api.getCDNApiForRegion(regionId).update(name, opts));
        
         // now get the updated container
         CDNContainer updated = api.getCDNApiForRegion(regionId).get(name);
         assertFalse(updated.isEnabled());
         assertCDNContainerNotNull(updated);
        
         assertNotEquals(original.getTtl(), updated.getTtl());
         assertTrue(updated.isLogRetentionEnabled());
      }
   }
View Full Code Here

      server.enqueue(addCommonHeaders(enabledResponse().setResponseCode(201)));
     
      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         CDNContainer cdnContainer = api.getCDNApiForRegion("DFW").get("container-1");
         assertCDNContainerNotNull(cdnContainer);
         assertEquals(mockCDNContainer, cdnContainer);

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

      server.enqueue(addCommonHeaders(enabledResponse().setResponseCode(201)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         CDNContainer cdnContainer = api.getCDNApiForRegion("DFW").get("cdn-container with spaces");
         assertCDNContainerNotNull(cdnContainer);
         assertEquals(mockCDNContainerWithSpaces, cdnContainer);

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

      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         CDNContainer cdnContainer = api.getCDNApiForRegion("DFW").get("container-1");

         assertAuthentication(server);
         assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/container-1");
         assertNull(cdnContainer);
      } finally {
View Full Code Here

      server.enqueue(addCommonHeaders(updatedResponse().setResponseCode(200)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         CDNContainer cdnContainer = api.getCDNApiForRegion("DFW").get("container-1");
         assertCDNContainerNotNull(cdnContainer);

         // update the CDN Container
         assertTrue(api.getCDNApiForRegion("DFW").update("container-1", enabled(false).logRetention(true).ttl(7654321)));

         cdnContainer = api.getCDNApiForRegion("DFW").get("container-1");
         assertCDNContainerNotNull(cdnContainer);

         CDNContainer updatedContainer = CDNContainer.builder()
               .name("container-1")
               .enabled(false)
               .logRetention(true)
               .ttl(7654321)
               .uri(URI.create("http://id-1.cdn.rackspace.com"))
View Full Code Here

      server.enqueue(addCommonHeaders(updatedResponse().setResponseCode(404)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         CDNContainer cdnContainer = api.getCDNApiForRegion("DFW").get("container-1");
         assertCDNContainerNotNull(cdnContainer);

         // update the CDN Container
         assertFalse(api.getCDNApiForRegion("DFW").update("container-1", enabled(false).logRetention(true).ttl(7654321)));
View Full Code Here

    * make it 100% publicly accessible over the Internet.
    */
   private void enableCdnContainer() {
      System.out.format("Enable CDN Container%n");

      CDNApi cdnApi = cloudFiles.getCDNApiForRegion(REGION);
      URI cdnURI = cdnApi.enable(CONTAINER_PUBLISH);

      System.out.format("  Go to %s/%s%s%n", cdnURI, FILENAME, SUFFIX);
   }
View Full Code Here

   }

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

TOP

Related Classes of org.jclouds.rackspace.cloudfiles.v1.handlers.CloudFilesErrorHandler

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.