If tokenService already has a domainPrefix set because the API consumer passed in a full URL
instead of a substitutable one ... then the replace acts as a no-op.

@param tokenService
@param domain_prefix
@returns {*|XML|string|void}
17659
function(tokenService, domainPrefix) {
  var tokenUrl = tokenService.replace(/\{DOMAIN_PREFIX\}/, domainPrefix);
  log.debug('token Url: '+ tokenUrl);
  return tokenUrl;
}
467874
public T namespace(String prefix, String namespaceUri) {
        getXpathVariableExtractor().getNamespaces().put(prefix, namespaceUri);
        xmlMessageValidationContext.getNamespaces().put(prefix, namespaceUri);
        return self;
    }
127526
public void convertAllPrefixesToDomains() {
        SurtPrefixSet iterCopy = (SurtPrefixSet) this.clone();
        Iterator<String> iter = iterCopy.iterator();
        while (iter.hasNext()) {
            String prefix = (String) iter.next();
            String convPrefix = convertPrefixToDomain(prefix);
            if(prefix!=convPrefix) {
            	// if returned value not unchanged, update set
            	this.remove(prefix);
            	this.add(convPrefix);
            }
        } 
    }
651867
@Override
    public void setPrefix(String prefix, String uri)
        throws XMLStreamException
    {
        if (prefix == null) {
            throw new NullPointerException("Can not pass null 'prefix' value");
        }
        // Are we actually trying to set the default namespace?
        if (prefix.length() == 0) {
            setDefaultNamespace(uri);
            return;
        }
        if (uri == null) {
            throw new NullPointerException("Can not pass null 'uri' value");
        }

        /* Let's verify that xml/xmlns are never (mis)declared; as
         * mandated by XML NS specification
         */
        {
            if (prefix.equals("xml")) {
                if (!uri.equals(XMLConstants.XML_NS_URI)) {
                    throwOutputError(ErrorConsts.ERR_NS_REDECL_XML, uri);
                }
            } else if (prefix.equals("xmlns")) { // prefix "xmlns"
                if (!uri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
                    throwOutputError(ErrorConsts.ERR_NS_REDECL_XMLNS, uri);
                }
                // At any rate; we are NOT to output it
                return;
            } else {
                // Neither of prefixes.. but how about URIs?
                if (uri.equals(XMLConstants.XML_NS_URI)) {
                    throwOutputError(ErrorConsts.ERR_NS_REDECL_XML_URI, prefix);
                } else if (uri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
                    throwOutputError(ErrorConsts.ERR_NS_REDECL_XMLNS_URI, prefix);
                }
            }
        }

        if (mSuggestedPrefixes == null) {
            mSuggestedPrefixes = new HashMap<String,String>(16);
        }
        mSuggestedPrefixes.put(uri, prefix);

    }
219932
public void setNamespaceURI(String prefix, String namespaceURI) {
    if (prefix == null)
      throw new IllegalArgumentException("Cannot bind null prefix");
    if (namespaceURI == null)
      throw new IllegalArgumentException("Cannot set prefix to null namespace URI");

    // no need to store
    if (XMLConstants.XML_NS_PREFIX.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(prefix))
      return;

    bindings.put(prefix, namespaceURI);
  }
335823
public static void delete(final BandwidthClient client, final String domainId, final String endpointId, final String token) throws AppPlatformException, ParseException, IOException {
        assert(client != null && domainId != null && endpointId != null && endpointId != null);
        deleteToken(client, domainId, endpointId, token);
    }
129790
def tokenizer(self):
        
        domain = 0
        if domain not in self.domains:
            self.register_domain(domain=domain)
        return self.domains[domain].tokenizer
144868
public static boolean hasSubPrefix(List<String> tokens) {
	return tokens.stream().anyMatch( token -> token.toLowerCase().startsWith( "sub" ));        
    }
188721
public TokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) {
    this.tokenServerUrl = tokenServerUrl;
    Preconditions.checkArgument(tokenServerUrl.getFragment() == null);
    return this;
  }
196841
private boolean isDomainExcludedFromProxy(String domainName) {
        if (domainName == null || domainName.isEmpty()) {
            return false;
        }

        for (DomainMatcher excludedDomain : proxyExcludedDomainsEnabled) {
            if (excludedDomain.matches(domainName)) {
                return true;
            }
        }
        return false;
    }
1028036
public static String getProtocolByToken(String token, boolean returnDefault) {
        if (StringUtils.isEmpty(token) && returnDefault) {
            return JaxWsConstants.SOAP11HTTP_BINDING;
        }

        if (JaxWsConstants.SOAP11_HTTP_TOKEN.equals(token)) {
            return JaxWsConstants.SOAP11HTTP_BINDING;
        } else if (JaxWsConstants.SOAP11_HTTP_MTOM_TOKEN.equals(token)) {
            return JaxWsConstants.SOAP11HTTP_MTOM_BINDING;
        } else if (JaxWsConstants.SOAP12_HTTP_TOKEN.equals(token)) {
            return JaxWsConstants.SOAP12HTTP_BINDING;
        } else if (JaxWsConstants.SOAP12_HTTP_MTOM_TOKEN.equals(token)) {
            return JaxWsConstants.SOAP12HTTP_MTOM_BINDING;
        } else if (JaxWsConstants.XML_HTTP_TOKEN.equals(token)) {
            return JaxWsConstants.HTTP_BINDING;
        } else {
            return token;
        }
    }
120831
protected T serviceUnder(String pathPrefix, Service<I, O> service) {
        return service(CompositeServiceEntry.ofPrefix(pathPrefix, service));
    }
167426
private void consumeNonExecutePrefix()
  {
    // fast forward through the leading whitespace
    nextNonWhitespace(true);
    pos--;

    if (pos + NON_EXECUTE_PREFIX.length > limit && !fillBuffer(NON_EXECUTE_PREFIX.length)) {
      return;
    }

    for (int i = 0; i < NON_EXECUTE_PREFIX.length; i++) {
      if (buffer[pos + i] != NON_EXECUTE_PREFIX[i]) {
        return; // not a security token!
      }
    }

    // we consumed a security token!
    pos += NON_EXECUTE_PREFIX.length;
  }
1352511
def DomainTokensCreate(self, domain_id, amount):
        
        if self.__SenseApiCall__('/domains/{0}/tokens.json'.format(domain_id), 'POST', parameters = {"amount":amount}):
            return True
        else:
            self.__error__ = "api call unsuccessful"
            return False
488257
def _reinsert_root_tag_prefix(v):
    
    if hasattr(v, 'original_prefix'):
        original_prefix = v.original_prefix
        del v.original_prefix
        v.tag = ''.join(('{', v.nsmap[original_prefix], '}VOEvent'))
    return
190083
@Override
  public String getNamespaceURI(String prefix)
  {
    if (prefix == null || !prefix.equals("dns"))
      throw new IllegalArgumentException("Accept only default namespace.");
    
    return "http://www.christofreichardt.de/java/tracer";
  }
838000
private function checkRestPrefixValidity(array $restPrefixes)
    {
        foreach ($restPrefixes as $prefix) {
            if (!is_string($prefix)) {
                throw new DomainException('All provided prefixes for REST must be string');
            }

            // if it has "/" in it
            if (strpos('/', $prefix)) {
                throw new DomainException('Prefixes must not contain "/"');
            }
        }
    }