private Optional<User> getOrCreateUserBySubjectId(final String subjectId) {
        if (NullSafe.isBlankString(subjectId)) {
            return Optional.empty();
        } else {
            Optional<User> optUser = cacheBySubjectId.get(subjectId);
            if (optUser.isEmpty()) {
                optUser = securityContext.asProcessingUserResult(() ->
                        Optional.ofNullable(userServiceProvider.get().getOrCreateUser(subjectId)));
                if (optUser.isPresent()) {
                    cacheBySubjectId.put(subjectId, optUser);
                }
            }
            return optUser;
        }
    }
Gets a user from the cache and if it doesn't exist creates it in the database.

@param subjectId This is the unique identifier for the user that links the stroom user
                 to an IDP user, e.g. may be the 'sub' on the IDP depending on stroom config.
stroom-security/stroom-security-impl/src/main/java/stroom/security/impl/StroomUserIdentityFactory.java