Package org.ngrinder.region.model

Examples of org.ngrinder.region.model.RegionInfo


   * @since 3.2
   */
  private void verifyDuplicatedRegion() {
    Map<String, RegionInfo> regions = getAll();
    String localRegion = getCurrent();
    RegionInfo regionInfo = regions.get(localRegion);
    if (regionInfo != null && !StringUtils.equals(regionInfo.getIp(), config.getClusterProperties().getProperty
        (ClusterConstants.PROP_CLUSTER_HOST, NetworkUtils.DEFAULT_LOCAL_HOST_ADDRESS))) {
      throw processException("The region name, " + localRegion
          + ", is already used by other controller " + regionInfo.getIp()
          + ". Please set the different region name in this controller.");
    }
  }
View Full Code Here


  public void checkRegionUpdate() {
    if (!config.isInvisibleRegion()) {
      try {
        HashSet<AgentIdentity> newHashSet = Sets.newHashSet(agentManager.getAllAttachedAgents());
        final String regionIP = StringUtils.defaultIfBlank(config.getCurrentIP(), NetworkUtils.DEFAULT_LOCAL_HOST_ADDRESS);
        cache.put(getCurrent(), new RegionInfo(regionIP, config.getControllerPort(), newHashSet));
      } catch (Exception e) {
        LOGGER.error("Error while updating regions. {}", e.getMessage());
      }
    }
  }
View Full Code Here

    final ArrayList<String> regions = new ArrayList<String>();
    if (config.isClustered()) {
      for (Object eachKey : ((Ehcache) (cache.getNativeCache())).getKeysWithExpiryCheck()) {
        ValueWrapper valueWrapper = cache.get(eachKey);
        if (valueWrapper != null && valueWrapper.get() != null) {
          final RegionInfo region = TypeConvertUtils.cast(valueWrapper.get());
          if (region.isVisible()) {
            regions.add((String) eachKey);
          }
        }
      }
    }
View Full Code Here

    model.addAttribute("region", region);
    model.addAttribute("regions", regionService.getAllVisibleRegionNames());
    File agentPackage = null;
    if (isClustered()) {
      if (StringUtils.isNotBlank(region)) {
        final RegionInfo regionInfo = regionService.getOne(region);
        agentPackage = agentPackageService.createAgentPackage(region, regionInfo.getIp(), regionInfo.getControllerPort(), null);
      }
    } else {
      agentPackage = agentPackageService.createAgentPackage("", "", getConfig().getControllerPort(), null);
    }
    if (agentPackage != null) {
View Full Code Here

    String connectingIP = request.getServerName();
    int port = getConfig().getControllerPort();
    try {
      if (isClustered()) {
        checkNotEmpty(region, "region should be provided to download agent in cluster mode.");
        RegionInfo regionInfo = checkNotNull(regionService.getOne(region), "selecting region '" + region + "'" +
            " is not valid");
        port = regionInfo.getControllerPort();
        connectingIP = regionInfo.getIp();
      }
      final File agentPackage = agentPackageService.createAgentPackage(region, connectingIP, port, owner);
      modelMap.clear();
      return "redirect:/agent/download/" + agentPackage.getName();
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.ngrinder.region.model.RegionInfo

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.