Example #1
0
 public ReplyManager()
 {
     _reply             = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Reply);
     _replyNotification = AzureFactory.GetTable(AzureFactory.MSGorillaTable.ReplyNotification);
     _replyArchive      = AzureFactory.GetTable(AzureFactory.MSGorillaTable.ReplyArchive);
     _userline          = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline);
     _accManager        = new AccountManager();
     _notifManager      = new NotifManager();
     _richMsgManager    = new RichMsgManager();
 }
Example #2
0
        public int GetUserPostMessageCountByDateUtc(string userid, DateTime date)
        {
            CloudTable userline = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline).AzureTable;

            string query = TableQuery.GenerateFilterCondition(
                "PartitionKey",
                QueryComparisons.Equal,
                string.Format("{0}_{1}", userid, Utils.ToAzureStorageDayBasedString(date)));

            TableQuery tableQuery = new TableQuery().Where(query);

            int count = userline.ExecuteQuery(tableQuery).Count();

            Logger.Debug(string.Format("{0} post {1} messages in {2:yyyy-MM-dd}", userid, count, date.ToUniversalTime().Date));
            return(count);
        }
Example #3
0
        public StatisticsManager()
        {
            _homeline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Homeline);
            _userline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline);
            _eventline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.EventLine);
            _publicSquareLine = AzureFactory.GetTable(AzureFactory.MSGorillaTable.PublicSquareLine);
            _topicline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.TopicLine);
            _ownerline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.OwnerLine);
            _atline           = AzureFactory.GetTable(Azure.AzureFactory.MSGorillaTable.AtLine);
            _reply            = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Reply);

            _accManager     = new AccountManager();
            _attManager     = new AttachmentManager();
            _schemaManager  = new SchemaManager();
            _notifManager   = new NotifManager();
            _topicManager   = new TopicManager();
            _richMsgManager = new RichMsgManager();
        }
Example #4
0
        public int GetTotalRobotMessageCountByDateUtc(DateTime date)
        {
            int           count   = 0;
            List <string> robitID = GetCurrentRobotID();

            CloudTable userline = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline).AzureTable;

            foreach (string userid in robitID)
            {
                try
                {
                    count += GetUserPostMessageCountByDateUtc(userid, date);
                }
                catch (Exception e)
                {
                    Logger.Error(e.ToString());
                }
            }

            Logger.Info(string.Format("Robots posted {0} messages totally in {1:yyyy-MM-dd}", count, date.ToUniversalTime()));
            return(count);
        }
Example #5
0
        public MessageManager()
        {
            _homeline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Homeline);
            _userline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline);
            _eventline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.EventLine);
            _publicSquareLine = AzureFactory.GetTable(AzureFactory.MSGorillaTable.PublicSquareLine);
            _topicline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.TopicLine);
            _ownerline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.OwnerLine);
            _atline           = AzureFactory.GetTable(Azure.AzureFactory.MSGorillaTable.AtLine);
            _reply            = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Reply);

            _queue            = AzureFactory.GetQueue(AzureFactory.MSGorillaQueue.Dispatcher);
            _spiderqueue      = AzureFactory.GetQueue(AzureFactory.MSGorillaQueue.SearchEngineSpider);
            _mailMessageQueue = AzureFactory.GetQueue(AzureFactory.MSGorillaQueue.MailMessage);

            _accManager     = new AccountManager();
            _attManager     = new AttachmentManager();
            _schemaManager  = new SchemaManager();
            _notifManager   = new NotifManager();
            _topicManager   = new TopicManager();
            _richMsgManager = new RichMsgManager();
            _groupManager   = new GroupManager();
        }
Example #6
0
        public AttachmentManager()
        {
            _attachment    = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Attachment);
            _blobcontainer = AzureFactory.GetBlobContainer(AzureFactory.MSGorillaBlobContainer.Attachment);

            BlobContainerPermissions blobPermissions = new BlobContainerPermissions();

            blobPermissions.SharedAccessPolicies.Add(_policyName, new SharedAccessBlobPolicy()
            {
                // To ensure SAS is valid immediately, don’t set start time.
                // This way, you can avoid failures caused by small clock differences.
                SharedAccessExpiryTime = DateTime.UtcNow.AddHours(1),
                Permissions            = SharedAccessBlobPermissions.Read
            });

            // The public access setting explicitly specifies that
            // the container is private, so that it can't be accessed anonymously.
            blobPermissions.PublicAccess = BlobContainerPublicAccessType.Off;

            // Set the permission policy on the container.
            _blobcontainer.SetPermissions(blobPermissions);

            // Get the shared access signature to share with users.
        }
Example #7
0
 public MetricManager()
 {
     _metricData = AzureFactory.GetTable(AzureFactory.MSGorillaTable.MetricDataSet);
 }
Example #8
0
 public CounterManager()
 {
     _counterSet    = AzureFactory.GetTable(AzureFactory.MSGorillaTable.CounterSet);
     _counterRecord = AzureFactory.GetTable(AzureFactory.MSGorillaTable.CounterRecord);
 }
Example #9
0
 public SearchManager()
 {
     _wordsIndexTable    = AzureFactory.GetTable(AzureFactory.MSGorillaTable.WordsIndex);
     _searchResultsTable = AzureFactory.GetTable(AzureFactory.MSGorillaTable.SearchResults);
     _searchHistoryTable = AzureFactory.GetTable(AzureFactory.MSGorillaTable.SearchHistory);
 }
Example #10
0
 public RichMsgManager()
 {
     _richMsg = AzureFactory.GetTable(AzureFactory.MSGorillaTable.RichMessage);
 }