Translate an ID into it's domain

i.e. myid1234@myapp.att.com results in domain of com.att.myapp

@param id
@return
483947
public static String domain2ns(String id) {
		int at = id.indexOf('@');
		if (at >= 0) {
			String[] domain = id.substring(at + 1).split("\\.");
			StringBuilder ns = new StringBuilder(id.length());
			boolean first = true;
			for (int i = domain.length - 1; i >= 0; --i) {
				if (first) {
					first = false;
				} else {
					ns.append('.');
				}
				ns.append(domain[i]);
			}
			return ns.toString();
		} else {
			return "";
		}

	}
1111807
public String formatId(long id) {
		long[] arr = parseId(id);
		String tmf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date(arr[0]));
		return String.format("%s, #%d, @(%d,%d)", tmf, arr[3], arr[1], arr[2]);
	}
1142278
@Override
  public InetSocketAddress lookup(final Identifier id) {
    LOG.log(Level.FINE, "id: {0}", id);
    return idToAddrMap.get(id);
  }
178321
private AuthenticationService getAuthenticationService(String id) {
        AuthenticationService service = authentication.getService(id);
        if (service == null) {
            throwIllegalArgumentExceptionInvalidAttributeValue(SecurityConfiguration.CFG_KEY_AUTHENTICATION_REF, id);
        }
        return service;
    }
893030
public void setId(String id) {
        logger.entering(id);
        this.id = id;
        logger.exiting();
    }
475028
@Override
    protected String getInstanceIdName(int id)
    {
        switch (id - super.getMaxInstanceId()) {
          case Id_localName: return "localName";
          case Id_uri: return "uri";
        }
        return super.getInstanceIdName(id);
    }
1368794
protected function normalizeId($id)
    {
        if (null !== $this->getSessionPrefix()) {
            return $this->getSessionPrefix() . self::ID_SEPARATOR . $id;
        }

        return $id;
    }
898547
public StructuredDataId makeId(final StructuredDataId id) {
        if (id == null) {
            return this;
        }
        return makeId(id.getName(), id.getEnterpriseNumber());
    }
1171675
public String makeUniqueJavaIdentifier(String id)
    {
        String jid = makeJavaId(id);
        String old = map.put(jid, id);
        if (old != null)
        {
            String oid = jid;
            for (int ii=1;old != null;ii++)
            {
                jid = oid+ii;
                old = map.put(jid, id);
            }
        }
        return jid;
    }
9999
protected Person getPersonById(String id) {
		Person person = null;
		try {
			Long personId = Long.valueOf(id);
			if (logger.isDebugEnabled()) {
				logger.debug("Retrieving Person with id=[{}]", personId);
			}
			person = entityManager.find(Person.class, personId);
		} catch (NumberFormatException e) {
			if (logger.isWarnEnabled()) {
				logger.warn("Invalid number format: {}", id);
			}
		}
		if (person == null) {
			throw new IllegalArgumentException();
		}
		return person;
	}
672371
public Result<NsDAO.Data> validNSOfDomain(AuthzTrans trans, String id) {
		// Take domain, reverse order, and check on NS
		String ns;
		if(id.indexOf('@')<0) { // it's already an ns, not an ID
			ns = id;
		} else {
			ns = domain2ns(id);
		}
		if (ns.length() > 0) {
			if(!trans.org().getDomain().equals(ns)) { 
				Result<List<NsDAO.Data>> rlnsd = nsDAO.read(trans, ns);
				if (rlnsd.isOKhasData()) {
					return Result.ok(rlnsd.value.get(0));
				}
			}
		}
		return Result.err(Status.ERR_NsNotFound,
				"A Namespace is not available for %s", id);
	}
602768
public RegisteredService get(final String id) {
        if (NumberUtils.isCreatable(id)) {
            return get(Long.parseLong(id));
        }
        val keys = new HashMap<String, AttributeValue>();
        keys.put(ColumnNames.SERVICE_ID.getColumnName(), new AttributeValue(id));
        return getRegisteredServiceByKeys(keys);
    }
903713
public static Expression id(String id) {
    CodeChunkUtils.checkId(id);
    return Leaf.create(id, /* isCheap= */ true);
  }
233521
public static String getShortID(String id) {
        String canonicalID = getCanonicalCLDRID(id);
        if (canonicalID == null) {
            return null;
        }
        return getShortIDFromCanonical(canonicalID);
    }
128331
@Override
	public Optional<T> findById(final ID id) {
		return arangoOperations.find(id, domainClass);
	}
141380
public static UUID parseId(final String id) throws WarcFormatException {
		if (! (id.startsWith(UUID_HEAD) && id.endsWith(UUID_TAIL))) throw new WarcFormatException("'" + id + "' wrong format for " + Name.WARC_RECORD_ID.value);
		final int len = id.length();
		UUID uuid;
		try {
			uuid = UUID.fromString(id.substring(UUID_HEAD_LENGTH, len - UUID_TAIL_LENGTH));
		} catch (IllegalArgumentException e) {
			throw new WarcFormatException("Error parsing uuid " + id, e);
		}
		return uuid;
	}
1159846
public CmsUUID convertToServerId(String id) throws CmsIllegalArgumentException {

        if (id == null) {
            throw new CmsIllegalArgumentException(
                org.opencms.xml.containerpage.Messages.get().container(
                    org.opencms.xml.containerpage.Messages.ERR_INVALID_ID_1,
                    id));
        }
        String serverId = getServerIdString(id);
        try {
            return new CmsUUID(serverId);
        } catch (NumberFormatException e) {
            throw new CmsIllegalArgumentException(
                org.opencms.xml.containerpage.Messages.get().container(
                    org.opencms.xml.containerpage.Messages.ERR_INVALID_ID_1,
                    id),
                e);
        }
    }