SerializeIcalStatsToJson() публичный Метод

public SerializeIcalStatsToJson ( ) : BlobStorageResponse
Результат ElmcityUtils.BlobStorageResponse
Пример #1
0
        public void SerializeStatsYieldsHttpCreated()
        {
            fr.stats[testurl].valid = testbool;
            fr.stats[testurl].score = testscore;
            var response = fr.SerializeIcalStatsToJson();

            Assert.AreEqual(HttpStatusCode.Created, response.HttpResponse.status);
        }
Пример #2
0
        private void SerializeStatsAndIntermediateOutputs(FeedRegistry fr, EventStore es, iCalendar ical, NonIcalStats stats, SourceType type)
        {
            BlobStorageResponse bsr;
            HttpResponse tsr;

            if (BlobStorage.ExistsContainer(this.id) == false)
                bs.CreateContainer(this.id, is_public: true, headers: new Hashtable());

            if (type == SourceType.ical) // NonIcalStats is null in this case, and not used
            {
                bsr = fr.SerializeIcalStatsToJson();
                GenUtils.LogMsg("info", this.id + ": SerializeIcalStatsToJson",  bsr.HttpResponse.status.ToString());
                tsr = fr.SaveStatsToAzure();
                GenUtils.LogMsg("info", this.id + ": FeedRegistry.SaveStatsToAzure", tsr.status.ToString());
            }
            else
            {

                bsr = Utils.SerializeObjectToJson(stats, this.id, stats.blobname + ".json");
                GenUtils.LogMsg("info", this.id + ": Collector: SerializeObjectToJson: " + stats.blobname + ".json", bsr.HttpResponse.status.ToString());
                tsr = this.SaveStatsToAzure(type);
                GenUtils.LogMsg("info", this.id + ": Collector: SaveStatsToAzure", tsr.status.ToString());

            }

            bsr = this.SerializeIcalEventsToIcs(ical, type);
            GenUtils.LogMsg("info", this.id + ": SerializeIcalStatsToIcs: " + id + "_" + type.ToString() + ".ics", bsr.HttpResponse.status.ToString());

            bsr = es.Serialize();
            GenUtils.LogMsg("info", this.id + ": EventStore.Serialize: " + es.objfile, bsr.HttpResponse.status.ToString());
        }