Package org.apache.ambari.server.controller.ivory

Examples of org.apache.ambari.server.controller.ivory.Cluster$Location


      // Create geographical targeting.
      GeoTargeting geoTargeting = new GeoTargeting();

      // Include the US, Quebec, Canada, and the B3P Canada postal code.
      Location countryLocation = new Location();
      countryLocation.setId(2840L);

      Location regionLocation = new Location();
      regionLocation.setId(20123L);

      Location postalCodeLocation = new Location();
      postalCodeLocation.setId(9000093L);

      geoTargeting.setTargetedLocations(new Location[] {countryLocation, regionLocation,
          postalCodeLocation});

      // Exclude Chicago and the New York metro area.
      Location cityLocation = new Location();
      cityLocation.setId(1016367L);

      Location metroLocation = new Location();
      metroLocation.setId(200501L);
      geoTargeting.setExcludedLocations(new Location[] {cityLocation, metroLocation});

      // Exclude domains that are not under the network's control.
      UserDomainTargeting userDomainTargeting = new UserDomainTargeting();
      userDomainTargeting.setDomains(new String[] {"usa.gov"});
View Full Code Here


    Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
    Set<Resource> resources    = new HashSet<Resource>();

    for (String clusterName : clusterNames ) {

      Cluster cluster = service.getCluster(clusterName);

      Resource resource = new ResourceImpl(Resource.Type.DRTargetCluster);
      setResourceProperty(resource, CLUSTER_NAME_PROPERTY_ID,
          cluster.getName(), requestedIds);
      setResourceProperty(resource, CLUSTER_COLO_PROPERTY_ID,
          cluster.getColo(), requestedIds);
      setResourceProperty(resource, CLUSTER_INTERFACES_PROPERTY_ID,
          cluster.getInterfaces(), requestedIds);
      setResourceProperty(resource, CLUSTER_LOCATIONS_PROPERTY_ID,
          cluster.getLocations(), requestedIds);
      setResourceProperty(resource, CLUSTER_PROPERTIES_PROPERTY_ID,
          cluster.getProperties(), requestedIds);

      if (predicate == null || predicate.evaluate(resource)) {
        resources.add(resource);
      }
    }
View Full Code Here

      if (category.equals(CLUSTER_PROPERTIES_PROPERTY_ID)) {
        properties.put(PropertyHelper.getPropertyName(property), (String) entry.getValue());
      }
    }

    return new Cluster(
        clusterName,
        (String) propertyMap.get(CLUSTER_COLO_PROPERTY_ID),
        getInterfaces((Set<Map<String, Object>>) propertyMap.get(CLUSTER_INTERFACES_PROPERTY_ID)),
        getLocations((Set<Map<String, Object>>) propertyMap.get(CLUSTER_LOCATIONS_PROPERTY_ID)),
        properties);
View Full Code Here

    targetClusterNames.add("Cluster3");

    Cluster.Interface interface1 = new Cluster.Interface("type", "endpoint", "version");
    Cluster.Location  location1  = new Cluster.Location("name", "path");

    Cluster targetCluster1 = new Cluster("Cluster1", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));
    Cluster targetCluster2 = new Cluster("Cluster2", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));
    Cluster targetCluster3 = new Cluster("Cluster3", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));

    // set expectations
    expect(service.getClusterNames()).andReturn(targetClusterNames);
View Full Code Here

    targetClusterNames.add("Cluster1");

    Set<Cluster.Interface> interfaceSet = Collections.singleton(interface1);
    Set<Cluster.Location>  locationSet  = Collections.singleton(location1);

    Cluster targetCluster1 = new Cluster("Cluster1", "Colo", interfaceSet,
        locationSet, Collections.singletonMap("P1", "V1"));

    // set expectations
    expect(service.getClusterNames()).andReturn(targetClusterNames);
View Full Code Here

    targetClusterNames.add("Cluster1");

    Cluster.Interface interface1 = new Cluster.Interface("type", "endpoint", "version");
    Cluster.Location  location1  = new Cluster.Location("name", "path");

    Cluster targetCluster1 = new Cluster("Cluster1", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));

    // set expectations
    expect(service.getClusterNames()).andReturn(targetClusterNames);
View Full Code Here

  @Test(enabled = false)
  public void testShouldSetAndGetLocation() {
    //driver.get(pages.html5Page);

    LocationContext d = (LocationContext) new Augmenter().augment(driver);
    Location loc = new Location(40.714353, -74.005973, 0.056747);

    d.setLocation(loc);

    //driver.manage().timeouts().implicitlyWait(2000, MILLISECONDS);
View Full Code Here

          Map<Object, Object> map =
              (Map<Object, Object>) executeMethod.execute(DriverCommand.GET_LOCATION, null);
          double latitude = Long.valueOf((Long) map.get("latitude")).doubleValue();
          double longitude = Long.valueOf((Long) map.get("longitude")).doubleValue();
          double altitude = Long.valueOf((Long) map.get("altitude")).doubleValue();
          return new Location(latitude, longitude, altitude);
        } else if ("setLocation".equals(method.getName())) {
          return executeMethod.execute(DriverCommand.SET_LOCATION, ImmutableMap.of("location", args[0]));
        }
        return null;
      }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.ivory.Cluster$Location

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.