bool IsObjectReplicated(DsServer orig, DsServer dest, NamingContext ncType, string objectDn) { // FIXME: likezh-11-06-2013: // Correct me if this is wrong, but it seems to be working quite well... // // The property is replicated if it meets: // - The originating USN of the property in orig is less or equal to the one in dest // First get the UTD in dest UPTODATE_VECTOR_V1_EXT utdVectorDest = ldapAdapter.GetReplUTD(dest, ncType); // No way to get the object metadata (ENTINF) thru LDAP, so try uSNChanged of the object instead. uint usnChanged = Convert.ToUInt32(ldapAdapter.GetAttributeValueInString(orig, objectDn, "uSNChanged")); for (int i = 0; i < utdVectorDest.cNumCursors; ++i) { UPTODATE_CURSOR_V1 cursor = utdVectorDest.rgCursors[i]; if (cursor.uuidDsa == orig.InvocationId) { long usnHigh = cursor.usnHighPropUpdate; BaseTestSite.Log.Add(LogEntryKind.Comment, "{0} - usnHigh: {1}, usnChanged: {2}", objectDn, usnHigh, usnChanged); if (usnHigh >= usnChanged) { return(true); } } } return(false); }
public static bool StampLessThanOrEqualUTD(DS_REPL_ATTR_META_DATA stamp, UPTODATE_VECTOR_V1_EXT utd) { for (int i = 0; i < utd.cNumCursors; ++i) { if (utd.rgCursors[i].uuidDsa == stamp.uuidLastOriginatingDsaInvocationID && utd.rgCursors[i].usnHighPropUpdate >= stamp.usnOriginatingChange) { return(true); } } return(false); }
public static bool StampLessThanOrEqualUTD(PROPERTY_META_DATA?stamp, UPTODATE_VECTOR_V1_EXT utd) { if (stamp == null) { return(false); } for (int i = 0; i < utd.cNumCursors; ++i) { if (utd.rgCursors[i].uuidDsa == stamp.Value.propMetadataExt.uuidDsaOriginating && utd.rgCursors[i].usnHighPropUpdate >= stamp.Value.propMetadataExt.usnOriginating) { return(true); } } return(false); }