Generates a new client id which is not present in the current set of ids
for the clients which are subscribed to this server.

@return A newly generated client id
354014
private long getNewClientId() {
    while (true) {
      long clientId = Math.abs(clientIdsGenerator.nextLong());
      if (!clientsData.containsKey(clientId)) {
        return clientId;
      }
    }
  }
566837
public String getSubscriberID()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "getSubscriberID");
            SibTr.exit(this, tc, "getSubscriberID", subscriptionID);
        }

        return subscriptionID;
    }
336322
public int getStartingID()
    {
        if (this.getTable() != null)
            if (this.getTable().getDatabase() != null)
                return this.getTable().getDatabase().getStartingID();
        return super.getStartingID();   // Never (default)
    }
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);
        }

    }
368839
@Override
	public String getUniqueId() {
		final String sourceMethod = "getUniqueId"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(AggregatorExtension.class.getName(), sourceMethod);
			log.exiting(AggregatorExtension.class.getName(), sourceMethod, uniqueId);
		}
		return uniqueId;
	}
448108
@Bean
	public SubscribableChannel clientInboundChannel() {
		ExecutorSubscribableChannel executorSubscribableChannel = new ExecutorSubscribableChannel(
				clientInboundChannelExecutor());
		configureClientInboundChannel(executorSubscribableChannel);
		return executorSubscribableChannel;
	}
879241
public Client getClient(int clientId) throws Exception {
        Client client = null;

        PreparedStatement statement = null;
        ResultSet results = null;
        try (Connection sqlConnection = sqlService.getConnection()) {
            String queryString = "SELECT * FROM " + Constants.DB_TABLE_CLIENT +
                " WHERE " + Constants.GENERIC_ID + " = ?";

            statement = sqlConnection.prepareStatement(queryString);
            statement.setInt(1, clientId);

            results = statement.executeQuery();
            if (results.next()) {
                client = this.getClientFromResultSet(results);
            }
        } catch (Exception e) {
            throw e;
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }

        return client;
    }
163231
public Id<Attributes<T>> getOrCreateId()
   {
      List<Node> nodeList = childNode.get("id");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new IdImpl<Attributes<T>>(this, "id", childNode, nodeList.get(0));
      }
      return createId();
   }
1362106
public ClientList<Client> getClientList() {
        ClientList<Client> list = new ClientList<Client>();
        for (IClient c : clients.values()) {
            list.add((Client) c);
        }
        return list;
    }
183125
private Optional<T> getServerIdToTry() {
        if (m_serverIdsToTry.isEmpty()) {
            final Collection<T> moreCandidates = getMoreCandidates();

            if (moreCandidates.isEmpty()) {
                // We were unable to find more candidates. To avoid hammering
                // the service that provides potential candidates, flag that we
                // should sleep for a little while before trying again to get
                // more potential candidates.
                m_sleepBeforeTryingToGetMoreCandidates = true;

                return (new NoneImpl<T>());
            } else {
                // We successfully retrieved more candidates. We clear the
                // flag that prevented requesting more potential candidates,
                // since all is well. Since we have candidates with which to
                // work, we probably will not be hitting the service that
                // provides potential candidates any time soon.
                m_sleepBeforeTryingToGetMoreCandidates = false;

                m_serverIdsToTry.addAll(moreCandidates);

                return (new SomeImpl<T>(m_serverIdsToTry.remove(0)));
            }
        } else {
            // We already have servers to try. Try one of them.
            return (new SomeImpl<T>(m_serverIdsToTry.remove(0)));
        }
    }
1116776
public static int generateViewId(){
        for (;;) {
            final int result = nextGeneratedViewId.get();
            // aapt-generated IDs have the high byte nonzero; clamp to the range under that.
            int newValue = result + 1;
            if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.
            if (nextGeneratedViewId.compareAndSet(result, newValue)) {
                return result;
            }
        }
    }
1289481
public static String getClientId(Connection connection) {
        String clientId = null;
        
        try {
            clientId = connection == null ? null : connection.getClientID();
        } catch (JMSException e) {}
        
        return clientId;
    }
807959
private Client getClient(){
        final ClientConfig cfg = new DefaultClientConfig();
        cfg.getClasses().add(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider.class);
        cfg.getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, timeout);

        return Client.create(cfg);
    }
1259566
public String[] getRegisteredIDs(RESTRequest request,
                                     int clientID,
                                     String source_objName,
                                     String listener_objName) {
        //Get the client area
        ClientNotificationArea clientArea = getInboxIfAvailable(clientID, null);

        List<ServerNotification> registrations = clientArea.getServerRegistrations(request, source_objName);

        if (registrations != null) {
            List<String> ids = new ArrayList<String>();

            //loop registrations to match request
            for (ServerNotification registration : registrations) {
                if (registration.listener.getCanonicalName().equals(listener_objName)) {
                    //found a matching registration, so add ID to list
                    ids.add(registration.filter + "_" + registration.handback);
                }
            }

            return ids.toArray(new String[ids.size()]);
        }

        return null;
    }
1290252
public static AmazonDynamoDB getClient() {
		if (ddbClient != null) {
			return ddbClient;
		}

		if (Config.IN_PRODUCTION) {
			ddbClient = AmazonDynamoDBClientBuilder.standard().build();
		} else {
			ddbClient = AmazonDynamoDBClientBuilder.standard().
					withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("local", "null"))).
					withEndpointConfiguration(new EndpointConfiguration(LOCAL_ENDPOINT, "")).build();
		}

		if (!existsTable(Config.getRootAppIdentifier())) {
			createTable(Config.getRootAppIdentifier());
		}

		ddb = new DynamoDB(ddbClient);

		Para.addDestroyListener(new DestroyListener() {
			public void onDestroy() {
				shutdownClient();
			}
		});

		return ddbClient;
	}
395336
private String _getIdFromClientId(String clientId)
  {
    final char separator = getFacesContext().getNamingContainerSeparatorChar();
    int lastIndex = clientId.lastIndexOf(separator);

    String id = null;

    if (lastIndex < 0)
    {
      id = clientId;
    }
    else if (lastIndex < (clientId.length() - 1))
    {
      id = clientId.substring(lastIndex + 1);              
    }
    //else
    //{
      // TODO log warning for trailing colon case
    //}
 
    return id;
  }
222
public Client build() {
    validate();
    Client client = new Client(database, credentials, host, scheme);
    return client;
  }