Add a {@link Node} identified by its hostname.

@param hostname the hostname of the node.
@return the states of the node (most probably {@link LifecycleState#CONNECTED}).
322440
public Observable<LifecycleState> addNode(final NetworkAddress hostname, final NetworkAddress alternate) {
        Node node = nodeBy(hostname);
        if (node != null) {
            LOGGER.debug("Node {} already registered, skipping.", hostname);
            return Observable.just(node.state());
        }
        return addNode(new CouchbaseNode(hostname, ctx, alternate));
    }
1175655
public HostName toHostName() {
		HostName host = fromHost;
		if(host == null) {
			fromHost = host = toCanonicalHostName();
		}
		return host;
	}
863416
public void ensureNodeStateExists(@NonNull String nodeName) {
        if (!states.containsKey(nodeName))
            states.put(nodeName, new NodeState(nodeName));
    }
15098
def make_systeminfoitem_hostname(hostname, condition='contains', negate=False, preserve_case=False):
    
    document = 'SystemInfoItem'
    search = 'SystemInfoItem/hostname'
    content_type = 'string'
    content = hostname
    ii_node = ioc_api.make_indicatoritem_node(condition, document, search, content_type, content,
                                              negate=negate, preserve_case=preserve_case)
    return ii_node
1297802
private List<String> getDomainHostServers(ModelControllerClient mcc, String hostName) {
        return getChildrenNames(PathAddress.EMPTY_ADDRESS.append("host", hostName), "server", mcc);
    }
225333
public static UniAddress getByName( String hostname,
                                        boolean possibleNTDomainOrWorkgroup )
                                        throws UnknownHostException {
        UniAddress[] addrs = UniAddress.getAllByName(hostname, possibleNTDomainOrWorkgroup);
        return addrs[0];
    }
961095
public void addNode(String name, Set<ResourceType> resourceTypes) {
    List<FaultStatsForType> faultStats = new ArrayList<FaultStatsForType>(
        resourceTypes.size());
    for (ResourceType type : resourceTypes) {
      faultStats.add(new FaultStatsForType(type));
    }
    nodeToFaultStats.put(name, faultStats);
  }
273830
@Nonnull
  public CSP2SourceList addHost (@Nonnull @Nonempty final String sHost)
  {
    ValueEnforcer.notEmpty (sHost, "Host");
    m_aList.add (sHost);
    return this;
  }
1009875
public static InetAddress getInetAddress(String hostName) {
        try {
            return InetAddress.getByName(hostName);
        } catch (UnknownHostException e) {
            throw new IllegalStateException("Unknown host: " + e.getMessage() +
                    ". Make sure you have specified the 'GelfUDPAppender.remoteHost' property correctly in your logback.xml'");
        }
    }
681505
public static void setDefaultHostName(String hostName) {
        if (hostName == null || hostName.contains(":")) {
            return;
        }
        DEFAULT_BASE_URL = "http://" + hostName + ":" + DEFAULT_API_PORT + "/" + API_BASE + "/";
    }
1325532
public static final void nodeName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "nodeName", name);

        _nodeName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "nodeName");
    }
1272271
public int getPeerPort (String nodeName)
    {
        if (Objects.equal(_nodeName, nodeName)) {
            return _self.port;
        }
        PeerNode peer = _peers.get(nodeName);
        return (peer == null) ? -1 : peer.getPort();
    }
720284
public Node getNode(String name) {
    Node n = hostnameToNodeMap.get(name);

    // it's ok if multiple threads try to resolve the same host at the same time
    // the assumption is that resolve() will return a canonical node object and
    // the put operation is therefore idempotent
    if (n == null) {
      n = resolveAndGetNode(name);
      hostnameToNodeMap.put(name, n);
      // Make an entry for the node at the max level in the cache
      nodesAtMaxLevel.add(
        getParentNode(n, NetworkTopology.DEFAULT_HOST_LEVEL - 1));
    }

    return n;
  }
204264
public Set<ClusterNode.GrantId> deleteNode(String nodeName) {
    ClusterNode node = nameToNode.get(nodeName);
    if (node == null) {
      LOG.warn("Trying to delete non-existent node: " + nodeName);
      return null;
    }
    return deleteNode(node);
  }
1274740
public boolean isActive(@NonNull String nodeName) {
        ensureNodeStateExists(nodeName);

        return states.get(nodeName).isActive();
    }
284163
public static String expandHostNameVariable(String subjectDN, String nodeHostName) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "expandHostNameVariable", new Object[] { subjectDN, nodeHostName });

        String expandedSubjectDN = subjectDN;
        int index1 = subjectDN.indexOf("${hostname}");

        if (index1 != -1) {
            String firstPart = subjectDN.substring(0, index1);
            String lastPart = subjectDN.substring(index1 + "${hostname}".length());
            // String.substring always returns non-null
            if (!firstPart.equals("") && !lastPart.equals(""))
                expandedSubjectDN = firstPart + nodeHostName + lastPart;
            else if (!firstPart.equals(""))
                expandedSubjectDN = firstPart + nodeHostName;
            else if (!lastPart.equals(""))
                expandedSubjectDN = nodeHostName + lastPart;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "expandHostNameVariable -> " + expandedSubjectDN);
        return expandedSubjectDN;
    }
465918
public Set<String> getNodeSessions(String nodeName) {
    ClusterNode node = nameToNode.get(nodeName);
    if (node == null) {
      LOG.warn("Trying to get the sessions for a non-existent node " +
        nodeName);
      return new HashSet<String>();
    }
    synchronized (node) {
      return new HashSet<String>(hostsToSessions.get(node));
    }
  }