Examples of ScalingPolicyTargetType


Examples of org.jclouds.rackspace.autoscale.v1.domain.CreateScalingPolicy.ScalingPolicyTargetType

      // A lot of the complexity is expected to go away

      Map<String, Object> singleMap = json.apply(from);
      Map<String, Object> scalingPolicyMap = (Map<String, Object>) singleMap.get("policy");

      ScalingPolicyTargetType targetType = null;
      for(String key : scalingPolicyMap.keySet()) {
         if(ScalingPolicyTargetType.getByValue(key).isPresent()) {
            targetType = ScalingPolicyTargetType.getByValue(key).get();
            break;
        
      }

      ImmutableList.Builder<Link> links = ImmutableList.builder();
      for(Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
         Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
         links.add(link);
      }

      Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now
      ScalingPolicy scalingPolicyResponse =
            new ScalingPolicy(
                  (String)scalingPolicyMap.get("name"),
                  ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
                  ((Double)scalingPolicyMap.get("cooldown")).intValue(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.CreateScalingPolicy.ScalingPolicyTargetType

      Map<String, List<Map<String, Object>>> singleMap = (Map<String, List<Map<String, Object>>>) json.apply(from);
      List<Map<String, Object>> result = singleMap.get("policies");
      ImmutableList.Builder<ScalingPolicy> scalingPoliciesList = ImmutableList.builder();

      for(Map<String, Object> scalingPolicyMap : result) {
         ScalingPolicyTargetType targetType = null;
         for(String key : scalingPolicyMap.keySet()) {
            if(ScalingPolicyTargetType.getByValue(key).isPresent()) {
               targetType = ScalingPolicyTargetType.getByValue(key).get();
               break;
           
         }

         ImmutableList.Builder<Link> links = ImmutableList.builder();
         for(Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
            Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
            links.add(link);
         }

         Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now
         ScalingPolicy scalingPolicyResponse =
               new ScalingPolicy(
                     (String)scalingPolicyMap.get("name"),
                     ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
                     ((Double)scalingPolicyMap.get("cooldown")).intValue(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.CreateScalingPolicy.ScalingPolicyTargetType

            .name((String) groupConfigurationMap.get("name"))
            .metadata((Map<String, String>) groupConfigurationMap.get("metadata"))
            .build();

      for(Map<String, Object> scalingPolicyMap : (List<Map<String, Object>>) group.get("scalingPolicies")) {
         ScalingPolicyTargetType targetType = null;
         for(String key : scalingPolicyMap.keySet()) {
            if(ScalingPolicyTargetType.getByValue(key).isPresent()) {
               targetType = ScalingPolicyTargetType.getByValue(key).get();
               break;
           
         }

         ImmutableList.Builder<Link> links = ImmutableList.builder();
         for(Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
            Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
            links.add(link);
         }

         Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now

         ScalingPolicy scalingPolicyResponse =
               new ScalingPolicy(
                     (String)scalingPolicyMap.get("name"),
                     ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.CreateScalingPolicy.ScalingPolicyTargetType

      // A lot of the complexity is expected to go away

      Map<String, Object> singleMap = json.apply(from);
      Map<String, Object> scalingPolicyMap = (Map<String, Object>) singleMap.get("policy");

      ScalingPolicyTargetType targetType = null;
      for (String key : scalingPolicyMap.keySet()) {
         if (ScalingPolicyTargetType.getByValue(key).isPresent()) {
            targetType = ScalingPolicyTargetType.getByValue(key).get();
            break;
        
      }

      ImmutableList.Builder<Link> links = ImmutableList.builder();
      for (Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
         Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
         links.add(link);
      }

      Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now
      ScalingPolicy scalingPolicyResponse =
            new ScalingPolicy(
                  (String)scalingPolicyMap.get("name"),
                  ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
                  ((Double)scalingPolicyMap.get("cooldown")).intValue(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.CreateScalingPolicy.ScalingPolicyTargetType

      Map<String, List<Map<String, Object>>> singleMap = (Map<String, List<Map<String, Object>>>) json.apply(from);
      List<Map<String, Object>> result = singleMap.get("policies");
      ImmutableList.Builder<ScalingPolicy> scalingPoliciesList = ImmutableList.builder();

      for (Map<String, Object> scalingPolicyMap : result) {
         ScalingPolicyTargetType targetType = null;
         for (String key : scalingPolicyMap.keySet()) {
            if (ScalingPolicyTargetType.getByValue(key).isPresent()) {
               targetType = ScalingPolicyTargetType.getByValue(key).get();
               break;
           
         }

         ImmutableList.Builder<Link> links = ImmutableList.builder();
         for (Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
            Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
            links.add(link);
         }

         Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now
         ScalingPolicy scalingPolicyResponse =
               new ScalingPolicy(
                     (String)scalingPolicyMap.get("name"),
                     ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
                     ((Double)scalingPolicyMap.get("cooldown")).intValue(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.CreateScalingPolicy.ScalingPolicyTargetType

            .name((String) groupConfigurationMap.get("name"))
            .metadata((Map<String, String>) groupConfigurationMap.get("metadata"))
            .build();

      for (Map<String, Object> scalingPolicyMap : (List<Map<String, Object>>) group.get("scalingPolicies")) {
         ScalingPolicyTargetType targetType = null;
         for (String key : scalingPolicyMap.keySet()) {
            if (ScalingPolicyTargetType.getByValue(key).isPresent()) {
               targetType = ScalingPolicyTargetType.getByValue(key).get();
               break;
           
         }

         ImmutableList.Builder<Link> links = ImmutableList.builder();
         for (Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
            Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
            links.add(link);
         }

         Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now

         ScalingPolicy scalingPolicyResponse =
               new ScalingPolicy(
                     (String)scalingPolicyMap.get("name"),
                     ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.ScalingPolicy.ScalingPolicyTargetType

      // A lot of the complexity is expected to go away

      Map<String, Object> singleMap = json.apply(from);
      Map<String, Object> scalingPolicyMap = (Map<String, Object>) singleMap.get("policy");

      ScalingPolicyTargetType targetType = null;
      for(String key : scalingPolicyMap.keySet()) {
         if(ScalingPolicyTargetType.getByValue(key).isPresent()) {
            targetType = ScalingPolicyTargetType.getByValue(key).get();
            break;
        
      }

      ImmutableList.Builder<Link> links = ImmutableList.builder();
      for(Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
         Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
         links.add(link);
      }

      Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now
      ScalingPolicyResponse scalingPolicyResponse =
            new ScalingPolicyResponse(
                  (String)scalingPolicyMap.get("name"),
                  ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
                  ((Double)scalingPolicyMap.get("cooldown")).intValue(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.ScalingPolicy.ScalingPolicyTargetType

      Map<String, List<Map<String, Object>>> singleMap = (Map<String, List<Map<String, Object>>>) json.apply(from);
      List<Map<String, Object>> result = singleMap.get("policies");
      ImmutableList.Builder<ScalingPolicyResponse> scalingPoliciesList = ImmutableList.builder();

      for(Map<String, Object> scalingPolicyMap : result) {
         ScalingPolicyTargetType targetType = null;
         for(String key : scalingPolicyMap.keySet()) {
            if(ScalingPolicyTargetType.getByValue(key).isPresent()) {
               targetType = ScalingPolicyTargetType.getByValue(key).get();
               break;
           
         }

         ImmutableList.Builder<Link> links = ImmutableList.builder();
         for(Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
            Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
            links.add(link);
         }

         Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now
         ScalingPolicyResponse scalingPolicyResponse =
               new ScalingPolicyResponse(
                     (String)scalingPolicyMap.get("name"),
                     ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
                     ((Double)scalingPolicyMap.get("cooldown")).intValue(),
View Full Code Here

Examples of org.jclouds.rackspace.autoscale.v1.domain.ScalingPolicy.ScalingPolicyTargetType

            .name((String) groupConfigurationMap.get("name"))
            .metadata((Map<String, String>) groupConfigurationMap.get("metadata"))
            .build();

      for(Map<String, Object> scalingPolicyMap : (List<Map<String, Object>>) group.get("scalingPolicies")) {
         ScalingPolicyTargetType targetType = null;
         for(String key : scalingPolicyMap.keySet()) {
            if(ScalingPolicyTargetType.getByValue(key).isPresent()) {
               targetType = ScalingPolicyTargetType.getByValue(key).get();
               break;
           
         }

         ImmutableList.Builder<Link> links = ImmutableList.builder();
         for(Map<String, String> linkMap : (List<Map<String, String>>) scalingPolicyMap.get("links")) {
            Link link = Link.builder().href(URI.create(linkMap.get("href"))).relation(Relation.fromValue(linkMap.get("rel"))).build();
            links.add(link);
         }

         Double d = (Double)scalingPolicyMap.get(targetType.toString()); // GSON only knows double now

         ScalingPolicyResponse scalingPolicyResponse =
               new ScalingPolicyResponse(
                     (String)scalingPolicyMap.get("name"),
                     ScalingPolicyType.getByValue((String)scalingPolicyMap.get("type")).get(),
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.