Creates the endpoint (RTP or WebRTC) and any other additional elements (if
needed).

@param endpointLatch
16439
protected void internalEndpointInitialization(final CountDownLatch endpointLatch) {
		if (this.isWeb()) {
			WebRtcEndpoint.Builder builder = new WebRtcEndpoint.Builder(pipeline);
			/*
			 * if (this.dataChannels) { builder.useDataChannels(); }
			 */
			builder.buildAsync(new Continuation<WebRtcEndpoint>() {
				@Override
				public void onSuccess(WebRtcEndpoint result) throws Exception {
					webEndpoint = result;

					webEndpoint.setMaxVideoRecvBandwidth(maxRecvKbps);
					webEndpoint.setMinVideoRecvBandwidth(minRecvKbps);
					webEndpoint.setMaxVideoSendBandwidth(maxSendKbps);
					webEndpoint.setMinVideoSendBandwidth(minSendKbps);

					endpointLatch.countDown();
					log.trace("EP {}: Created a new WebRtcEndpoint", endpointName);
					endpointSubscription = registerElemErrListener(webEndpoint);
				}

				@Override
				public void onError(Throwable cause) throws Exception {
					endpointLatch.countDown();
					log.error("EP {}: Failed to create a new WebRtcEndpoint", endpointName, cause);
				}
			});
		} else {
			new RtpEndpoint.Builder(pipeline).buildAsync(new Continuation<RtpEndpoint>() {
				@Override
				public void onSuccess(RtpEndpoint result) throws Exception {
					endpoint = result;
					endpointLatch.countDown();
					log.trace("EP {}: Created a new RtpEndpoint", endpointName);
					endpointSubscription = registerElemErrListener(endpoint);
				}

				@Override
				public void onError(Throwable cause) throws Exception {
					endpointLatch.countDown();
					log.error("EP {}: Failed to create a new RtpEndpoint", endpointName, cause);
				}
			});
		}
	}
1138813
def _make_endpoint(self, root_node, endpoint):
        # type: (ElementTree.Element, EndpointDescription) -> None
        
        endpoint_node = ElementTree.SubElement(
            root_node, TAG_ENDPOINT_DESCRIPTION
        )

        for name, value in endpoint.get_properties().items():
            # Compute value type
            vtype = self._get_type(name, value)

            # Prepare the property node
            prop_node = ElementTree.SubElement(
                endpoint_node, TAG_PROPERTY, {ATTR_NAME: name}
            )

            if vtype == XML_VALUE:
                # Special case, we have to store the value as a child
                # without a value-type attribute
                prop_node.append(value)
                continue

            # Set the value type
            prop_node.set(ATTR_VALUE_TYPE, vtype)

            # Compute value node or attribute
            if isinstance(value, tuple):
                # Array
                self._add_container(prop_node, TAG_ARRAY, value)

            elif isinstance(value, list):
                # List
                self._add_container(prop_node, TAG_ARRAY, value)

            elif isinstance(value, set):
                # Set
                self._add_container(prop_node, TAG_SET, value)

            elif isinstance(value, type(root_node)):
                # XML (direct addition)
                prop_node.append(value)

            else:
                # Simple value -> Attribute
                prop_node.set(ATTR_VALUE, str(value))
1212577
public Endpoint publishEndpoint(EndpointBuilder endpointBuilder) {
        checkArgument(endpointBuilder != null, "EndpointBuilder is null");
        return this.jaxwsEnvironment.publishEndpoint(endpointBuilder);
    }
1125938
public void createControlAdapter()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createControlAdapter");

    // The type of control adapter created depends on the type of destination
    // that we're working with
    if(!destinationHandler.isLink())
    {
      XmitPoint rqm =
        (XmitPoint) destinationHandler.getRemoteQueuePointControl(getLocalizingMEUuid(), true);
      controlAdapter = new XmitPointControl(rqm,
                                            this,                                        
                                            destinationHandler); 
    }
    else
    { 
      // Use the StreamSet's Control Adapter for the "link remote queue points"
      controlAdapter = 
        new LinkRemoteQueuePoint(destinationHandler, this);
    }                                          
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createControlAdapter", controlAdapter);
  }
733269
protected function createClient($endpoint, $config = [])
    {
        $ssl = $this->config['ssl'];
        $name = $this->config['ssl_name'];
        $verifySign = $this->config['ssl_verify_sign'];
        $verifyPeer = $this->config['ssl_verify_peer'];
        $verifyDepth = $this->config['ssl_verify_depth'];

        $context = [];
        $context['socket'] = [
            'connect' => $endpoint
        ];
        $context['ssl'] = [
            'capture_peer_cert' => true,
            'capture_peer_chain' => true,
            'capture_peer_cert_chain' => true,
            'allow_self_signed' => !$verifySign,
            'verify_peer' => $verifyPeer,
            'verify_peer_name' => $verifyPeer,
            'verify_depth' => $verifyDepth,
            'SNI_enabled' => $name !== '',
            'SNI_server_name' => $name,
            'peer_name' => $name,
            'disable_compression' => true,
            'honor_cipher_order' => true,
        ];

        if ($ssl && isset($config['ssl_cafile']))
        {
            $context['ssl']['cafile'] = $config['ssl_cafile'];
        }

        if ($ssl && isset($config['ssl_capath']))
        {
            $context['ssl']['capath'] = $config['ssl_capath'];
        }

        $context = stream_context_create($context);
        // Error reporting suppressed since stream_socket_client() emits an E_WARNING on failure.
        $socket = @stream_socket_client(
            $endpoint,
            $errno,
            $errstr,
            0, // Timeout does not apply for async connect.
            STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT,
            $context
        );

        if (!$socket || $errno > 0)
        {
            throw new LogicException(
                sprintf('Could not connect socket [%s] because of error [%d; %s]', $endpoint, $errno, $errstr)
            );
        }

        stream_set_blocking($socket, false);

        return $socket;
    }
60559
protected final void addEndpoint(Endpoint e) {
        final List<Endpoint> newEndpoints;
        endpointsLock.lock();
        try {
            List<Endpoint> newEndpointsUnsorted = Lists.newArrayList(endpoints);
            newEndpointsUnsorted.add(e);
            endpoints = newEndpoints = ImmutableList.sortedCopyOf(newEndpointsUnsorted);
        } finally {
            endpointsLock.unlock();
        }

        notifyListeners(newEndpoints);
        completeInitialEndpointsFuture(newEndpoints);
    }
1190477
public void registerEndpoint(RegisterEndpointRequest arg0) {
        String endpointURL = arg0.getEndpointURL();
        QName serviceName = QName.valueOf(arg0.getServiceName());
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Registering endpoint " + endpointURL + " for service "
                    + serviceName + "...");
        }
        try {
            initLocator();
            BindingType bindingType = arg0.getBinding() == null ? BindingType.OTHER : BindingType
                    .valueOf(arg0.getBinding().value());
            TransportType transportType = arg0.getTransport() == null ? TransportType.OTHER
                    : TransportType.valueOf(arg0.getTransport().value());
            SLPropertiesImpl slProps = null;
            if (!arg0.getEntryType().isEmpty()) {
                slProps = new SLPropertiesImpl();
                List<EntryType> entries = arg0.getEntryType();
                for (EntryType entry : entries) {
                    slProps.addProperty(entry.getKey(), entry.getValue());
                }
            }
            Endpoint simpleEndpoint =
                new SimpleEndpoint(serviceName, endpointURL, bindingType, transportType, slProps);
            locatorClient.register(simpleEndpoint, true);
        } catch (ServiceLocatorException e) {
            // throw new ServiceLocatorFault(e.getMessage(), e);
            throw new WebApplicationException(Response
                    .status(Status.INTERNAL_SERVER_ERROR)
                    .entity(e.getMessage()).build());
        } catch (InterruptedException e) {
            // throw new InterruptedExceptionFault(e.getMessage(), e);
            throw new WebApplicationException(Response
                    .status(Status.INTERNAL_SERVER_ERROR)
                    .entity(e.getMessage()).build());
        }
    }
95513
public static CompletableFuture<EndpointDescription[]> getEndpoints(String endpointUrl) {
        UaTcpStackClientConfig config = UaTcpStackClientConfig.builder()
                .setEndpointUrl(endpointUrl)
                .build();

        UaTcpStackClient client = new UaTcpStackClient(config);

        GetEndpointsRequest request = new GetEndpointsRequest(
                new RequestHeader(null, DateTime.now(), uint(1), uint(0), null, uint(5000), null),
                endpointUrl, null, new String[]{Stack.UA_TCP_BINARY_TRANSPORT_URI});

        return client.<GetEndpointsResponse>sendRequest(request)
                .whenComplete((r, ex) -> client.disconnect())
                .thenApply(GetEndpointsResponse::getEndpoints);
    }
605561
@Override
    public void setBaseUrl(String baseUrl){
        this.endpointUrl = Utils.trimEnd(baseUrl, '/');
        super.setBaseUrl(baseUrl);
    }
150483
def add_endpoint(self, ep):
        """"""
        assert ep.name not in self.endpoints, ep
        self.endpoints[ep.name] = ep
635448
public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
        
if ("AdGroupAdServiceInterfacePort".equals(portName)) {
            setAdGroupAdServiceInterfacePortEndpointAddress(address);
        }
        else 
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }
141364
@Override
	public void addEndpoint(T endpoint) {
		if (endpoints.length == 0) {
			endpoints = new Endpoint[1];
			endpoints[0] = endpoint;
		} else {
			for (int i = 0; i < endpoints.length; i++) {
				if (endpoints[i].equals(endpoints)) {

					// Already registered
					return;
				}
			}

			// Add to array
			Endpoint[] copy = new Endpoint[endpoints.length + 1];
			System.arraycopy(endpoints, 0, copy, 0, endpoints.length);
			copy[endpoints.length] = endpoint;
			endpoints = copy;
		}

		// Remove from cache
		endpointCache.remove(endpoint.getNodeID());
	}
430396
protected Vertx createVertx(VertxEndpointConfiguration endpointConfiguration) {
        final Vertx[] vertx = new Vertx[1];
        final Future loading = new FutureFactoryImpl().future();

        Handler<AsyncResult<Vertx>> asyncLoadingHandler = new Handler<AsyncResult<Vertx>>() {
            @Override
            public void handle(AsyncResult<Vertx> event) {
                vertx[0] = event.result();
                loading.complete();
                log.info("Vert.x instance started");
            }
        };

        if (endpointConfiguration.getPort() > 0) {
            if (log.isDebugEnabled()) {
                log.debug(String.format("Creating new Vert.x instance '%s:%s' ...", endpointConfiguration.getHost(), endpointConfiguration.getPort()));
            }
            VertxOptions vertxOptions = new VertxOptions();
            vertxOptions.setClusterPort(endpointConfiguration.getPort());
            vertxOptions.setClusterHost(endpointConfiguration.getHost());
            vertxFactory.clusteredVertx(vertxOptions, asyncLoadingHandler);
        } else {
            if (log.isDebugEnabled()) {
                log.debug(String.format("Creating new Vert.x instance '%s:%s' ...", endpointConfiguration.getHost(), 0L));
            }
            VertxOptions vertxOptions = new VertxOptions();
            vertxOptions.setClusterPort(0);
            vertxOptions.setClusterHost(endpointConfiguration.getHost());
            vertxFactory.clusteredVertx(vertxOptions, asyncLoadingHandler);
        }

        // Wait for full loading
        while (!loading.isComplete()) {
            try {
                log.debug("Waiting for Vert.x instance to startup");
                Thread.sleep(250L);
            } catch (InterruptedException e) {
                log.warn("Interrupted while waiting for Vert.x instance startup", e);
            }
        }

        return vertx[0];
    }
45668
void configureEndpoints(Reflections reflections) {

        // [Re]initialise the api:
        api = new HashMap<>();

        log.info("Scanning for endpoint classes..");
        Set<Class<?>> endpoints = reflections.getTypesAnnotatedWith(Api.class);
        // log.info(reflections.getConfiguration().getUrls());

        log.info("Found {} endpoint classes.", endpoints.size());
        log.info("Examining endpoint class methods:");

        // Configure the classes:
        for (Class<?> endpointClass : endpoints) {

            Route route = getEndpoint(endpointClass);
            route.endpointClass = endpointClass;

            for (Method method : endpointClass.getMethods()) {

                // Skip Object methods
                if (method.getDeclaringClass() == Object.class) {
                    continue;
                }

                // Find public methods:
                if (Modifier.isPublic(method.getModifiers())) {

                    // Which HTTP method(s) will this method respond to?
                    annotation:
                    for (Annotation annotation : method.getAnnotations()) {
                        HttpMethod httpMethod = HttpMethod.method(annotation);
                        if (httpMethod != null) {
                            log.info("Http method: {}", httpMethod);

                            RequestHandler requestHandler = new RequestHandler();
                            requestHandler.handlerMethod = method;
                            log.info("Java method: {}", method.getName());

                            // Look for an optional Json message type parameter:
                            for (Class<?> parameterType : method.getParameterTypes()) {
                                if (!HttpServletRequest.class.isAssignableFrom(parameterType)
                                        && !HttpServletResponse.class.isAssignableFrom(parameterType)) {
                                    if (requestHandler.requestMessageType != null) {
                                        log.error("Too many parameters on {} method {}. " +
                                                        "Message type already set to {} but also found a {} parameter.",
                                                httpMethod, method.getName(),
                                                requestHandler.requestMessageType.getSimpleName(), parameterType.getSimpleName());
                                        break annotation;
                                    }
                                    requestHandler.requestMessageType = parameterType;
                                    log.info("request Json: {}", requestHandler.requestMessageType.getSimpleName());
                                }
                            }

                            // Check the response Json message type:
                            if (method.getReturnType() != void.class) {
                                requestHandler.responseMessageType = method.getReturnType();
                                log.info("Response Json: {}", requestHandler.responseMessageType.getSimpleName());
                            }

                            route.requestHandlers.put(httpMethod, requestHandler);

                        }
                    }
                }
            }
        }

    }
1284350
private void setUrlParserFromEndpoints(List<String> endpoints, int port) {
    List<HostAddress> addresses = new ArrayList<>();
    for (String endpoint : endpoints) {
      HostAddress newHostAddress = new HostAddress(endpoint, port, null);
      addresses.add(newHostAddress);
    }

    synchronized (urlParser) {
      urlParser.setHostAddresses(addresses);
    }
  }
1062517
@Override
    public void createInputHandlersForPtoP()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createInputHandlersForPtoP", this);
        //Create a point to point input handler
        _baseDestinationHandler.
                        setInputHandler(new PtoPInputHandler(_baseDestinationHandler,
                                        _remoteSupport.getTargetProtocolItemStream()));

        //TODO is this a good idea?
        //We don't yet know what type of InputHandler to create

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createInputHandlersForPtoP");
    }
608672
public static ProtocolNegotiator serverTls(final SslContext sslContext) {
    Preconditions.checkNotNull(sslContext, "sslContext");
    return new ProtocolNegotiator() {
      @Override
      public ChannelHandler newHandler(GrpcHttp2ConnectionHandler handler) {
        return new ServerTlsHandler(sslContext, handler);
      }

      @Override
      public void close() {}


      @Override
      public AsciiString scheme() {
        return Utils.HTTPS;
      }
    };
  }