/// <summary> /// Loads the set of Alignments for a site model. If none exist and empty list is returned. /// </summary> private IAlignments Load(Guid siteModelUid) { _log.LogInformation($"Loading alignments for project {siteModelUid}"); var alignments = DIContext.ObtainRequired <IAlignments>(); try { _readStorageProxy.ReadStreamFromPersistentStore(siteModelUid, ALIGNMENTS_STREAM_NAME, FileSystemStreamType.Alignments, out var ms); if (ms != null) { using (ms) { alignments.FromStream(ms); } } } catch (KeyNotFoundException) { /* This is OK, the element is not present in the cache yet */ } catch (Exception e) { throw new TRexException("Exception reading Alignment cache element from Ignite", e); } _log.LogInformation($"Loaded {alignments.Count} alignments for project {siteModelUid}"); return(alignments); }
/// <summary> /// Loads the set of designs for a site model. If none exist an empty list is returned. /// </summary> private IDesigns Load(Guid siteModelId) { _log.LogInformation($"Loading designs for project {siteModelId}"); var designs = DIContext.ObtainRequired <IDesigns>(); try { _readStorageProxy.ReadStreamFromPersistentStore(siteModelId, DESIGNS_STREAM_NAME, FileSystemStreamType.Designs, out var ms); if (ms != null) { using (ms) { designs.FromStream(ms); } } } catch (KeyNotFoundException) { // This is OK, the element is not present in the cache yet - return an empty design list } catch (Exception e) { throw new TRexException("Exception reading designs cache element from Ignite", e); } _log.LogInformation($"Loaded {designs.Count} designs for project {siteModelId}"); return(designs); }
/// <summary> /// Loads the set of surveyed surfaces for a site model. If none exist and empty list is returned. /// </summary> private ISurveyedSurfaces Load(Guid siteModelUid) { _log.LogInformation($"Loading surveyed surfaces for project {siteModelUid}"); var ss = DIContext.ObtainRequired <ISurveyedSurfaces>(); try { _readStorageProxy.ReadStreamFromPersistentStore(siteModelUid, SURVEYED_SURFACE_STREAM_NAME, FileSystemStreamType.SurveyedSurfaces, out var ms); if (ms != null) { using (ms) { ss.FromStream(ms); } } } catch (KeyNotFoundException) { /* This is OK, the element is not present in the cache yet */ } catch (Exception e) { throw new TRexException("Exception reading Alignment cache element from Ignite", e); } _log.LogInformation($"Loaded {ss.Count} surveyed surfaces for project {siteModelUid}"); return(ss); }
/// <summary> /// Loads the content of the proofing run list from the persistent store. If there is no item in the persistent store containing /// proofing runs for this site model them return an empty list. /// </summary> public void LoadFromPersistentStore(Guid projectUid, IStorageProxy storageProxy) { storageProxy.ReadStreamFromPersistentStore(projectUid, LIST_STREAM_NAME, FileSystemStreamType.MachineDesigns, out var ms); if (ms == null) { return; } using (ms) { this.FromStream(ms); } }
/// <summary> /// Loads the content of the machines list from the persistent store. If there is no item in the persistent store containing /// machines for this site model them return an empty list. /// </summary> public void LoadFromPersistentStore(IStorageProxy storageProxy) { storageProxy.ReadStreamFromPersistentStore(DataModelID, MACHINES_LIST_STREAM_NAME, FileSystemStreamType.Machines, out MemoryStream MS); if (MS == null) { return; } using (MS) { this.FromStream(MS); } }
/// <summary> /// Loads the content of the proofing run list from the persistent store. If there is no item in the persistent store containing /// proofing runs for this site model them return an empty list. /// </summary> public void LoadFromPersistentStore(IStorageProxy storageProxy) { storageProxy.ReadStreamFromPersistentStore(DataModelID, PROOFING_RUN_LIST_STREAM_NAME, FileSystemStreamType.ProofingRuns, out MemoryStream ms); if (ms == null) { return; } using (ms) { this.FromStream(ms); } }