/* global StructrRESTLoader, Session */
var User = Namespace.declare("tla.EAM.layer2",
  class User extends UcpComponent {
    static start() {}

    static dependencies() {
      return [];
    }

    constructor() {
      super();
      this._private.id = StructrRESTLoader.defaultUser;
      this.password = StructrRESTLoader.defaultPassword;
      this.sessions = [];
      this.sessions.push(Session.getInstance().init(this));
    }

    init() {
      super.init();
      //Container.register(OverView, this);
      //ONCE.eventSupport.addEventListener("newThing", this, this.newThing.bind(this));
      return this;
    }

    get name() {
      if (!this._private) return null;
      if (!this._private.name || this._private.name == "undefined") {
        this._private.name = this.id;
      }

      return "User: " + this._private.name;
    }

    set name(newValue) {
      this._private.name = newValue;
    }

    login() {
      console.log("login method called");
    }
  }
);