code: SessionImpl internalLogin(ConversationState state, String workspaceName) throws LoginException,
        NoSuchWorkspaceException, RepositoryException
     {
  
        if (workspaceName == null)
        {
           workspaceName = config.getDefaultWorkspaceName();
           if (workspaceName == null)
           {
              throw new NoSuchWorkspaceException("Both workspace and default-workspace name are null! ");
           }
        }
  
        if (!isWorkspaceInitialized(workspaceName))
        {
           throw new NoSuchWorkspaceException("Workspace '" + workspaceName + "' not found. "
              + "Probably is not initialized. If so either Initialize it manually or turn on the RepositoryInitializer");
        }
  
        SessionFactory sessionFactory = repositoryContainer.getWorkspaceContainer(workspaceName).getSessionFactory();
        return sessionFactory.createSession(state);
     }
docs: Internal login.
  
  @param state ConversationState
  @param workspaceName workspace name
  @return SessionImpl
  @throws LoginException error of logic
  @throws NoSuchWorkspaceException if no workspace found with name
  @throws RepositoryException Repository error