private void Initialize() { DiagnosticsSessionFactory.SetDefaults(Guid.Parse("ebfb4d9d-d5ed-45e5-9f75-e3389bece6fa"), "Inference Classification Agent", "Inference Diagnostics Logs", Path.Combine(ExchangeSetupContext.InstallPath, "Logging\\InferenceClassification"), "Inference_", "InferenceClassificationLogs"); this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("InferenceClassificationAgentFactory", null, (long)this.GetHashCode()); this.CreateClassificationAgentLogger(); this.CreateClassificationComparisonLogger(); if (this.isPipelineEnabled) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); PipelineDefinition definition = PipelineDefinition.LoadFromFile(Path.Combine(InferenceClassificationAgentFactory.ExecutingAssemblyLocation, "InferenceClassificationPipelineDefinition.xml")); string text = "ClassificationPipeline"; InferenceModel.GetInstance(text).Reset(); PipelineContext pipelineContext = new PipelineContext(); pipelineContext.SetProperty <string>(DocumentSchema.PipelineInstanceName, text); this.pipeline = new Pipeline(definition, text, pipelineContext, null); IAsyncResult asyncResult = this.pipeline.BeginPrepareToStart(null, null); this.pipeline.EndPrepareToStart(asyncResult); asyncResult = this.pipeline.BeginStart(null, null); this.pipeline.EndStart(asyncResult); stopwatch.Stop(); this.diagnosticsSession.LogDiagnosticsInfo(DiagnosticsLoggingTag.Informational, "Pipeline creation timespan: {0} ms", new object[] { stopwatch.ElapsedMilliseconds }); } }
protected MdbPeopleBaseModelDataBinder(string modelFAIName, MailboxSession session) { Util.ThrowOnNullArgument(session, "session"); this.session = session; this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("MdbPeopleBaseModelDataBinder", ExTraceGlobals.MdbInferenceModelDataBinderTracer, (long)this.GetHashCode()); this.modelFAIName = modelFAIName; }
internal MdbDocumentAdapter(IDictionary <StorePropertyDefinition, object> preloadedProperties, MdbPropertyMap propertyMap) { Util.ThrowOnNullOrEmptyArgument <KeyValuePair <StorePropertyDefinition, object> >(preloadedProperties, "preloadedProperties"); Util.ThrowOnNullArgument(propertyMap, "propertyMap"); this.preloadedProperties = preloadedProperties; this.propertyMap = propertyMap; this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("MdbDocumentAdapter", ComponentInstance.Globals.Search.ServiceName, ExTraceGlobals.MdbDocumentAdapterTracer, (long)this.GetHashCode()); }
public Document(IIdentity identity, DocumentOperation operation, IDocumentAdapter documentAdapter) { Util.ThrowOnNullArgument(identity, "identity"); this.propertyBag = new PropertyBag(); this.documentAdapter = documentAdapter; this.propertyBag.SetProperty <IIdentity>(DocumentSchema.Identity, identity); this.propertyBag.SetProperty <DocumentOperation>(DocumentSchema.Operation, operation); this.diagnosticsSession = DiagnosticsSession.CreateDocumentDiagnosticsSession(identity, ExTraceGlobals.CoreDocumentModelTracer); }
internal MdbDocumentAdapter(MdbCompositeItemIdentity id, PropertyDefinition[] propertiesToLoad, IItem item, MailboxSession session, MdbPropertyMap propertyMap, bool allowItemBind = true) { Util.ThrowOnNullArgument(id, "id"); Util.ThrowOnNullArgument(propertyMap, "propertyMap"); this.id = id; this.propertyMap = propertyMap; this.mappedPropertiesToLoadOnBind = MdbDocumentAdapter.GetMappings(this.propertyMap, propertiesToLoad); ExAssert.RetailAssert(this.mappedPropertiesToLoadOnBind != null, "Store Properties to load is null"); this.Item = item; this.Session = session; if (this.Item == null && this.Session == null) { throw new ArgumentException("session and item are both null"); } this.shouldDisposeItem = false; this.allowItemBind = allowItemBind; this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("MdbDocumentAdapter", ComponentInstance.Globals.Search.ServiceName, ExTraceGlobals.MdbDocumentAdapterTracer, (long)this.GetHashCode()); }
private string GetSessionCookieValue(string password, DateTime?expiry = null) { var salt = DiagnosticsSession.GenerateRandomSalt(); var hash = DiagnosticsSession.GenerateSaltedHash(password, salt); var session = new DiagnosticsSession { Hash = hash, Salt = salt, Expiry = expiry.HasValue ? expiry.Value : DateTime.Now.AddMinutes(15), }; var serializedSession = this.objectSerializer.Serialize(session); var encryptedSession = this.cryptoConfig.EncryptionProvider.Encrypt(serializedSession); var hmacBytes = this.cryptoConfig.HmacProvider.GenerateHmac(encryptedSession); var hmacString = Convert.ToBase64String(hmacBytes); return(String.Format("{1}{0}", encryptedSession, hmacString)); }
public CrawlerItemIterator(ICrawlerFolderIterator folderIterator, int maxRowCount, PropertyDefinition sortProperty, Predicate <object[]> filterPredicate, params PropertyDefinition[] predicateProperties) { Util.ThrowOnNullArgument(folderIterator, "folderIterator"); Util.ThrowOnNullArgument(sortProperty, "sortProperty"); if (filterPredicate != null) { Util.ThrowOnNullArgument(predicateProperties, "predicateProperties"); } else if (predicateProperties != null && predicateProperties.Length > 0) { throw new ArgumentException("Predicate properties should not be specified when there's no filter supplied."); } this.folderIterator = folderIterator; this.maxRowCount = Math.Min(maxRowCount, 10000); this.sortProperty = sortProperty; this.filterPredicate = filterPredicate; this.predicateProperties = predicateProperties; this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("CrawlerItemIterator", ComponentInstance.Globals.Search.ServiceName, ExTraceGlobals.MdbCrawlerFeederTracer, (long)this.GetHashCode()); }
public IndexDeliveryAgentFactory() { this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("IndexDeliveryAgentFactory", ComponentInstance.Globals.Search.ServiceName, ExTraceGlobals.IndexDeliveryAgentTracer, (long)this.GetHashCode()); this.enabled = new SearchConfig().IndexAgentEnabled; }
public IndexDeliveryAgent() { this.diagnosticsSession = DiagnosticsSession.CreateComponentDiagnosticsSession("IndexDeliveryAgent", ComponentInstance.Globals.Search.ServiceName, ExTraceGlobals.IndexDeliveryAgentTracer, (long)this.GetHashCode()); base.OnPromotedMessage += this.OnPromotedMessageHandler; }