Cleans up an endpoint name by removing all whitespace (including internal
whitespace) as well as making the string lower case.

@param _endPointName
@return
484623
private String clean(final String _endPointName)
    {
        String localTo = _endPointName.trim();

        // strip all white space from within the name as some source
        // pass in a formatted phone number (e.g. 03 8320 8100)
        int tmp = localTo.indexOf(" "); //$NON-NLS-1$
        while (tmp != -1)
        {
            localTo = localTo.substring(0, tmp) + localTo.substring(tmp + 1, localTo.length());
            tmp = localTo.indexOf(" "); //$NON-NLS-1$
        }
        return localTo.toLowerCase();
    }
974378
private Endpoint getEndpoint(String serviceName) {
        Endpoint cachedEndpoint = endpointCache.get(serviceName);

        if (cachedEndpoint == null) {
            cachedEndpoint = computeEndpoint(serviceName);
            if (cachedEndpoint == null) {
                return null;
            }
        }

        endpointCache.put(serviceName, cachedEndpoint);
        return cachedEndpoint;
    }
1014855
def remove(self):
        
        LOGGER.debug("Endpoint.remove - " + self.id + " - " + self.url)
        if self.id is None:
            return None
        else:
            if self.id in EndpointService.local_cache_by_id:
                for search_params in EndpointService.local_cache_by_id[self.id]:
                    if search_params in EndpointService.local_cache_by_params.keys():
                        EndpointService.local_cache_by_params.pop(search_params)
                EndpointService.local_cache_by_id.pop(self.id)

            params = SessionService.complete_transactional_req({
                'ID': self.id
            })

            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params['OPERATION'] = 'deleteEndpoint'
                args = {'properties': params}
            else:
                args = {'http_operation': 'GET', 'operation_path': 'delete', 'parameters': params}

            response = EndpointService.requester.call(args)

            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                response = response.get()

            if response.rc != 0:
                LOGGER.warning(
                    'Endpoint.remove - Problem while deleting endpoint ' + str(self.id) +
                    'Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) +
                    " (" + str(response.rc) + ")"
                )
                if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                    raise ArianeMappingOverloadError("Endpoint.remove",
                                                     ArianeMappingOverloadError.ERROR_MSG)
                # traceback.print_stack()
                return self
            else:
                if self.parent_node is not None:
                    self.parent_node.sync()
                return None
1329938
public static String removeWhiteSpace(String s)
   {
      String retn = null;

      if (s != null)
      {
         int len = s.length();
         StringBuffer sbuf = new StringBuffer(len);

         for (int i = 0; i < len; i++)
         {
            char c = s.charAt(i);

            if (!Character.isWhitespace(c))
               sbuf.append(c);
         }
         retn = sbuf.toString();
      }
      return retn;
   }
1262207
func (s *CreateDevEndpointInput) SetEndpointName(v string) *CreateDevEndpointInput {
	s.EndpointName = &v
	return s
}
55640
private void purgeEndpoint(Endpoint endpoint, TestContext context) {
        if (log.isDebugEnabled()) {
            log.debug("Try to purge message endpoint " + endpoint.getName());
        }

        int messagesPurged = 0;
        Consumer messageConsumer = endpoint.createConsumer();
        Message message;
        do {
            try {
                String selector = MessageSelectorBuilder.build(messageSelector, messageSelectorMap, context);
                if (StringUtils.hasText(selector) && messageConsumer instanceof SelectiveConsumer) {
                    message = (receiveTimeout >= 0) ? ((SelectiveConsumer) messageConsumer).receive(selector, context, receiveTimeout) : ((SelectiveConsumer) messageConsumer).receive(selector, context);
                } else {
                    message = (receiveTimeout >= 0) ? messageConsumer.receive(context, receiveTimeout) : messageConsumer.receive(context);
                }
            } catch (ActionTimeoutException e) {
                if (log.isDebugEnabled()) {
                    log.debug("Stop purging due to timeout - " + e.getMessage());
                }
                break;
            }

            if (message != null) {
                log.debug("Removed message from endpoint " + endpoint.getName());
                messagesPurged++;

                try {
                    Thread.sleep(sleepTime);
                } catch (InterruptedException e) {
                    log.warn("Interrupted during wait", e);
                }
            }
        } while (message != null);

        if (log.isDebugEnabled()) {
            log.debug("Purged " + messagesPurged + " messages from endpoint");
        }
    }
1019185
private static String trimTrailingWhitespace(String string) {
        int end = 0;
        char c;

        for (int i = string.length() - 1; i >= 0; i--) {
            c = string.charAt(i);
            if (!Character.isWhitespace(c)) {
                end = i;
                break;
            }
        }

        if (end == 0) {
            return string;
        }

        return string.substring(0, end + 1);
    }
33441
func (s *DevEndpoint) SetEndpointName(v string) *DevEndpoint {
	s.EndpointName = &v
	return s
}
1227929
public String getEndpoint() {
    try {
      String endpointString = uri.getPath().split("/")[3];
      if (!endpointString.equals(ENDPOINT_IN) && !endpointString.equals(ENDPOINT_OUT)) {
        throw new IllegalArgumentException(endpointString + " is not a valid context endpoint");
      }
      return endpointString;
    } catch (IndexOutOfBoundsException e) {
      return null;
    }
  }
211096
func (s *DeleteEndpointInput) SetEndpointName(v string) *DeleteEndpointInput {
	s.EndpointName = &v
	return s
}
587042
public java.util.List<String> getBaseEndpointDnsNames() {
        if (baseEndpointDnsNames == null) {
            baseEndpointDnsNames = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return baseEndpointDnsNames;
    }
634788
protected Endpoint resolveEndpointName(String endpointName) {
        try {
            return beanFactory.getBean(endpointName, Endpoint.class);
        } catch (BeansException e) {
            throw new CitrusRuntimeException(String.format("Unable to resolve endpoint for name '%s'", endpointName), e);
        }
    }
349561
private void cleanupAdminObjectServiceInfo(NamedAdminObjectServiceInfo aosInfo) {
        if (aosInfo.serviceRef == null && aosInfo.endpointFactories.isEmpty()) {
            endpointActivationServices.remove(aosInfo.id);
        }
    }
917141
public static String sanitizeRefName(String refName) {
                if (refName.startsWith(REF_HEAD_PREFIX)) {
                        refName = refName.substring(REF_HEAD_PREFIX.length());
                }

                if (refName.startsWith(REF_TAG_PREFIX)) {
                        refName = refName.substring(REF_TAG_PREFIX.length());
                }

                return refName;
        }
703313
private Destination resolveDestinationName(String name, Session session) throws JMSException {
        if (endpointConfiguration.getDestinationResolver() != null) {
            return endpointConfiguration.getDestinationResolver().resolveDestinationName(session, name, endpointConfiguration.isPubSubDomain());
        }

        return new DynamicDestinationResolver().resolveDestinationName(session, name, endpointConfiguration.isPubSubDomain());
    }
384474
def get_endpoint(cls):
        
        if cls.endpoint is not None:
            return cls.endpoint
        s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', cls.__name__)
        return cls.sanitize_ep(
            re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower(),
            plural=True
        )
698194
private void registerEndpointMBean(String name, EndPointInfoImpl ep) {
        endpointMBeans.put(name, registerMBeanAsService(name, ep));
    }