Get a list of all active server mappings defined for current profile

@return Collection of ServerRedirects
555389
public List<ServerRedirect> getServerMappings() {
        ArrayList<ServerRedirect> servers = new ArrayList<ServerRedirect>();
        try {
            JSONObject response = new JSONObject(doGet(BASE_SERVER, null));
            JSONArray serverArray = response.getJSONArray("servers");

            for (int i = 0; i < serverArray.length(); i++) {
                JSONObject jsonServer = serverArray.getJSONObject(i);
                ServerRedirect server = getServerRedirectFromJSON(jsonServer);
                if (server != null) {
                    servers.add(server);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return servers;
    }
447449
public StringArray getRedirects() {
    if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
      jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
    return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects)));}
828917
public java.util.List<RouteFilterPrefix> getExistingAllowedPrefixesToDirectConnectGateway() {
        if (existingAllowedPrefixesToDirectConnectGateway == null) {
            existingAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>();
        }
        return existingAllowedPrefixesToDirectConnectGateway;
    }
1046637
@Override
   public String[] getServers() {
      Collection<SocketAddress> addresses = channelFactory.getServers();
      return addresses.stream().map(SocketAddress::toString).toArray(String[]::new);
   }
890537
public Map<String, Object> getServiceCredentials() {
        if (serviceCredentials == null) {
            return null;
        }
        return Collections.unmodifiableMap(serviceCredentials);
    }
1070189
protected function filterActiveAppServers($appServerList)
    {
        $activeServerList = [];
        /** @var \OxidEsales\Eshop\Core\DataObject\ApplicationServer $server */
        foreach ($appServerList as $server) {
            if ($server->isInUse($this->currentTime)) {
                $activeServerList[$server->getId()] = $server;
            }
        }
        return $activeServerList;
    }
691559
public ServerRedirect enableServerMapping(int serverMappingId, Boolean enabled) {
        ServerRedirect redirect = new ServerRedirect();
        BasicNameValuePair[] params = {
            new BasicNameValuePair("enabled", enabled.toString()),
            new BasicNameValuePair("profileIdentifier", this._profileName)
        };
        try {
            JSONObject response = new JSONObject(doPost(BASE_SERVER + "/" + serverMappingId, params));
            redirect = getServerRedirectFromJSON(response);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return redirect;
    }
1307527
public static Set<String> getServerHostnames() {
    List<String> servers = getMasterHostnames();
    servers.addAll(getWorkerHostnames());
    return new HashSet<>(servers);
  }
1105638
public java.util.List<NatGatewayAddress> getNatGatewayAddresses() {
        if (natGatewayAddresses == null) {
            natGatewayAddresses = new com.amazonaws.internal.SdkInternalList<NatGatewayAddress>();
        }
        return natGatewayAddresses;
    }
99357
public java.util.List<NatGateway> getNatGateways() {
        if (natGateways == null) {
            natGateways = new com.amazonaws.internal.SdkInternalList<NatGateway>();
        }
        return natGateways;
    }
663179
@RequestMapping(value = "api/edit/server", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getjqRedirects(Model model,
                                           @RequestParam(value = "profileId", required = false) Integer profileId,
                                           @RequestParam(value = "clientUUID", required = true) String clientUUID,
                                           @RequestParam(value = "profileIdentifier", required = false) String profileIdentifier) throws Exception {
        if (profileId == null && profileIdentifier == null) {
            throw new Exception("profileId required");
        }
        if (profileId == null) {
            profileId = ProfileService.getInstance().getIdFromName(profileIdentifier);
        }
        int clientId = ClientService.getInstance().findClient(clientUUID, profileId).getId();

        HashMap<String, Object> returnJson = Utils.getJQGridJSON(ServerRedirectService.getInstance().tableServers(clientId), "servers");
        returnJson.put("hostEditor", Client.isAvailable());
        return returnJson;
    }
1188538
private function getAllowedRedirectHosts()
    {
        $ini = eZINI::instance();
        $allowedHosts = array_fill_keys( $ini->variable( 'SiteSettings', 'AllowedRedirectHosts' ), true );
        // Adding HostMatchMapItems from siteaccess match if present
        if ( $ini->hasVariable( 'SiteAccessSettings', 'HostMatchMapItems' ) )
        {
            $hostMatchMapItems = $ini->variable( 'SiteAccessSettings', 'HostMatchMapItems' );
            foreach ( $hostMatchMapItems as $item )
            {
                list( $host, $sa ) = explode( ';', $item );
                $allowedHosts[$host] = true;
            }
        }

        // Adding HostUriMatchMapItems
        foreach ( $ini->variable( 'SiteAccessSettings', 'HostUriMatchMapItems' ) as $item )
        {
            list( $host, $uri, $sa ) = explode( ';', $item );
            $allowedHosts[$host] = true;
        }

        return $allowedHosts;
    }
797461
public function getServerCredentials()
    {
        if (is_null($this->server)) {
            return [];
        }

        return isset($this->servers[$this->server]) ? $this->servers[$this->server] : [];
    }
986210
public List<CreateServerConfig> getServerConfigs() {
        List<CreateServerConfig> serverConfigs = new ArrayList<>();
        collectConfigs(this, serverConfigs);
        return serverConfigs;
    }
1271864
public Collection<SingularityRequestParent> getActiveSingularityRequests() {
    final Function<String, String> requestUri = (host) -> String.format(REQUESTS_GET_ACTIVE_FORMAT, getApiBase(host));

    return getCollection(requestUri, "ACTIVE requests", REQUESTS_COLLECTION);
  }
343740
protected synchronized List<String> getActiveWorkerInstances() {
        List<String> localList = new ArrayList<String>();
        int activeServerInterval = PropertyManager.getIntegerProperty(PropertyNames.MDW_ROUTING_ACTIVE_SERVER_INTERVAL, 15);   // Represents how many seconds between checks

        if (lastCheck == 0 || ((System.currentTimeMillis() - lastCheck)/1000) > activeServerInterval) {
            lastCheck = System.currentTimeMillis();
            activeServerList.clear();
            for(String server : getWorkerInstances()) {
                try {
                    HttpHelper helper = new HttpHelper(new URL("http://" + server + "/" + ApplicationContext.getServicesContextRoot() + "/Services/SystemInfo?type=threadDumpCount&format=text"));
                    helper.setConnectTimeout(1000);     // Timeout after 1 second
                    helper.setReadTimeout(1000);
                    String response = helper.get();

                    if (!StringHelper.isEmpty(response) && Integer.parseInt(response) > 0 && !activeServerList.contains(server))
                        activeServerList.add(server);
                }
                catch (Exception ex) {
                    if (activeServerList.contains(server))
                        activeServerList.remove(server);

                    logger.info("MDW Server instance " + server + " is not responding");
                }
            }
            lastCheck = System.currentTimeMillis();
        }

        // If all worker instances are non-responsive, still try to send it to one of them - Don't want routing instance to process request
        // Could be they just did a cache refresh or initial startup and couldn't respond in < 1 second - First request
        if (activeServerList.isEmpty()) {
            for (String server : getWorkerInstances())
                activeServerList.add(server);
        }

        for (String server : activeServerList)
            localList.add(server);

        return localList;
    }
77647
@Override
    public List<HostConnectionPool<CL>> getActivePools() {
        return ImmutableList.copyOf(topology.getAllPools().getPools());
    }