PureEngage On-Premises

 View Only

Sign Up

Expand all | Collapse all

Java PSDK 8.5 - How to work out if a ConfObjectDelta contains any differences?

  • 1.  Java PSDK 8.5 - How to work out if a ConfObjectDelta contains any differences?

    Posted 01-19-2015 05:20
    Hello all,
    I am using the new java PSDK 8.5, specifically the ConfObject and the ConfObjectDelta classes.

    So I have 2 ConfObject instances which I need to work out if the 2 objects are different/equivalent.

    I see there is a ConfDeltaUtility.createDelta(ConfObject originalObject, ConfObject changedObject)
    which returns a ConfObjectDelta. This is really handy.

    My problem is that when the 2 objects have identical values, it still returns a ConfObjectDelta
    containing only the DBID.
    I cannot work out if there was a difference at all in the result
    cos there are no inspector functions to query the object
    to see if there are other attributes apart from the DBID.

    This resulting ConfObjectDelta when both objects are the same looks like the following,
    with only the DBID (which has to be present)

    Code: [Select]
    ConfObjectDelta(CfgDeltaDN) {
    "deltaDN" = ConfObject(CfgDN) {
    "DBID" = 10982
    }
    }

    I want to know how one would work out if the objects are the same.
    There is no way I can see to 'examine/access' this object to see that there are
    no attributes apart from the DBID.

    Doing an .equals() wont work for me cos the it's not the same instance, just an instance with same values.

    Any ideas?

    Many thanks in advance,
    Chai


  • 2.  RE: Java PSDK 8.5 - How to work out if a ConfObjectDelta contains any differences?

    Posted 02-10-2015 09:59
    Actually during creation of delta PSDK  adds  element 'DBID' into the delta as key (always, without any conditions).
    But DBID is not single possible key. Some objects can contain multiple keys, some keys can have name different of 'DBID'.
    Configuration Server has internal parser of delta which can detect that delta is empty.
    Unfortunately PSDK direct works with delta only in COM AB and it doesn't analize that delta is empty because COM AB has different mechanism to detect it.
    PSDK  does not provide a helper to detect of empty delta.
    Unfortunately PSDK doesn't provide overloaded method .Equals for CfgObject and its child objects.
    So the possible solution - create a Feature Request to implement requested functionality.