Simple log helper to give logs a common prefix.

@param chan the address.
@param endpoint the endpoint.
@return a prefix string for logs.
192238
protected static RedactableArgument logIdent(final Channel chan, final Endpoint endpoint) {
        String addr = chan != null ? chan.remoteAddress().toString() : endpoint.remoteAddress();
        return system("[" + addr + "][" + endpoint.getClass().getSimpleName() + "]: ");
    }
539016
private static String getHost(final String endpoint) {
        String host = URI.create(endpoint).getHost();
        if (host == null) {
            host = URI.create("http://" + endpoint).getHost();
        }
        return host;
    }
1031413
private String getDestinationName(Endpoint endpoint) {
        int start = endpoint.getName().lastIndexOf('/') + 1;
        return endpoint.getName().substring(start);
    }
503173
public Header[] head(String endpoint, String params) throws IOException {
        return this.head(endpoint, params, "");
    }
518100
public static Predicate<HttpServerRequest> prefix(String prefix, HttpMethod method) {
		Objects.requireNonNull(prefix, "Prefix must be provided");

		String target = prefix.startsWith("/") ? prefix : "/".concat(prefix);
		//target = target.endsWith("/") ? target :  prefix.concat("/");
		return new HttpPrefixPredicate(target, method);
	}
149987
private static function generateEndPointPath($endpoint, $sdkId)
    {
        // Prepare message to sign
        $nonce = self::generateNonce();
        $timestamp = round(microtime(true) * 1000);

        return "{$endpoint}?nonce={$nonce}&timestamp={$timestamp}&appId={$sdkId}";
    }
1155851
private void resolveRequestEndpoint(Request<?> request, String bucketName, String key, URI endpoint) {
        ServiceEndpointBuilder builder = getBuilder(endpoint, endpoint.getScheme(), false);
        buildEndpointResolver(builder, bucketName, key).resolveRequestEndpoint(request);
    }
1062215
protected static RedactableArgument logIdent(final ChannelHandlerContext ctx, final Endpoint endpoint) {
        return system("[" + ctx.channel().remoteAddress() + "][" + endpoint.getClass().getSimpleName() + "]: ");
    }
731086
private String determineAnnotatedEndpointPath(Class<?> endpointClass) {
        if (endpointClass.isAnnotationPresent(ServerEndpoint.class)) {
            return endpointClass.getAnnotation(ServerEndpoint.class).value();
        } else {
            throw new IllegalArgumentException(String.format("@ServerEndpoint annotation not found on Websocket-class: '%s'. Either annotate the class or register it as a programmatic endpoint using ServerEndpointConfig.class", endpointClass));
        }
    }
122830
private static EndPointInfo defineEndPoint(EndPointMgr epm, String name, String[] config) {
        String host = null;
        String port = null;
        for (int i = 0; i < config.length; i++) {
            String key = ChannelUtils.extractKey(config[i]);
            if ("host".equalsIgnoreCase(key)) {
                host = ChannelUtils.extractValue(config[i]);
            } else if ("port".equalsIgnoreCase(key)) {
                port = ChannelUtils.extractValue(config[i]);
            }
        }
        return epm.defineEndPoint(name, host, Integer.parseInt(port));
    }
519399
private static TraceServiceGrpc.TraceServiceStub getTraceServiceStub(
      String endPoint, Boolean useInsecure, SslContext sslContext) {
    ManagedChannelBuilder<?> channelBuilder;
    if (useInsecure) {
      channelBuilder = ManagedChannelBuilder.forTarget(endPoint).usePlaintext();
    } else {
      channelBuilder =
          NettyChannelBuilder.forTarget(endPoint)
              .negotiationType(NegotiationType.TLS)
              .sslContext(sslContext);
    }
    ManagedChannel channel = channelBuilder.build();
    return TraceServiceGrpc.newStub(channel);
  }
295322
public void putreq_vheader(String endmark)
    throws SoccomException
    {
    if (endmark.length()!=4)
        throw new SoccomException(SoccomException.ENDM_LENGTH);
    byte msgbytes[] = SoccomMessage.
        makeMessageSpecial("ENDM" + endmark, null);
    logline("SEND: " + new String(msgbytes));
    copy_msgid(_msgid, msgbytes);
    try {
        _out.write(msgbytes);
    } catch (IOException e) {
        throw new SoccomException(SoccomException.REQUEST);
    }
    }
300429
public BusCommandContext newCommandContext(Endpoint endpoint) {
        return new BusCommandContext(endpoint, connectionFactoryProvider.getConnectionFactory(),
                wsEndpoints.getUiClientSessions(), wsEndpoints.getFeedSessions());
    }
1159202
private URI addEndPoint(String endPoint) throws URISyntaxException {

        if (StringUtils.isEmpty(endPoint) || endPoint.equals("/")) {
            return this.baseUri;
        }

        if (this.baseUri.getPath().endsWith("/") || endPoint.startsWith("/")) {
            endPoint = this.baseUri.getPath() + endPoint;
        } else {
            endPoint = this.baseUri.getPath() + "/" + endPoint;
        }

        URI uri = null;

        URIBuilder builder = new URIBuilder();

        builder.setScheme(this.baseUri.getScheme());
        builder.setHost(this.baseUri.getHost());
        builder.setPort(this.baseUri.getPort());
        builder.setPath(endPoint);

        uri = builder.build();
        return uri;
    }
810938
private void validateEndpoint(String endpoint) {
        try {
            new URL(endpoint);
        } catch (MalformedURLException e) {
            throw new InvalidParameterException(Messages.i18n.format("OrganizationResourceImpl.InvalidEndpointURL")); //$NON-NLS-1$
        }
    }
1327177
public ResourceName withEndpoint(String endpoint) {
    return new ResourceName(template, values, Preconditions.checkNotNull(endpoint));
  }
1119357
@VisibleForTesting
    static String makeEndPointPath(ServiceEndPoint endPoint) {
        String servicePath = makeServicePath(endPoint.getServiceName());
        String id = endPoint.getId();
        return ZKPaths.makePath(servicePath, id);
    }