code: public User findUserByName(String userName, UserStatus status) throws Exception
     {
        User user = getFromCache(userName);
        if (user != null)
           return status.matches(user.isEnabled()) ? user : null;
  
        Session session = service.getStorageSession();
        try
        {
           Node userNode;
           try
           {
              userNode = utils.getUserNode(session, userName);
           }
           catch (PathNotFoundException e)
           {
              return null;
           }
  
           user = readUser(userNode);
           putInCache(user);
  
           return status.matches(user.isEnabled()) ? user : null;
        }
        finally
        {
           session.logout();
        }
     }
docs: {@inheritDoc}