Ejemplo n.º 1
0
        /// <summary>
        /// Remove the design list for a site model from the persistent store
        /// </summary>
        public bool Remove(Guid siteModelId, IStorageProxy storageProxy)
        {
            // First remove all the existence maps associated with the designs
            var designs = Load(siteModelId);

            designs.ForEach(x =>
            {
                FileSystemErrorStatus result;
                var filename = BaseExistenceMapRequest.CacheKeyString(ExistenceMaps.Interfaces.Consts.EXISTENCE_MAP_DESIGN_DESCRIPTOR, x.ID);
                if ((result = storageProxy.RemoveStreamFromPersistentStore(siteModelId, FileSystemStreamType.DesignTopologyExistenceMap, filename)) != FileSystemErrorStatus.OK)
                {
                    _log.LogWarning($"Unable to remove existence map for design {x.ID}, filename = {filename}, with result: {result}");
                }
            });

            // Then remove the designs list stream itself
            var result = storageProxy.RemoveStreamFromPersistentStore(siteModelId, FileSystemStreamType.Designs, DESIGNS_STREAM_NAME);

            if (result != FileSystemErrorStatus.OK)
            {
                _log.LogInformation($"Removing designs list from project {siteModelId} failed with error {result}");
            }

            return(result == FileSystemErrorStatus.OK);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Remove the alignments list for a site model from the persistent store
        /// </summary>
        public bool Remove(Guid siteModelId, IStorageProxy storageProxy)
        {
            var result = storageProxy.RemoveStreamFromPersistentStore(siteModelId, FileSystemStreamType.Designs, ALIGNMENTS_STREAM_NAME);

            if (result != FileSystemErrorStatus.OK)
            {
                _log.LogInformation($"Removing alignments list from project {siteModelId} failed with error {result}");
            }

            return(result == FileSystemErrorStatus.OK);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Remove the surveyed surface list for a site model from the persistent store
        /// </summary>
        public bool Remove(Guid siteModelUid, IStorageProxy storageProxy)
        {
            // First remove all the existence maps associated with the surveyed surfaces
            foreach (var surveyedSurface in Load(siteModelUid))
            {
                FileSystemErrorStatus fsResult;
                var filename = BaseExistenceMapRequest.CacheKeyString(ExistenceMaps.Interfaces.Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, surveyedSurface.ID);
                if ((fsResult = storageProxy.RemoveStreamFromPersistentStore(siteModelUid, FileSystemStreamType.DesignTopologyExistenceMap, filename)) != FileSystemErrorStatus.OK)
                {
                    _log.LogWarning($"Unable to remove existence map for surveyed surface {surveyedSurface.ID}, filename = {filename}, in project {siteModelUid} with result: {fsResult}");
                }
            }

            // Then remove the surveyed surface list stream itself
            var result = storageProxy.RemoveStreamFromPersistentStore(siteModelUid, FileSystemStreamType.Designs, SURVEYED_SURFACE_STREAM_NAME);

            if (result != FileSystemErrorStatus.OK)
            {
                _log.LogInformation($"Removing surveyed surfaces list from project {siteModelUid} failed with error {result}");
            }

            return(result == FileSystemErrorStatus.OK);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Remove a given design from a site model
        /// </summary>
        public bool Remove(Guid siteModelId, Guid designId)
        {
            var designs = Load(siteModelId);
            var result  = designs.RemoveDesign(designId);

            if (result)
            {
                var removeMapResult = _writeStorageProxy.RemoveStreamFromPersistentStore(siteModelId, FileSystemStreamType.DesignTopologyExistenceMap,
                                                                                         BaseExistenceMapRequest.CacheKeyString(ExistenceMaps.Interfaces.Consts.EXISTENCE_MAP_DESIGN_DESCRIPTOR, designId));

                if (removeMapResult != FileSystemErrorStatus.OK)
                {
                    _log.LogInformation($"Removing existence map for design {designId} in project {siteModelId} failed with error {removeMapResult}");
                }

                Store(siteModelId, designs);
            }

            return(result);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Remove a given surveyed surface from a site model
        /// </summary>
        public bool Remove(Guid siteModelUid, Guid surveySurfaceUid)
        {
            var ss     = Load(siteModelUid);
            var result = ss.RemoveSurveyedSurface(surveySurfaceUid);

            if (result)
            {
                var removeMapResult = _writeStorageProxy.RemoveStreamFromPersistentStore(siteModelUid, FileSystemStreamType.DesignTopologyExistenceMap,
                                                                                         BaseExistenceMapRequest.CacheKeyString(ExistenceMaps.Interfaces.Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, surveySurfaceUid));

                if (removeMapResult != FileSystemErrorStatus.OK)
                {
                    _log.LogInformation($"Removing surveyed surface existence map for surveyed surface {surveySurfaceUid} project {siteModelUid} failed with error {removeMapResult}");
                }

                Store(siteModelUid, ss);
            }

            return(result);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Removes the content of the proofing run list from the persistent store
 /// </summary>
 public static void RemoveFromPersistentStoreStatic(Guid projectUid, IStorageProxy storageProxy)
 {
     storageProxy.RemoveStreamFromPersistentStore(projectUid, FileSystemStreamType.MachineDesigns, LIST_STREAM_NAME);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Removes the content of the machines list from the persistent store
 /// </summary>
 public static void RemoveFromPersistentStore(Guid dataModelId, IStorageProxy storageProxy)
 {
     storageProxy.RemoveStreamFromPersistentStore(dataModelId, FileSystemStreamType.Machines, MACHINES_LIST_STREAM_NAME);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Removes the content of the proofing run list from the persistent store
 /// </summary>
 public static void RemoveFromPersistentStore(Guid dataModelId, IStorageProxy storageProxy)
 {
     storageProxy.RemoveStreamFromPersistentStore(dataModelId, FileSystemStreamType.ProofingRuns, PROOFING_RUN_LIST_STREAM_NAME);
 }