Specifies a revision manifest root declare, each followed by root and object extended GUIDs.
Inheritance: StreamObject
Esempio n. 1
0
        private List <RevisionStoreObjectGroup> ParseObjectGroup(CellID objectGroupCellID, MSOneStorePackage package)
        {
            StorageIndexCellMapping         storageIndexCellMapping = package.FindStorageIndexCellMapping(objectGroupCellID);
            CellManifestDataElementData     cellManifest            = this.FindCellManifest(storageIndexCellMapping.CellMappingExtendedGUID);
            List <RevisionStoreObjectGroup> objectGroups            = new List <RevisionStoreObjectGroup>();

            package.CellManifests.Add(cellManifest);
            StorageIndexRevisionMapping revisionMapping =
                package.FindStorageIndexRevisionMapping(cellManifest.CellManifestCurrentRevision.CellManifestCurrentRevisionExtendedGUID);
            RevisionManifestDataElementData revisionManifest =
                this.FindRevisionManifestDataElement(revisionMapping.RevisionMappingExtendedGUID);

            package.RevisionManifests.Add(revisionManifest);
            RevisionManifestRootDeclare encryptionKeyRoot = revisionManifest.RevisionManifestRootDeclareList.Where(r => r.RootExtendedGUID.Equals(new ExGuid(3, Guid.Parse("4A3717F8-1C14-49E7-9526-81D942DE1741")))).SingleOrDefault();
            bool isEncryption = encryptionKeyRoot != null;

            foreach (RevisionManifestObjectGroupReferences objRef in revisionManifest.RevisionManifestObjectGroupReferencesList)
            {
                ObjectGroupDataElementData dataObject = objectGroupDataElements.Where(d => d.DataElementExtendedGUID.Equals(
                                                                                          objRef.ObjectGroupExtendedGUID)).Single().Data as ObjectGroupDataElementData;

                RevisionStoreObjectGroup objectGroup = RevisionStoreObjectGroup.CreateInstance(objRef.ObjectGroupExtendedGUID, dataObject, isEncryption);
                objectGroups.Add(objectGroup);
            }

            return(objectGroups);
        }
        /// <summary>
        /// This method is used to test revision manifest root declaration related adapter requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param> 
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyRevisionManifestRootDeclare(RevisionManifestRootDeclare instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the RevisionManifestRootDeclare related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type RevisionManifestRootDeclare is null due to parsing error or type casting error.");
            }

            // Verify the stream object header related requirements.
            this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site);

            // Directly capture requirement MS-FSSHTTPB_R296, if the stream object header is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     296,
                     @"[In Revision Manifest Data Elements] Revision Manifest Root Declare (2 bytes, optional): Zero or more 16-bit stream object header that specifies a revision manifest root declare, each followed by root and object extended GUIDs.");

            // Directly capture requirement MS-FSSHTTPB_R297, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     297,
                     @"[In Revision Manifest Data Elements] Root Extended GUID (optional, variable): An extended GUID that specifies the root revision for each revision manifest root declare.");

            // Directly capture requirement MS-FSSHTTPB_R298, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     298,
                     @"[In Revision Manifest Data Elements] Object Extended GUID (optional, variable): An extended GUID that specifies the object for each revision manifest root declare.");

            // Verify the stream object header related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }