/*
default client id is null.
554255
@Override
    public void setClientID(String clientID) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setClientID", clientID);

        // Make empty and null look the same.
        if ("".equals(clientID))
            clientID = null;
        jcaManagedConnectionFactory.setClientID(clientID);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setClientID");
    }
57723
public void initialize(IClient client) {
        if (log.isDebugEnabled()) {
            log.debug("initialize - client: {}", client);
        }
        if (this.client != null && this.client instanceof Client && !this.client.equals(client)) {
            // unregister old client
            if (log.isTraceEnabled()) {
                log.trace("Unregistering previous client: {}", this.client);
            }
            ((Client) this.client).unregister(this, false);
        }
        this.client = client;
        if (this.client instanceof Client && !((Client) this.client).isRegistered(this)) {
            // register new client
            if (log.isTraceEnabled()) {
                log.trace("Registering client: {}", this.client);
            }
            ((Client) this.client).register(this);
        }
    }
95401
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients/{clientUUID}", method = RequestMethod.DELETE)
    public
    @ResponseBody
    HashMap<String, Object> deleteClient(Model model,
                                         @PathVariable("profileIdentifier") String profileIdentifier,
                                         @PathVariable("clientUUID") String clientUUID) throws Exception {
        logger.info("Attempting to remove the following client: {}", clientUUID);
        if (clientUUID.compareTo(Constants.PROFILE_CLIENT_DEFAULT_ID) == 0)
            throw new Exception("Default client cannot be deleted");

        Integer profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
        clientService.remove(profileId, clientUUID);

        HashMap<String, Object> valueHash = new HashMap<String, Object>();
        valueHash.put("clients", clientService.findAllClients(profileId));
        return valueHash;
    }
1043280
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients/delete", method = RequestMethod.POST)
    public
    @ResponseBody
    HashMap<String, Object> deleteClient(Model model,
                                         @RequestParam("profileIdentifier") String profileIdentifier,
                                         @RequestParam("clientUUID") String[] clientUUID) throws Exception {

        logger.info("Attempting to remove clients from the profile: ", profileIdentifier);
        logger.info("Attempting to remove the following clients: {}", Arrays.toString(clientUUID));

        HashMap<String, Object> valueHash = new HashMap<String, Object>();
        Integer profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);

        for( int i = 0; i < clientUUID.length; i++ )
        {
            if (clientUUID[i].compareTo(Constants.PROFILE_CLIENT_DEFAULT_ID) == 0)
                throw new Exception("Default client cannot be deleted");

            clientService.remove(profileId, clientUUID[i]);
        }

        valueHash.put("clients", clientService.findAllClients(profileId));
        return valueHash;
    }
981565
function getClientId() {
    if (window && window.device) {
        return window.device.uuid;
    }
    if (navigator && navigator.device) {
        return navigator.device.uuid;
    }
    if (window && window.localStorage) {
        var clientId = window.localStorage.getItem(CLIENT_ID_TAG);
        if (!clientId) {
            clientId = uuidGenerator();
            localStorage.setItem(CLIENT_ID_TAG, clientId);
        }
        return clientId;
    } else {
        throw Error("Cannot create and store client id");
    }
}
197394
def has_client_id(self, id):
    """"""

    return self.query(Client).filter(Client.id==id).count() != 0
433742
public String getClient()
    {
        String client = null;
        if (this.properties != null)
        {
            client = (String) this.properties.get(PersistenceProperties.KUNDERA_CLIENT_FACTORY);
        }

        if (client == null)
        {
            log.error("kundera.client property is missing for persistence unit:" + persistenceUnitName);
            throw new IllegalArgumentException("kundera.client property is missing for persistence unit:"
                    + persistenceUnitName);
        }

        return client;
    }
209559
function setClientDevice() {
		var iClientId = 0;
		if (Device.system.combi) {
			iClientId = 1;
		} else if (Device.system.desktop) {
			iClientId = 2;
		} else if (Device.system.tablet) {
			iClientId = 4;
		} else if (Device.system.phone) {
			iClientId = 3;
		}
		return iClientId;
	}
152994
function defaultClientIDHandler(args, context, info) {
  return get(args, [ 'clientID' ]) ||
    get(context, [ 'clientID' ]) ||
    get(info, [ 'rootValue', 'clientID' ]);
}
930100
public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException {
        // derive client id from the connection params or use next
        String id = nextId();
        IClient client = new Client(id, this);
        addClient(id, client);
        return client;
    }
635411
public Client getClient() {
		if(transportClient != null)
			return ((TransportClientUtil)transportClient.getEventClientUtil(indexNameBuilder)).getClient();
		else
			return null;
	}
97045
static String clientNameForURI(URI uri) {
    String host = uri.getHost();
    return (host == null) ? DEFAULT : clientNameForHost(host);
  }
498238
private void _idAdded(String clientId)
  {
    // An id to visit has been added, update our other
    // collections to reflect this.

    // Update the ids collection
    _ids.add(_getIdFromClientId(clientId));

    // Update the unvisited ids collection
    _unvisitedClientIds.add(clientId);

    // Update the subtree ids collection
    _addSubtreeClientId(clientId);
  }
607246
@Override
    public void initWithNiwsConfig(IClientConfig clientConfig) {
        if (clientConfig == null) {
            return;    
        }
        clientName = clientConfig.getClientName();
        if (StringUtils.isEmpty(clientName)) {
            clientName = "default";
        }
        vipAddresses = clientConfig.resolveDeploymentContextbasedVipAddresses();
        maxAutoRetries = clientConfig.getOrDefault(CommonClientConfigKey.MaxAutoRetries);
        maxAutoRetriesNextServer = clientConfig.getOrDefault(CommonClientConfigKey.MaxAutoRetriesNextServer);
        okToRetryOnAllOperations = clientConfig.getOrDefault(CommonClientConfigKey.OkToRetryOnAllOperations);
        defaultRetryHandler = new DefaultLoadBalancerRetryHandler(clientConfig);
        
        tracer = getExecuteTracer();

        Monitors.registerObject("Client_" + clientName, this);
    }
354014
private long getNewClientId() {
    while (true) {
      long clientId = Math.abs(clientIdsGenerator.nextLong());
      if (!clientsData.containsKey(clientId)) {
        return clientId;
      }
    }
  }
689233
protected TransientSessionTicket retrieveSessionTicketViaClientId(final WebContext webContext, final String clientId) {
        val ticket = this.ticketRegistry.getTicket(clientId, TransientSessionTicket.class);
        if (ticket == null) {
            LOGGER.error("Delegated client identifier cannot be located in the authentication request [{}]", webContext.getFullRequestURL());
            throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, StringUtils.EMPTY);
        }
        if (ticket.isExpired()) {
            LOGGER.error("Delegated client identifier [{}] has expired in the authentication request", ticket.getId());
            this.ticketRegistry.deleteTicket(ticket.getId());
            throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, StringUtils.EMPTY);
        }
        LOGGER.debug("Located delegated client identifier as [{}]", ticket.getId());
        return ticket;
    }
233812
public function client()
	{
		if (isset($this->client)) {
			return $this->client ? $this->client : null;
		}
		
		$client_id = $this->clientId();
		if (!$client_id) {
			$this->client = false;
			return null;
		}
		
		$client = $this->fetchClient($client_id);
		if ($client) {
			$this->client = $client;
		}
		else {
			$this->client = false;
		}
		
		return $this->client ? $this->client : null;
	}