Change endpoint

@param endpoint endpoint to change to, null for reset to default
@throws ConnectionEndpointArray.UnknownSchemeException
342719
public void changeEndpoint(String endpoint) throws ConnectionEndpointArray.UnknownSchemeException {
        if (endpoint != null && !endpoint.isEmpty()) {
            modules.getApiModule().changeEndpoint(endpoint);
        } else {
            modules.getApiModule().resetToDefaultEndpoints();
        }
    }
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);

                        }
                    }
                }
            }
        }

    }
941498
public function addEndpoint($endpoint) 
    {
        if (!is_string($endpoint) || !Endpoint::isValid($endpoint)) {
            throw new ClientException(sprintf("invalid endpoint specification '%s'", $endpoint));
        }
        $endpoint = Endpoint::normalize($endpoint);
        $normalized = Endpoint::normalizeHostname($endpoint);

        assert(is_array($this->_values[self::OPTION_ENDPOINT]));
        $found = false;
        foreach ($this->_values[self::OPTION_ENDPOINT] as $key => $value) {
            if ($normalized === Endpoint::normalizeHostname($value)) {
                $this->_currentEndpointIndex = $key;
                $found = true;
                break;
            }
        }
        
        if ($found === false) {
            // a new endpoint we have not seen before
            $this->_values[self::OPTION_ENDPOINT][] = $endpoint;
            $this->_currentEndpointIndex = count($this->_values[self::OPTION_ENDPOINT]) - 1;
        }

        $this->storeOptionsInCache();
    }
239206
public void addMovingEndpoint(Token token, InetAddress endpoint)
    {
        assert endpoint != null;

        lock.writeLock().lock();

        try
        {
            movingEndpoints.add(Pair.create(token, endpoint));
        }
        finally
        {
            lock.writeLock().unlock();
        }
    }
951571
def reset
      self.apikey = DEFAULT_APIKEY
      self.endpoint = DEFAULT_ENDPOINT
      self.sandbox_endpoint = DEFAULT_SANDBOX_ENDPOINT
      self.sandbox_enabled = DEFAULT_SANDBOX_ENABLED
      self.fmt = DEFAULT_FMT
    end
546054
protected final void removeEndpoint(Endpoint e) {
        final List<Endpoint> newEndpoints;
        endpointsLock.lock();
        try {
            endpoints = newEndpoints = endpoints.stream()
                                                .filter(endpoint -> !endpoint.equals(e))
                                                .collect(toImmutableList());
        } finally {
            endpointsLock.unlock();
        }
        notifyListeners(newEndpoints);
    }
934031
public Response delete(String endpoint) {
        return call(Method.DELETE, endpoint, null, null);
    }
567831
func (s *Subscription) SetEndpoint(v string) *Subscription {
	s.Endpoint = &v
	return s
}
262376
public void endpointActivation(MessageEndpointFactory endpointFactory,
      ActivationSpec spec) throws ResourceException {
    VertxActivation activation = new VertxActivation(this, endpointFactory,
        (VertxActivationSpec) spec);
    activations.put((VertxActivationSpec) spec, activation);
    activation.start();

    log.finest("endpointActivation()");

  }
586979
private void loadEndpointParserProperties() {
        try {
            endpointParserProperties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("com/consol/citrus/endpoint/endpoint.parser"));
        } catch (IOException e) {
            log.warn("Unable to laod default endpoint annotation parsers from resource '%s'", e);
        }
    }
816418
func (c *Client) SetEndpoint(endpoint string) {
	c.configuration.endpoint = endpoint
	c.Transport.SetEndpoint(endpoint)
}
766992
@Override
  public void setEndpointAddress(BindingProvider soapClient, String endpointAddress) {
    soapClient.getRequestContext().put(
        BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
  }
1059663
@Nonnull
  public FineUploader5DeleteFile setEndpoint (@Nonnull final ISimpleURL aEndpoint)
  {
    ValueEnforcer.notNull (aEndpoint, "Endpoint");
    m_aDeleteFileEndpoint = aEndpoint;
    return this;
  }
880161
func (s *DBInstance) SetEndpoint(v *Endpoint) *DBInstance {
	s.Endpoint = v
	return s
}
899200
public void replacePushConfig(String subscriptionId, String endpoint) throws Exception {
    // [START pubsub_update_push_configuration]
    try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
      ProjectSubscriptionName subscriptionName =
          ProjectSubscriptionName.of(projectId, subscriptionId);
      PushConfig pushConfig = PushConfig.newBuilder().setPushEndpoint(endpoint).build();
      subscriptionAdminClient.modifyPushConfig(subscriptionName, pushConfig);
    }
    // [END pubsub_update_push_configuration]
  }
830780
function setProviderFromEndpoint (endpoint, context, cb) {
    var oldProvider = web3.currentProvider

    if (endpoint === 'ipc') {
      web3.setProvider(new web3.providers.IpcProvider())
    } else {
      web3.setProvider(new web3.providers.HttpProvider(endpoint))
    }
    if (web3.isConnected()) {
      executionContext = context
      self._updateBlockGasLimit()
      self.event.trigger('contextChanged', ['web3'])
      self.event.trigger('web3EndpointChanged')
      cb()
    } else {
      web3.setProvider(oldProvider)
      var alertMsg = 'Not possible to connect to the Web3 provider. '
      alertMsg += 'Make sure the provider is running and a connection is open (via IPC or RPC).'
      cb(alertMsg)
    }
  }
1105304
func NewEndpointFromChangeModel(base *models.EndpointChangeRequest) (*Endpoint, error) {
	if base == nil {
		return nil, nil
	}

	ep := &Endpoint{
		ID:               uint16(base.ID),
		ContainerName:    base.ContainerName,
		ContainerID:      base.ContainerID,
		DockerNetworkID:  base.DockerNetworkID,
		DockerEndpointID: base.DockerEndpointID,
		IfName:           base.InterfaceName,
		K8sPodName:       base.K8sPodName,
		K8sNamespace:     base.K8sNamespace,
		DatapathMapID:    int(base.DatapathMapID),
		IfIndex:          int(base.InterfaceIndex),
		OpLabels:         pkgLabels.NewOpLabels(),
		DNSHistory:       fqdn.NewDNSCacheWithLimit(option.Config.ToFQDNsMinTTL, option.Config.ToFQDNsMaxIPsPerHost),
		state:            "",
		Status:           NewEndpointStatus(),
		hasBPFProgram:    make(chan struct{}, 0),
		desiredPolicy:    policy.NewEndpointPolicy(),
		realizedPolicy:   policy.NewEndpointPolicy(),
		controllers:      controller.NewManager(),
	}

	if base.Mac != "" {
		m, err := mac.ParseMAC(base.Mac)
		if err != nil {
			return nil, err
		}
		ep.LXCMAC = m
	}

	if base.HostMac != "" {
		m, err := mac.ParseMAC(base.HostMac)
		if err != nil {
			return nil, err
		}
		ep.NodeMAC = m
	}

	if base.Addressing != nil {
		if ip := base.Addressing.IPV6; ip != "" {
			ip6, err := addressing.NewCiliumIPv6(ip)
			if err != nil {
				return nil, err
			}
			ep.IPv6 = ip6
		}

		if ip := base.Addressing.IPV4; ip != "" {
			ip4, err := addressing.NewCiliumIPv4(ip)
			if err != nil {
				return nil, err
			}
			ep.IPv4 = ip4
		}
	}

	ep.SetDefaultOpts(option.Config.Opts)

	ep.UpdateLogger(nil)
	ep.SetStateLocked(string(base.State), "Endpoint creation")

	return ep, nil
}