﻿/*
Central manager class handling a single user
*/

var UserManager = Class.create();

UserManager.prototype =
{
    // Constructor
    initialize : function(piId, piHostAddress, piHostName, piAgent, piLanguage)
    {
        try
        {
            // Check if the input parameters are filled and throw exception if not
            if((piId == null) || (piHostAddress == null) || (piHostName == null) || (piAgent == null) || (piLanguage == null))
            {
                throw 'Error: The constructor of the UserManager class requires 5 input parameters.';
            }
            
            // Declare Id variable
            this.Id = piId
            
            // Declare HostAddress variable
            this.HostAddress = piHostAddress;
            // Declare HostName variable
            this.HostName = piHostName;
            // Declare Agent variable
            this.Agent = piAgent;
            // Declare Language variable
            this.Language = piLanguage.toUpperCase();
        }
        catch(e)
        {
            Logs.WriteException('EXCEPTION_GENERAL', 'initialize', arguments, 'USER', piId, e, false)
        }
    }
}