Package org.jclouds.vcloud.domain

Examples of org.jclouds.vcloud.domain.VCloudSession


                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("x-vcloud-authorization", "vcloud-token=9er4d061-4bff-48fa-84b1-5da7166764d2; path=/").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "9er4d061-4bff-48fa-84b1-5da7166764d2");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here


                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("x-vcloud-authorization", "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0=").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0=");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("Set-Cookie", "vcloud-token=37ce2715-9aba-4f48-8e45-2db8a8da702d; path=/").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "37ce2715-9aba-4f48-8e45-2db8a8da702d");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

                                          .addHeader("Set-Cookie", "NSC_ESUO_21654_72.46.239.132_443=fooo;expires=Thu, 02-Jun-2011 17:19:26 GMT;path=/;secure;httponly")
                                          .addHeader("Set-Cookie", "vcloud-token=37ce2715-9aba-4f48-8e45-2db8a8da702d; path=/").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "37ce2715-9aba-4f48-8e45-2db8a8da702d");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("x-vcloud-authorization", "vcloud-token=IPy0w7UGD4lwtdWAK/ZVzfuLK+dztxGRqsOhWqV0i48=").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "IPy0w7UGD4lwtdWAK/ZVzfuLK+dztxGRqsOhWqV0i48=");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

      }

      @Override
      protected Supplier<VCloudSession> provideVCloudTokenCache(@Named(PROPERTY_SESSION_INTERVAL) long seconds,
            AtomicReference<AuthorizationException> authException, final VCloudLoginClient login) {
         return Suppliers.<VCloudSession> ofInstance(new VCloudSession() {

            @Override
            public Map<String, ReferenceType> getOrgs() {
               return ImmutableMap.<String, ReferenceType> of(ORG_REF.getName(), ORG_REF);
            }
View Full Code Here

                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("x-vcloud-authorization", "vcloud-token=9er4d061-4bff-48fa-84b1-5da7166764d2; path=/").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "9er4d061-4bff-48fa-84b1-5da7166764d2");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("x-vcloud-authorization", "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0=").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0=");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

                                          .payload(getClass().getResourceAsStream("/orglist.xml"))
                                          .addHeader("Set-Cookie", "vcloud-token=37ce2715-9aba-4f48-8e45-2db8a8da702d; path=/").build();
      response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8");
      response.getPayload().getContentMetadata().setContentLength(307l);

      VCloudSession reply = parser.apply(response);
      assertEquals(reply.getVCloudToken(), "37ce2715-9aba-4f48-8e45-2db8a8da702d");
      assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));

   }
View Full Code Here

      try {
         final String token = parseTokenFromHeaders(from);
         final Map<String, ReferenceType> org = factory.create(orgHandlerProvider.get()).parse(
               checkNotNull(from.getPayload().getInput(), "no payload in http response to login request %s", from));

         return new VCloudSession() {
            @VCloudToken
            public String getVCloudToken() {
               return token;
            }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.domain.VCloudSession

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.