Returns a server identifier to try.

@return A server identifier to try. If we are unable to come up with any
candidates, a <code>None</code> object is returned.
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)));
        }
    }
527598
protected Integer getUserId() {
        Integer userId = ThreadContext.getContext(UserWebConstant.CTX_USERID);
        if (userId != null) {
            return userId;
        }
        return null;
    }
749702
public Type getType()
    {
        Type ret = null;
        try {
            if (this.uuid != null) {
                ret = Type.get(this.uuid);
            }
        } catch (final CacheReloadException e) {
            Instance.LOG.error("Could not load Type for UUID: {}", this.uuid);
        }
        return ret;
    }
320074
@Nonnull
	public String getNodeId(final InetSocketAddress socketAddress) throws IllegalArgumentException {
		if ( socketAddress == null ) {
			throw new IllegalArgumentException("SocketAddress must not be null.");
		}
		final String result = _address2Ids.get( socketAddress );
		if ( result == null ) {
			throw new IllegalArgumentException("SocketAddress " + socketAddress + " not known (registered addresses: " + _address2Ids.keySet() + ").");
		}
		return result;
	}
1291847
public String serverName() {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "serverName", new Object[] { this, _serverName });
        return _serverName;
    }
853999
@JsonIgnore
	public String getUsername() {
		if (App.isRoot(user.getAppid())) {
			return user.getIdentifier();
		} else {
			return user.getAppid() + "/" + user.getIdentifier();
		}
	}
640540
private synchronized int getNewClientID() {
        if ((clientIDGenerator + 1) >= Integer.MAX_VALUE) {
            //if we can't find a reusable ID within the first 100 slots, then fail.
            //Revisit: I don't want to loop through all 2+ billion entries to find that they are all taken, as this
            //could be seem as a DoS, but maybe some better heuristics for finding an empty ID? not sure if we will ever be
            //in this situation...
            final int limit = Integer.MIN_VALUE + 100;
            for (int i = Integer.MIN_VALUE; i < limit; i++) {
                if (inboxes.get(i) == null) {
                    return i;
                }
            }

            //Emit the warning
            Tr.warning(tc, "jmx.connector.server.rest.notification.limit.warning");

            throw ErrorHelper.createRESTHandlerJsonException(new RuntimeException("The server has reached its limit of new client notifications."),
                                                             JSONConverter.getConverter(),
                                                             APIConstants.STATUS_SERVICE_UNAVAILABLE);
        }

        return clientIDGenerator++;
    }
1265130
@SuppressWarnings("WeakerAccess")
  public String getId() {
    // Constructor ensures that name is not null
    ClusterName fullName =
        Verify.verifyNotNull(ClusterName.parse(stateProto.getName()), "Name can never be null");
    //noinspection ConstantConditions
    return fullName.getCluster();
  }
1123739
@Override
  public Identifier getNewInstance(final String str) {

    final int index = str.indexOf("://");
    if (index < 0) {
      throw new RemoteRuntimeException("Invalid remote identifier name: " + str);
    }

    final String type = str.substring(0, index);
    final Class<? extends Identifier> clazz = typeToClazzMap.get(type);

    try {

      final Constructor<? extends Identifier> constructor = clazz.getDeclaredConstructor(CONSTRUCTOR_ARG_TYPES);
      final Object[] args = new Object[] {str.substring(index + 3)};

      final Identifier instance = constructor.newInstance(args);
      LOG.log(Level.FINER, "Created new identifier: {0} for {1}", new Object[] {instance, str});
      return instance;

    } catch (final NoSuchMethodException | SecurityException | InstantiationException
        | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      LOG.log(Level.SEVERE, "Cannot create new identifier for: " + str, e);
      throw new RemoteRuntimeException(e);
    }
  }
251386
@Override
	public String getId() {
		StringBuilder strId = new StringBuilder();
		strId.append(id);
		if (nextProcessor != null) {
			strId.append(",").append(nextProcessor.getId());
		}
		return strId.toString();
	}
1330173
public String getId()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getId");

    SIBUuid12 streamID = _streamSet.getStreamID();
    String streamIDStr = (streamID != null) ? streamID.toString() : STREAM_SET_UNINITIALISED_STRING;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getId", streamIDStr);
    return streamIDStr;
  }
121700
public static MBeanServer getJolokiaMBeanServer() {
        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        MBeanServer jolokiaMBeanServer;
        try {
            jolokiaMBeanServer =
                    (MBeanServer) server.getAttribute(createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_NAME),
                                                      JOLOKIA_MBEAN_SERVER_ATTRIBUTE);
        } catch (InstanceNotFoundException exp) {
            // should be probably locked, but for simplicity reasons and because
            // the probability of a clash is fairly low (can happen only once), it's omitted
            // here. Note, that server.getAttribute() itself is threadsafe.
            jolokiaMBeanServer = registerJolokiaMBeanServerHolderMBean(server);
        } catch (JMException e) {
            throw new IllegalStateException("Internal: Cannot get JolokiaMBean server via JMX lookup: " + e,e);
        }
        return jolokiaMBeanServer;
    }
784799
public String getServerName()
    {
        String host=_listener.getHost();
        if (InetAddrPort.__0_0_0_0.equals(host) &&
            _connection instanceof Socket)
            host = ((Socket)_connection).getLocalAddress().getHostName();
        
        return host;
    }
340837
public String getId() {
        if (id == null) {
            if (isValid()) {
                id = getProperty(ResourceUtil.PROP_UUID);
            }
            if (StringUtils.isBlank(id)) {
                id = Base64.encodeBase64String(getPath().getBytes(MappingRules.CHARSET));
            }
        }
        return id;
    }
884185
public static String getMBeanServerId(final MBeanServer aMBeanServer) {
        String serverId = null;
        final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate";
        final String MBEAN_SERVER_ID_KEY = "MBeanServerId";
        try {
            ObjectName delegateObjName = new ObjectName(SERVER_DELEGATE);
            serverId = (String) aMBeanServer.getAttribute(delegateObjName,
                    MBEAN_SERVER_ID_KEY);
        } catch (MalformedObjectNameException malformedObjectNameException) {
            //System.err.println("Problems constructing MBean ObjectName: " + malformedObjectNameException.getMessage());
        } catch (AttributeNotFoundException noMatchingAttrException) {
            //System.err.println("Unable to find attribute " + MBEAN_SERVER_ID_KEY + " in MBean " + SERVER_DELEGATE + ": " + noMatchingAttrException);
        } catch (MBeanException mBeanException) {
            //System.err.println("Exception thrown by MBean's (" + SERVER_DELEGATE + "'s " + MBEAN_SERVER_ID_KEY + ") getter: " + mBeanException.getMessage());
        } catch (ReflectionException reflectionException) {
            //System.err.println("Exception thrown by MBean's (" + SERVER_DELEGATE + "'s " + MBEAN_SERVER_ID_KEY + ") setter: " + reflectionException.getMessage());
        } catch (InstanceNotFoundException noMBeanInstance) {
            //System.err.println("No instance of MBean " + SERVER_DELEGATE + " found in MBeanServer: " + noMBeanInstance.getMessage());
        }
        return serverId;
    }
1153999
public java.util.List<String> getIdentities() {
        if (identities == null) {
            identities = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return identities;
    }
457098
public String getId() {

    String id = this.argument.id();
    if ((id == null) || (id.length() == 0)) {
      id = this.argument.name();
    }
    return id;
  }