Пример #1
0
 public EntityConfig(string dictionaryName, string entityName, Type entityType)
 {
     this.DictionaryName = dictionaryName;
     this.EntityName     = entityName.ToLower();
     this.Partition      = FnvHash.Hash(this.EntityName);
     this.EntityType     = entityType;
 }
 public EdgeDevice(string deviceId, string deviceName)
 {
     this.Id            = FnvHash.GetUniqueId();
     this.DeviceId      = deviceId;
     this.DeviceName    = deviceName;
     this.EventsCount   = 0;
     this.MessagesCount = 0;
 }
 public User(string firstName, string lastName, string username, string password = null)
 {
     this.Id        = FnvHash.GetUniqueId();
     this.FirstName = firstName;
     this.LastName  = lastName;
     this.Username  = username;
     this.Password  = password;
 }
Пример #4
0
        public static string CreateNewSession()
        {
            string strRet = FnvHash.GetUniqueId();

            if (!SessionManager.sessionsBag.TryAdd(strRet, new SessionContainer(strRet)))
            {
                Console.WriteLine("Could not add SessionContainer to sessions bag - sessionId=[" + strRet + "]");
            }

            if (!SessionManager.sessionThreadFlag)
            {
                SessionManager.sessionThread = new Thread(new ThreadStart(ExpireIdleSessions));
                SessionManager.sessionThread.Start();
                SessionManager.sessionThreadFlag = true;
            }

            return(strRet);
        }
 public EdgeDevice(string deviceId)
 {
     this.Id         = FnvHash.GetUniqueId();
     this.DeviceId   = deviceId;
     this.DeviceName = deviceId;
 }
 public EdgeDevice()
 {
     this.Id = FnvHash.GetUniqueId();
 }
 public User()
 {
     this.Id = FnvHash.GetUniqueId();
 }