Validate that the client should be registered.
@param client
978664
private void validateClient(Client client) throws RegistrationException {
        Set<Contract> contracts = client.getContracts();
        if (contracts.isEmpty()) {
            throw new NoContractFoundException(Messages.i18n.format("ESRegistry.NoContracts")); //$NON-NLS-1$
        }
        for (Contract contract : contracts) {
            validateContract(contract);
        }
    }
149315
private void validate(Entity entity) {
    MailSettingsImpl mailSettings = new MailSettingsImpl(entity);
    if (mailSettings.isTestConnection()
        && mailSettings.getUsername() != null
        && mailSettings.getPassword() != null) {
      mailSenderFactory.validateConnection(mailSettings);
    }
  }
80439
def _raise_on_invalid_client(self, request):
        """"""
        if self.request_validator.client_authentication_required(request):
            if not self.request_validator.authenticate_client(request):
                log.debug('Client authentication failed, %r.', request)
                raise InvalidClientError(request=request)
        elif not self.request_validator.authenticate_client_id(request.client_id, request):
            log.debug('Client authentication failed, %r.', request)
            raise InvalidClientError(request=request)
785904
public synchronized void register( String clientID ) throws InvalidClientIDException
    {
        if (!clientIDs.add(clientID))
        {
            log.error("Client ID already exists : "+clientID);
            throw new InvalidClientIDException("Client ID already exists : "+clientID);
        }
        log.debug("Registered clientID : "+clientID);
    }
246121
public static void ensureServiceAccessIsAllowed(final RegisteredService registeredService) {
        ensureServiceAccessIsAllowed(registeredService != null ? registeredService.getName() : StringUtils.EMPTY, registeredService);
    }
823820
@SneakyThrows
    public static OidcClientRegistrationResponse getClientRegistrationResponse(final OidcRegisteredService registeredService,
                                                                               final String serverPrefix) {
        val clientResponse = new OidcClientRegistrationResponse();
        clientResponse.setApplicationType(registeredService.getApplicationType());
        clientResponse.setClientId(registeredService.getClientId());
        clientResponse.setClientSecret(registeredService.getClientSecret());
        clientResponse.setSubjectType(registeredService.getSubjectType());
        clientResponse.setTokenEndpointAuthMethod(registeredService.getTokenEndpointAuthenticationMethod());
        clientResponse.setClientName(registeredService.getName());
        clientResponse.setRedirectUris(CollectionUtils.wrap(registeredService.getServiceId()));
        clientResponse.setContacts(
            registeredService.getContacts()
                .stream()
                .map(RegisteredServiceContact::getName)
                .filter(StringUtils::isNotBlank)
                .collect(Collectors.toList())
        );
        clientResponse.setGrantTypes(
            Arrays.stream(OAuth20GrantTypes.values())
                .map(type -> type.getType().toLowerCase())
                .collect(Collectors.toList()));

        clientResponse.setResponseTypes(
            Arrays.stream(OAuth20ResponseTypes.values())
                .map(type -> type.getType().toLowerCase())
                .collect(Collectors.toList()));

        val validator = new SimpleUrlValidatorFactoryBean(false).getObject();
        if (Objects.requireNonNull(validator).isValid(registeredService.getJwks())) {
            clientResponse.setJwksUri(registeredService.getJwks());
        } else {
            val jwks = new JsonWebKeySet(registeredService.getJwks());
            clientResponse.setJwks(jwks.toJson());
        }
        clientResponse.setLogo(registeredService.getLogo());
        clientResponse.setPolicyUri(registeredService.getInformationUrl());
        clientResponse.setTermsOfUseUri(registeredService.getPrivacyUrl());
        clientResponse.setRedirectUris(CollectionUtils.wrapList(registeredService.getServiceId()));
        val clientConfigUri = getClientConfigurationUri(registeredService, serverPrefix);
        clientResponse.setRegistrationClientUri(clientConfigUri);
        return clientResponse;
    }
707745
private synchronized void freeClient(Client client) {
        int current = useCounts.get(client);
        if (current > 0) {
            timestamps.put(client, System.currentTimeMillis());  // Mark that it was used until now.
            useCounts.put(client, current - 1);
            if ((current == 1) && (idleLimit.get() == 0)) {
                closeClient(client);  // This was the last use, and we are supposed to immediately close idle clients.
            }
        } else {
            logger.error("Ignoring attempt to free a client that is not allocated: {}", client);
        }
    }
123262
function(client) {
		this.client = client;
		if(gui.hasModule('gui-spirits@wunderbyte.com')) {
			if(client instanceof gui.Spirit) {
				this.spirit = client || null;
				this.context = window; // otherwise web worker scenario, maybe deprecate
			}
		}
		this.onconstruct();
	}
323920
def client_validate_pin(self, client, pin):
        

        client = self._client_id(client)
        body = {
            "action": "validate_pin",
            "current_pin": pin
        }

        response = self._put(url.clients_id.format(id=client), body=body)
        self._check_response(response, 200)
470264
public static void initialize(KeenClient client) {
        if (client == null) {
            throw new IllegalArgumentException("Client must not be null");
        }

        if (ClientSingleton.INSTANCE.client != null) {
            // Do nothing.
            return;
        }

        ClientSingleton.INSTANCE.client = client;
    }
79801
private void addClientToPoolGently(HClient client) {
    try {
      availableClientQueue.add(client);
    } catch (IllegalStateException ise) {
      log.warn("Capacity hit adding client back to queue. Closing extra");
      client.close();
    }
  }
1025079
@Override
    public void validate() throws OpsGenieClientValidationException {
        super.validate();
        if (getName() == null)
            throw OpsGenieClientValidationException.missingMandatoryProperty(OpsGenieClientConstants.API.NAME);
    }
949699
public static void validateWith(Validator provider) {

		validator = provider;
		if (validator != null) {
			log.info("Registered validation provider: " + validator.getClass().getName());
		}
	}
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);
        }

    }
552535
private void validateContract(final Contract contract, Connection connection)
            throws RegistrationException {
        QueryRunner run = new QueryRunner();
        try {
            Api api = run.query(connection, "SELECT bean FROM gw_apis WHERE org_id = ? AND id = ? AND version = ?", //$NON-NLS-1$
                    Handlers.API_HANDLER, contract.getApiOrgId(), contract.getApiId(), contract.getApiVersion());
            if (api == null) {
                String apiId = contract.getApiId();
                String orgId = contract.getApiOrgId();
                throw new ApiNotFoundException(Messages.i18n.format("JdbcRegistry.ApiNotFoundInOrg", apiId, orgId));  //$NON-NLS-1$
            }
        } catch (SQLException e) {
            throw new RegistrationException(Messages.i18n.format("JdbcRegistry.ErrorValidatingApp"), e); //$NON-NLS-1$
        }
    }
630210
public boolean isValid(MnoHttpClient httpClient) {
		if (uid == null) {
			return false;
		}
		if (isRemoteCheckRequired()) {
			if (this.performRemoteCheck(httpClient)) {
				return true;
			} else {
				return false;
			}
		}
		return true;
	}
1275566
@Override
    public void validate() throws OpsGenieClientValidationException {
        super.validate();
        if (id == null && alias == null)
            throw OpsGenieClientValidationException.missingMultipleMandatoryProperty(OpsGenieClientConstants.API.ALIAS,
                    OpsGenieClientConstants.API.ID);
    }