Change the IP whitelist for a target client, overwriting the previous whitelist.

@param string $clientId  Client ID
@param array  $addresses Array of CIDR addresses
776869
public function setWhiteList($clientId, array $addresses)
	{
		$params = array(
			'for_client_id' => $clientId,
			'whitelist'     => json_encode($addresses),
		);

		// If empty, features are set for the owner client.
		if (!$params['for_client_id']) {
			unset($params['for_client_id']);
		}

		return $this->post('clients/set_whitelist', $params);
	}
149702
@Override
	public final void setClientID(String clientID) throws JMSException
    {
        super.setClientID(clientID);
        
        SetClientIDQuery query = new SetClientIDQuery();
        query.setClientID(clientID);
        transportEndpoint.blockingRequest(query);
    }
130064
public function removeAddress(AddressInterface $address): void
    {
        $this->addresses->removeElement($address);

        if ($address->getId() == $this->defaultAddress->getId()) {
            if ($this->addresses->count() > 0) {
                $this->defaultAddress = $this->addresses[0];
            } else {
                $this->defaultAddress = null;
            }
        }
    }
278754
public void setProviders(Map<String, IPermissionTargetProvider> providers) {
        this.providers.clear();
        for (Map.Entry<String, IPermissionTargetProvider> provider : providers.entrySet()) {
            this.providers.put(provider.getKey(), provider.getValue());
        }
    }
800225
public function whitelist($newIps = [], $debugMode = 0) {
		if ($newIps) {
			foreach ($newIps as $ip) {
				$this->_addToWhitelist($ip, $debugMode);
			}
			return true;
		}

		$files = glob(TMP . 'maintenanceOverride-*.txt');
		$ips = [];
		foreach ($files as $file) {
			$ip = pathinfo($file, PATHINFO_FILENAME);
			$ip = substr($ip, strpos($ip, '-') + 1);
			$ips[] = $this->_unslugIp($ip);
		}
		return $ips;
	}
130566
public function setAllowedIpMasks(array $ipMasks) {
		if($this->isActiveClient()) {
			if(isset($_SERVER['REMOTE_ADDR'])) {
				$ip = $_SERVER['REMOTE_ADDR'];
				foreach($ipMasks as $ipMask) {
					if(preg_match('~^' . str_replace(array('.', '*'), array('\.', '\w+'), $ipMask) . '$~i', $ip)) {
						return;
					}
				}
			}
			$this->disable();
		}
	}
687778
public function setIpAddress($ip_address)
    {

        if (!is_null($ip_address) && (!preg_match("/^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?$/", $ip_address))) {
            throw new \InvalidArgumentException("invalid value for $ip_address when calling Server., must conform to the pattern /^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?$/.");
        }

        $this->container['ip_address'] = $ip_address;

        return $this;
    }
804108
public function update($addressId, $params) 
    {
        $uri = $this->uri . $addressId . '/';
        $response = $this->client->update(
            $uri,
            $params
        );

        return json_encode($response->getContent(), JSON_FORCE_OBJECT);
    }
98352
protected static function deleteAddressByIdAsyncWithHttpInfo($address_id) 
    {
        $returnType = '';  
        $request = self::deleteAddressByIdRequest($address_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
659534
@Override
  public void removeClient(long clientId) {
    LOG.info("Removing client " + clientId + " ...");
    synchronized (clientModificationsLock) {
      removedClients.add(clientId);
    }
  }
26112
public void setIpv6Addresses(java.util.Collection<String> ipv6Addresses) {
        if (ipv6Addresses == null) {
            this.ipv6Addresses = null;
            return;
        }

        this.ipv6Addresses = new java.util.ArrayList<String>(ipv6Addresses);
    }
1050781
public function removeAddresses($addresses)
    {
        $this->setCachedValue(null);
        foreach ((array) $addresses as $address) {
            unset($this->mailboxes[$address]);
        }
    }
682215
public void setClientVpnEndpointIds(java.util.Collection<String> clientVpnEndpointIds) {
        if (clientVpnEndpointIds == null) {
            this.clientVpnEndpointIds = null;
            return;
        }

        this.clientVpnEndpointIds = new com.amazonaws.internal.SdkInternalList<String>(clientVpnEndpointIds);
    }
51283
public function setIds(array $ids)
    {
        $this->ids = [];
        $this->idsAsAddresses = [];
        foreach ($ids as $id) {
            $this->idsAsAddresses[] = new Address($id);
            $this->ids[] = $id;
        }
    }
14873
private void addClientId(String clientId) {
        //Sometimes the client Id will be null. For instance in the case QueueConnectionFactory, there is no default client Id specified in metatype.xml.
        if (clientId == null)
            return; //do nothing

        ConcurrentHashMap<String, Integer> clientIdTable = JmsFactoryFactoryImpl.getClientIdTable();

        if (clientIdTable.containsKey(clientId)) {
            clientIdTable.put(clientId, clientIdTable.get(clientId).intValue() + 1);
        } else {
            clientIdTable.put(clientId, 1);
        }

    }
569788
public function detectClient($clients)
	{
		$args = isset($_SERVER['argv']) ? $_SERVER['argv'] : null;

		return $this['client'] = with(new ClientDetector($this['request']))->detect($clients, $args);
	}
365942
private function setClientIPAddresses()
    {
        if ($this->isUsingTrustedProxy()) {
            $this->clientIPAddresses = [$this->server->get('REMOTE_ADDR')];
        } else {
            $ipAddresses = [];

            // RFC 7239
            if ($this->headers->has(self::$trustedHeaderNames[RequestHeaders::FORWARDED])) {
                $header = $this->headers->get(self::$trustedHeaderNames[RequestHeaders::FORWARDED]);
                preg_match_all("/for=(?:\"?\[?)([a-z0-9:\.\-\/_]*)/", $header, $matches);
                $ipAddresses = $matches[1];
            } elseif ($this->headers->has(self::$trustedHeaderNames[RequestHeaders::CLIENT_IP])) {
                $ipAddresses = explode(',', $this->headers->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_IP]));
                $ipAddresses = array_map('trim', $ipAddresses);
            }

            $ipAddresses[] = $this->server->get('REMOTE_ADDR');
            $fallbackIpAddresses = [$ipAddresses[0]];

            foreach ($ipAddresses as $index => $ipAddress) {
                // Check for valid IP address
                if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) {
                    unset($ipAddresses[$index]);
                }

                // Don't accept trusted proxies
                if (in_array($ipAddress, self::$trustedProxies)) {
                    unset($ipAddresses[$index]);
                }
            }

            $this->clientIPAddresses = count($ipAddresses) === 0 ? $fallbackIpAddresses : array_reverse($ipAddresses);
        }
    }