none
Enable delta imports in ECMA 2.2 and delta import logic RRS feed

  • Question

  • Hi,

    How can I enable delta imports in my ECMA?

    I've added the flag to my capabilities, but when I connect to the DLL the MA doesn't recognize delta import capability, and neither does it let me create a delta import profile. Here's my capabilities code:

    public MACapabilities Capabilities
            {
                get
                {
                    MACapabilities myCapabilities = new MACapabilities();
                    myCapabilities.ExportType = MAExportType.AttributeUpdate;
                    myCapabilities.ConcurrentOperation = true;
                    myCapabilities.ObjectRename = false;
                    myCapabilities.DeleteAddAsReplace = true;
                    myCapabilities.DeltaImport = true; // Enable delta imports?
                    myCapabilities.DistinguishedNameStyle = MADistinguishedNameStyle.None;
                    myCapabilities.NoReferenceValuesInFirstExport = false;
                    myCapabilities.Normalizations = MANormalizations.None;
                    return myCapabilities;
                }
            }


    On the same topic, the logic I had in mind for handling delta imports would be to get a list of all the objects in the relevant external system and then iterate over each CSEntry object in the connector space to see if the object already exists (by comparing the anchor attribute). If it exists, skip it otherwise create a new CSEntry object. It still seems like a lot of work, specially to iterate through all the existing objects in both the external system and in the connector space, so is there any quicker way to do a delta import?

    Thanks a lot, and sorry for being a pest on your forums lately :)

    Thursday, June 13, 2013 4:46 PM

Answers

  • I don't see anything wrong in your code. Can you make you are referring to the correct dll file? This will work for a ECMA2 management agent. I believe you are working on a ECMA2.  

    What I have done in the past for delta is to monitor the last modified date. When I do a import delta/full I store a watermark of the datetime when the import was done. You can store it using OpenImportConnectionResults(customData). If the next import is a delta, then I read this datetime and query all the objects that have been modified since this datetime. Then I pass the resulting objects as usual using GetImportEntriesResults class. 

    • Marked as answer by kmittal82 Monday, June 17, 2013 9:37 PM
    Sunday, June 16, 2013 3:33 PM

All replies

  • I don't see anything wrong in your code. Can you make you are referring to the correct dll file? This will work for a ECMA2 management agent. I believe you are working on a ECMA2.  

    What I have done in the past for delta is to monitor the last modified date. When I do a import delta/full I store a watermark of the datetime when the import was done. You can store it using OpenImportConnectionResults(customData). If the next import is a delta, then I read this datetime and query all the objects that have been modified since this datetime. Then I pass the resulting objects as usual using GetImportEntriesResults class. 

    • Marked as answer by kmittal82 Monday, June 17, 2013 9:37 PM
    Sunday, June 16, 2013 3:33 PM
  • Thanks for your reply, I created a new MA and linked it with the same DLL and it worked! My DLL initially didn't support delta imports so I had disabled it but I didn't create a new MA after enabling delta imports, it looks like if run profiles are changed then a new MA must be created

    Good logic for doing delta imports, but I'm stuck a bit on that (sorry I'm very new to writing MA code and there is a severe lack of documentation/examples around it)

    How do I store the Date of the last import? Every time I invoke the import, the OpenImportConnection method is called, which means everytime the datetime is set and passed. I need some way of telling the function pass only the last datetime of when OpenImportConnection was called, but I don't know how to do that. My current code for OpenImportConnection is:

    public OpenImportConnectionResults OpenImportConnection(
                                           KeyedCollection<string, ConfigParameter> configParameters,
                                           Schema types,
                                           OpenImportConnectionRunStep importRunStep)
            {
                m_importOperation = importRunStep.ImportType;
                return new OpenImportConnectionResults(DateTime.Now.ToString());
            }

    I know the above won't work since I'm not storing the datetime of the last time OpenImportConnection is called, it simply passes the DateTime when the import operation is called. I can't figure out how to save the datetime of the most recent import operation (I tried using a static variable to do that, but that didn't help either)

    Thanks a lot for your help





    • Edited by kmittal82 Monday, June 17, 2013 1:37 PM
    Monday, June 17, 2013 11:12 AM
  • In answer to my own question above, I *think* I understood the problem, I need to set the CustomData from the GetImportEntriesResult function as well, that is what is passed back to OpenImportConnection (as found in http://mssecurityengineer.blogspot.co.uk/2012/08/release-notes-for-forefront-identity.html)

    Will update this post if it works


    • Edited by kmittal82 Monday, June 17, 2013 2:00 PM
    Monday, June 17, 2013 1:59 PM
  • Yep, that was it, the code .CustomData property needs to be set from GetImportEntries. However, now I have some other questions relating to delta imports, but I'll post them in a separate thread. Thanks for all the help
    Monday, June 17, 2013 9:37 PM