package info.bukova.isspst;

import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;

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

public class SessionData implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -764426911263559759L;
	
	private List<Workgroup> userCentres;
	private List<Workgroup> userOnlyCentres;
	private List<Workgroup> userWorkgroups;
	private User currentUser;
	private Map<Integer, List<Role>> workgroupRoles;
	private boolean loginFailed;
	private Map<String, Object> properties;

	public SessionData() {
		loginFailed = false;
		properties = new HashMap<String, Object>();
	}

	public List<Workgroup> getUserCentres() {
		return userCentres;
	}

	public void setUserCentres(List<Workgroup> userCentres) {
		this.userCentres = userCentres;
	}

	public List<Workgroup> getUserWorkgroups() {
		return userWorkgroups;
	}

	public void setUserWorkgroups(List<Workgroup> userWorkgroups) {
		this.userWorkgroups = userWorkgroups;
	}

	public User getCurrentUser() {
		return currentUser;
	}

	public void setCurrentUser(User currentUser) {
		this.currentUser = currentUser;
	}

	public Map<Integer, List<Role>> getWorkgroupRoles() {
		return workgroupRoles;
	}

	public void setWorkgroupRoles(Map<Integer, List<Role>> workgroupRoles) {
		this.workgroupRoles = workgroupRoles;
	}

	public boolean isLoginFailed() {
		return loginFailed;
	}

	public void setLoginFailed(boolean loginFailed) {
		this.loginFailed = loginFailed;
	}

	public void setProperty(String key, Object value) {
		properties.put(key, value);
	}

	public Object getProperty(String key) {
		return properties.get(key);
	}

	public List<Workgroup> getUserOnlyCentres() {
		return userOnlyCentres;
	}

	public void setUserOnlyCentres(List<Workgroup> userOnlyCentres) {
		this.userOnlyCentres = userOnlyCentres;
	}
}
