Given an accessId, extract the realm.

@param accessId
@return The realm for the accessId, or {@code null} if the accessId is invalid
329501
public static String getRealm(String accessId) {
        Matcher m = matcher(accessId);
        if (m != null) {
            return m.group(2);
        }
        return null;
    }
417988
public String getAccessKey() {
		String accessKey = getAsNullableString("access_key");
		accessKey = accessKey != null ? accessKey : getAsNullableString("client_key");
		return accessKey;
	}
432942
public java.lang.String getAccesskey() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.accesskey);

    }
873474
@Override
  public BaseSession getSession(String sessionId) {
    if (this.localDataSource.exists(sessionId)) {
      return this.localDataSource.getSession(sessionId);
    }
    else if (!this.localMode && this.existReplicated(sessionId)) {
      this.makeLocal(sessionId);
      return this.localDataSource.getSession(sessionId);
    }

    return null;
  }
610608
@CheckForNull
    public AdministrativeMonitor getAdministrativeMonitor(String id) {
        for (AdministrativeMonitor m : administrativeMonitors)
            if(m.id.equals(id))
                return m;
        return null;
    }
768405
public static String extractAccessKey(HttpServletRequest request) {
		if (request == null) {
			return "";
		}
		String accessKey = "";
		String auth = request.getHeader(HttpHeaders.AUTHORIZATION);
		boolean isAnonymousRequest = isAnonymousRequest(request);
		if (StringUtils.isBlank(auth)) {
			auth = request.getParameter("X-Amz-Credential");
			if (!StringUtils.isBlank(auth)) {
				accessKey = StringUtils.substringBetween(auth, "=", "/");
			}
		} else {
			if (isAnonymousRequest) {
				accessKey = StringUtils.substringAfter(auth, "Anonymous").trim();
			} else {
				accessKey = StringUtils.substringBetween(auth, "=", "/");
			}
		}
		if (isAnonymousRequest && StringUtils.isBlank(accessKey)) {
			// try to get access key from parameter
			accessKey = request.getParameter("accessKey");
		}
		return accessKey;
	}
634700
public User getUserById(int id) {
		for (User u : users)
			if (u.getId() == id)
				return u;
		return null;
	}
620783
@SuppressWarnings("WeakerAccess")
  public Cluster getCluster(String instanceId, String clusterId) {
    return ApiExceptions.callAndTranslateApiException(getClusterAsync(instanceId, clusterId));
  }
1278527
public <R> R accessContext(ContextAccess<C,R> access)
    {
        contextLock.lock();
        try
        {
            return access.access(context);
        }
        finally
        {
            contextLock.unlock();
        }
    }
174154
public UUID getAccountId(final UUID objectId, final ObjectType objectType, final TenantContext context) {
        final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, context);
        if (accountRecordId != null) {
            return nonEntityDao.retrieveIdFromObject(accountRecordId, ObjectType.ACCOUNT, objectIdCacheController);
        } else {
            return null;
        }
    }
1295580
@VisibleForTesting
	@Nullable
	public Instance getInstance(ResourceID resourceId) {
		for (Instance instance : allInstances) {
			if (Objects.equals(resourceId, instance.getTaskManagerID())) {
				return instance;
			}
		}
		return null;
	}
231480
public Object lookup(Identity oid)
    {
        Object result = null;
        // 1. lookup an instance in session cache
        CacheEntry entry = (CacheEntry) sessionCache.get(oid);
        if(entry != null)
        {
            result = entry.get();
        }
        if(result == null)
        {
            result = lookupFromApplicationCache(oid);
            // 4. if we have a match
            // put object in session cache
            if(result != null)
            {
                doInternalCache(oid, result, TYPE_CACHED_READ);
                materializeFullObject(result);
                if(log.isDebugEnabled()) log.debug("Materialized object from second level cache: " + oid);
            }
        }
        if(result != null && log.isDebugEnabled())
        {
            log.debug("Match for: " + oid);
        }
        return result;
    }
441374
@Nullable
	static String extractName(@Nullable Object authentication) {

		if (authentication == null) {
			return null;
		}

		Expression expression = PARSER.parseExpression(NAME_EXPRESSION);

		return expression.getValue(authentication, String.class);
	}
875521
public Entity getEntity(String id) {
        Entity e = getEntities().get(id);
        if (e == null) {
            return null;
        }
        return e;
    }
627533
public static AVIMClient getInstance(String clientId) {
    if (StringUtil.isEmpty(clientId)) {
      return null;
    }
    AVIMClient client = clients.get(clientId);
    if (null == client) {
      client = new AVIMClient(clientId);
      AVIMClient elderClient = clients.putIfAbsent(clientId, client);
      if (null != elderClient) {
        client = elderClient;
      }
    }
    return client;
  }
745983
static String getAccessTokenForUserId(String userId) {
        if (userId == null && getUserId() == null
                || userId != null && userId.equals(getUserId())) {
            return getAccessToken();
        } else {
            JSONObject usersArchive = getJSONObject(PER_USER_ARCHIVE_PREF_NAME);
            if (usersArchive == null) usersArchive = new JSONObject();
            JSONObject userArchive = usersArchive.optJSONObject(userId == null ? "" : userId);
            if (userArchive == null) userArchive = new JSONObject();
            return JSONUtil.optString(userArchive, ACCESS_TOKEN_PREF_NAME);
        }
    }
477923
public static boolean isServerAccessId(String accessId) {
        return isAccessId(accessId) && accessId.startsWith(AccessIdUtil.TYPE_SERVER + AccessIdUtil.TYPE_SEPARATOR);
    }