Determine the username to use based on this configuration and the environment.
@return the username to use
@since 1.4.0
972950
public String determineUsername() {
		if (StringUtils.hasText(this.username)) {
			return this.username;
		}
		if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
			return "sa";
		}
		return null;
	}
480561
private String getSimpleUsername(String username) {
        String simpleUsername = username;
        if (defaultDomain != null) {
            // sanitize username
            if (username.startsWith(defaultDomain + "\\")) {
                // strip default domain from domain\ username
                simpleUsername = username.substring(defaultDomain.length() + 1);
            } else if (username.endsWith("@" + defaultDomain)) {
                // strip default domain from username@domain
                simpleUsername = username.substring(0, username.lastIndexOf('@'));
            }
        }
        return simpleUsername;
    }
709906
public String name () {
    // lazily init name if it's not been set
    if (name == null) {
      name = getClass().getName();
      name = name.substring(name.lastIndexOf(".")+1).intern();
    }
    return name;
  }
950743
private static String getUserHome() {
        String userHomeProperty = System.getProperty("user.home");
        String userHomeEnv = System.getenv("HOME");
        if (userHomeEnv == null) return userHomeProperty;
        int propertyCount = userHomeProperty.split("/").length;
        int envCount = userHomeEnv.split("/").length;
        return propertyCount <= envCount ? userHomeProperty : userHomeEnv;
    }
975489
public String getUser() {
    if (user != null) {
      return user;
    }
    return urlParser != null ? urlParser.getUsername() : null;
  }
1024112
public function getUsername()
    {
        if (!$this->hasEnabledUsername()) {
            return null;
        }
        $usernameClass = $this->usernameClass;
        $noInit = $usernameClass::buildNoInitModel();
        /* @var $noInit Username */
        return $this->hasOne($usernameClass, [$noInit->createdByAttribute => $this->guidAttribute]);
    }
1308769
private static String getCurrentUserName() {
        Authentication a = SecurityContextHolder.getContext().getAuthentication();
        if (a == null) return null;
        org.springframework.security.core.userdetails.User u =
                (org.springframework.security.core.userdetails.User)
                        a.getPrincipal();
        if (u == null) return null;
        return u.getUsername();
    }
713635
protected function getUsername()
    {

        // initialize the name
        $name = null;

        // query whether or not we've an principal
        if ($identity = $this->getIdentity()) {
            $name = $identity->getName();
        }

        // return the name
        return $name;
    }
1069201
public String getName() {
		String name = this.getNodeName();
		if (this.isLeaf()) {
			int colonIndex = name.indexOf(":");
			if (colonIndex > 0) {
				// Strip the GET/POST etc off
				name = name.substring(colonIndex+1);
			}
		}
		return name; 
	}
767164
public static String getName() {
        String secname = null;
        WSCredential credential = getCallerWSCredential();
        try {
            if (credential != null && !credential.isUnauthenticated()) {
                String realmSecname = credential.getRealmSecurityName();
                if (realmSecname != null && !realmSecname.isEmpty()) {
                    secname = realmSecname.substring(realmSecname.lastIndexOf(REALM_SEPARATOR) + 1);
                }
            }
        } catch (Exception e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Internal error: " + e);
        }
        return secname;
    }
1228409
public static String getUserName() throws Exception {
        Subject subject = getRunAsSubjectInternal();
        if (subject == null) {
            return null;
        }
        Set<Principal> principals = subject.getPrincipals();
        Iterator<Principal> principalsIterator = principals.iterator();
        if (principalsIterator.hasNext()) {
            Principal principal = principalsIterator.next();
            return principal.getName();
        }
        return null;
    }
706271
@Bean(name = "usernameAttributeProvider")
    public IUsernameAttributeProvider getUsernameAttributeProvider() {
        final SimpleUsernameAttributeProvider rslt = new SimpleUsernameAttributeProvider();
        rslt.setUsernameAttribute(USERNAME_ATTRIBUTE);
        return rslt;
    }
1012843
def choose_username(metadata, config):
    
    if config.username is not None:
        # we allow -- but do not encourage -- database username configuration
        return config.username

    if config.read_only:
        # by convention, we provision read-only username for every service
        return f"{metadata.name}_ro"

    return metadata.name
919788
public String getName()
    {
        if (_name==null)
        {
            _name=this.getClass().getName();
            if (!log.isDebugEnabled())
                _name=_name.substring(_name.lastIndexOf('.')+1);
        }
        return _name;
    }
775449
public String getName() {
		if (m_strFieldName != null)
			return m_strFieldName;

		String str;

		if (m_strGetName != null)
			str = m_strGetName + "()|";
		else
			str = "|";

		if (m_strSetName != null)
			return str + m_strSetName;

		return str;
	}
432238
public String getName() {
		if(name==null) {
			String temp = get("iv-user");
			if(temp==null)return null;
			StringBuilder sb = new StringBuilder();
			int at = temp.indexOf('@');
			if(at<0) {
				sb.append(temp);
			} else {
				sb.append(temp.substring(0, at));
			}
			if(temp.endsWith("@uverse.com"))sb.append("@uverse.tguard.att.com");
			else if(temp.endsWith("@att.com"))sb.append("@com.tguard.att.com");
			else if(temp.endsWith("@att.net"))sb.append("@net.tguard.att.com");
			else sb.append("@tguard.att.com");
			name = sb.toString();
		}
		return name;
	}
1191633
public String getUsername() {
        final String username = basicJdbcConfiguration.getConfiguredUsername();
        if (calculatedUsername == null || StringUtils.hasText(username)) {
            calculatedUsername = username;
            if (!StringUtils.hasText(calculatedUsername) && JdbcDatabaseManager.isEmbedded(basicJdbcConfiguration.getDriverClassName())) {
                calculatedUsername = "sa";
            }
        }

        return calculatedUsername;
    }