Adds or overwrites the list of servers scanned by a scanner
@param query_index The index of the sub query
@param id The numeric ID of the scanner
@param servers The list of servers encountered
336259
public void addScannerServers(final int query_index, final int id, 
      final Set<String> servers) {
    Map<Integer, Set<String>> query_servers = scanner_servers.get(query_index);
    if (query_servers == null) {
      query_servers = new ConcurrentHashMap<Integer, Set<String>>(
          Const.SALT_WIDTH() > 0 ? Const.SALT_BUCKETS() : 1);
      scanner_servers.put(query_index, query_servers);
    }
    query_servers.put(id, servers);
  }
1270812
def delete_servers(self, server_id):
        
        endpoint = "https://api.newrelic.com"
        uri = "{endpoint}/api/v1/accounts/{account_id}/servers/{server_id}.xml".format(
            endpoint=endpoint,
            account_id=self.account_id,
            server_id=server_id)
        response = self._make_delete_request(uri)
        failed_deletions = []
        for server in response.findall('.//server'):
            if not 'deleted' in server.findall('.//result')[0].text:
                failed_deletions.append({'server_id': server.get('id')})

        return failed_deletions
1209666
public void write(final AbstractIndex index)
		throws SQLException
	{

		Statement statement;
		StringBuilder cmd;

		while (index.size() > 0) {

			System.out.println("Transmit Index [" + index + "]");

			cmd = index.remove();
			// System.out.println(cmd.toString());

			statement = connection.createStatement();
			statement.execute(cmd.toString());
			statement.close();
		}
	}
149702
@Override
	public final void setClientID(String clientID) throws JMSException
    {
        super.setClientID(clientID);
        
        SetClientIDQuery query = new SetClientIDQuery();
        query.setClientID(clientID);
        transportEndpoint.blockingRequest(query);
    }
589764
public void setServerGroups(java.util.Collection<ServerGroup> serverGroups) {
        if (serverGroups == null) {
            this.serverGroups = null;
            return;
        }

        this.serverGroups = new java.util.ArrayList<ServerGroup>(serverGroups);
    }
1184462
public void setIds(java.util.Collection<String> ids) {
        if (ids == null) {
            this.ids = null;
            return;
        }

        this.ids = new java.util.ArrayList<String>(ids);
    }
241499
public function setQueryString($query_string = [])
    {
        if (!is_array($query_string) && is_string($query_string)) {
            $query_string = parse_str($query_string);
        }
        if (count($query_string) == 0) {
            $this->query_string = [];
        } else {
            $this->query_string = $query_string;
        }
    }
886978
def _add_index_server(self):
        """"""
        index_servers = '\n\t'.join(self.servers.keys())
        self.conf.set('distutils', 'index-servers', index_servers)
1174825
public function addServers(array $servers)
    {
        foreach ($servers as $server) {
            $this->addServer(
                $server[0],
                $server[1],
                isset($server[2]) ? $server[2] : null
            );
        }
    }
1241703
private void addQueryParams(final Request request) {
        if (recurring != null) {
            request.addQueryParam("Recurring", recurring.toString());
        }

        if (triggerBy != null) {
            request.addQueryParam("TriggerBy", triggerBy.toString());
        }

        if (usageCategory != null) {
            request.addQueryParam("UsageCategory", usageCategory.toString());
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
1196433
private void addQueryParams(final Request request) {
        if (status != null) {
            request.addQueryParam("Status", status.toString());
        }

        if (phoneNumber != null) {
            request.addQueryParam("PhoneNumber", phoneNumber.toString());
        }

        if (incomingPhoneNumberSid != null) {
            request.addQueryParam("IncomingPhoneNumberSid", incomingPhoneNumberSid);
        }

        if (friendlyName != null) {
            request.addQueryParam("FriendlyName", friendlyName);
        }

        if (uniqueName != null) {
            request.addQueryParam("UniqueName", uniqueName);
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
577983
private void indexQuery(QueryEntry entry, ServerSessionContext session, CompletableFuture<QueryResponse> future) {
    // If the query index is greater than the session's last applied index, queue the request for handling once the
    // state machine is caught up.
    if (entry.getIndex() > session.getLastApplied()) {
      session.registerIndexQuery(entry.getIndex(), () -> applyQuery(entry, future));
    } else {
      applyQuery(entry, future);
    }
  }
164667
function (id,server)
		{
			if (!_.isString(id) || !_.isObject(server))
				return false;

			if (this.hasModule('server-'+id) && server == null)
				delete this.getModule('server-'+id);
			else
				this.setModule('server-'+id,server);
		}
383392
function listAllServers(next) {
        var limit = 1000;
        var offset = 0;
        var allServers = [];
        var firstReq;
        var firstRes;

        var listPageOfServers = function () {
            if (limit !== null) {
                reqOpts.query.limit = limit;
            }
            reqOpts.query.offset = offset;

            self.get(reqOpts, function (err, servers, req, res) {
                if (err) {
                    next(err, null, req, res);
                    return;
                }

                if (!firstReq) {
                    firstReq = req;
                    firstRes = res;
                }

                allServers = allServers.concat(servers);

                if (servers.length < limit) { // Done paging.
                    // For backwards compat, we return the *first* req/res.
                    next(null, allServers, firstReq, firstRes);
                } else {
                    // Need to fetch another page of servers.
                    offset += servers.length;
                    listPageOfServers();
                }
            });
        };

        listPageOfServers();
    }
1216371
public void updateScannerStat(final int query_index, final int id, 
      final QueryStat name, final long value) {
    Map<Integer, Map<QueryStat, Long>> qs = scanner_stats.get(query_index);
    long cum_time = value;
    if (qs == null) {
      qs = new ConcurrentHashMap<Integer, Map<QueryStat, Long>>();
      scanner_stats.put(query_index, qs);
    }
    Map<QueryStat, Long> scanner_stat_map = qs.get(id);
    if (scanner_stat_map == null) {
      scanner_stat_map = new HashMap<QueryStat, Long>();
      qs.put(id, scanner_stat_map);
    }

    if (scanner_stat_map.containsKey(name)) {
      cum_time += scanner_stat_map.get(name);
    }
    
    scanner_stat_map.put(name, cum_time);
  }
496652
@Override
    public void addMBeanServers(Set<MBeanServerConnection> servers) {
        // Weblogic stores the MBeanServer in a JNDI context

        // Workaround for broken JBoss 4.2.3 which doesn't like JNDI lookups. See #123 for details.
        if (!isJBoss()) {
            InitialContext ctx;
            try {
                ctx = new InitialContext();
                MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
                if (server != null) {
                    servers.add(server);
                }
            } catch (NamingException e) {
                // expected and can happen on non-Weblogic platforms
            }
        }
    }
456028
public List<ServerRedirect> deleteServerMapping(int serverMappingId) {
        ArrayList<ServerRedirect> servers = new ArrayList<ServerRedirect>();
        try {
            JSONArray serverArray = new JSONArray(doDelete(BASE_SERVER + "/" + serverMappingId, null));
            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;
    }