<commit_before>/*
 * Copyright 2005-2007 The Kuali Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.core;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.kuali.core.bo.user.AuthenticationUserId;
import org.kuali.core.bo.user.UniversalUser;
import org.kuali.core.exceptions.UserNotFoundException;
import org.kuali.core.workflow.service.KualiWorkflowDocument;
import org.kuali.kfs.sys.businessobject.FinancialSystemUser;
import org.kuali.kfs.sys.context.SpringContext;
import org.kuali.kfs.sys.service.FinancialSystemUserService;
import org.kuali.rice.KNSServiceLocator;

import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
import edu.iu.uis.eden.clientapp.vo.UserVO;
import edu.iu.uis.eden.exception.WorkflowException;

/**
 * This class represents a User Session
 * 
 * 
 */
public class UserSession implements Serializable {

    private static final long serialVersionUID = 4532616762540067557L;

    private static final Logger LOG = Logger.getLogger(UserSession.class);

    private FinancialSystemUser universalUser;
    private FinancialSystemUser backdoorUser;
    private UserVO workflowUser;
    private UserVO backdoorWorkflowUser;
    private int nextObjectKey;
    private Map objectMap;

    private transient Map workflowDocMap = new HashMap();

    /**
     * Take in a netid, and construct the user from that.
     * 
     * @param networkId
     * @throws UserNotFoundException
     * @throws EdenUserNotFoundException
     * @throws ResourceUnavailableException
     */
    public UserSession(String networkId) throws UserNotFoundException, WorkflowException {
        this.universalUser = SpringContext.getBean(FinancialSystemUserService.class).getFinancialSystemUser(new AuthenticationUserId(networkId));<commit_msg>KFSMI-1147: work on database session strategy  KULRICE-2128 work on database session management strategy<commit_after>/*
 * Copyright 2005-2007 The Kuali Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.core;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.kuali.core.bo.user.AuthenticationUserId;
import org.kuali.core.bo.user.UniversalUser;
import org.kuali.core.exceptions.UserNotFoundException;
import org.kuali.core.workflow.service.KualiWorkflowDocument;
import org.kuali.kfs.sys.businessobject.FinancialSystemUser;
import org.kuali.kfs.sys.context.SpringContext;
import org.kuali.kfs.sys.service.FinancialSystemUserService;
import org.kuali.rice.KNSServiceLocator;

import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
import edu.iu.uis.eden.clientapp.vo.UserVO;
import edu.iu.uis.eden.exception.WorkflowException;

/**
 * This class represents a User Session
 * 
 * 
 */
public class UserSession implements Serializable {

    private static final long serialVersionUID = 4532616762540067557L;

    private static final Logger LOG = Logger.getLogger(UserSession.class);

    private FinancialSystemUser universalUser;
    private FinancialSystemUser backdoorUser;
    private UserVO workflowUser;
    private UserVO backdoorWorkflowUser;
    private int nextObjectKey;
    private Map objectMap;
    private String kualiSessionId;

    /**
     * Gets the kualiSessionId attribute. 
     * @return Returns the kualiSessionId.
     */
    public String getKualiSessionId() {
        return kualiSessionId;
    }

    /**
     * Sets the kualiSessionId attribute value.
     * @param kualiSessionId The kualiSessionId to set.
     */
    public void setKualiSessionId(String kualiSessionId) {
        this.kualiSessionId = kualiSessionId;
    }

    private transient Map workflowDocMap = new HashMap();

    /**
     * Take in a netid, and construct the user from that.
     * 
     * @param networkId
     * @throws UserNotFoundException
     * @throws EdenUserNotFoundException
     * @throws ResourceUnavailableException
     */
    public UserSession(String networkId) throws UserNotFoundException, WorkflowException {
        this.universalUser = SpringContext.getBean(FinancialSystemUserService.class).getFinancialSystemUser(new AuthenticationUserId(networkId));
{'fraction_non_alphanumeric': 0.07853982300884955, 'fraction_numerical': 0.012905604719764012, 'mean_word_length': 4.216346153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3300191', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1518, 'n_words': 438}