Class DifferenceHelper
java.lang.Object
com.orchestranetworks.service.comparison.DifferenceHelper
This class is the common entry point for performing data comparisons.
Resolved mode
When resolved mode is used:
- Inheritance is taken into account, meaning that if two values are inherited and different, a difference is detected
- Computed fields are also taken into account.
Conversely, disabling the resolved mode means to focus on the raw persisted data:
- Inheritance is not taken into account. If
two values are both inherited, then they are not considered to be different because they are both equal
to
AdaptationValue.INHERIT_VALUE(result is independent of the values actually inherited). - Computed fields are ignored.
Node comparison modes
A terminal node can have a comparison mode, which controls whether or not it is included during comparisons. Node that have the comparison modeignored are not omitted from comparisons, even if their values
contain
differences.- See Also:
-
NodeComparisonMode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DifferenceBetweenTablescompareAdaptationTables(AdaptationTable tableOnLeft, AdaptationTable tableOnRight, boolean isResolvedMode) Performs a comparison between two tables.static DifferenceBetweenInstancescompareDatasetByDate(Adaptation aDataset, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataset and returns the result.static DifferenceBetweenInstancescompareDatasetByDate(Adaptation aDataset, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataset and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenInstancescompareDatasetByTransactionID(Adaptation aDataset, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction for a dataset and returns the result.static DifferenceBetweenInstancescompareDatasetByTransactionID(Adaptation aDataset, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction for a dataset and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenHomescompareDataspaceByDate(AdaptationHome aDataspace, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataspace and returns the result.static DifferenceBetweenHomescompareDataspaceByDate(AdaptationHome aDataspace, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataspace and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenHomescompareDataspaceByTransactionID(AdaptationHome aDataspace, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transactions for a dataspace or a snapshot and returns the result.static DifferenceBetweenHomescompareDataspaceByTransactionID(AdaptationHome aDataspace, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transactions for a dataspace or a snapshot and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenHomescompareHomes(AdaptationHome leftHome, AdaptationHome rightHome, boolean isResolvedMode) Compares two dataspaces or snapshots and returns the result.static DifferenceBetweenInstancescompareInstances(Adaptation instanceOnLeft, Adaptation instanceOnRight, boolean isResolvedMode) Performs a comparison between two datasets.static DifferenceBetweenOccurrencescompareOccurrences(Adaptation recordOnLeft, Adaptation recordOnRight, boolean isResolvedMode) Performs a comparison between two records.static DifferenceBetweenOccurrencescompareOccurrences(Adaptation recordOnLeft, Adaptation recordOnRight, boolean isResolvedMode, boolean showDetails) Performs a comparison between two records.static DifferenceBetweenOccurrencescompareRecordByDate(Adaptation aRecord, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a record and returns the result.static DifferenceBetweenOccurrencescompareRecordByDate(Adaptation aRecord, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a record and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenOccurrencescompareRecordByTransactionID(Adaptation aRecord, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a record and returns the result.static DifferenceBetweenOccurrencescompareRecordByTransactionID(Adaptation aRecord, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a record and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenTablescompareTableByDate(AdaptationTable table, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a table and returns the result.static DifferenceBetweenTablescompareTableByDate(AdaptationTable table, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a table and returns the result.The comparison operates in unresolved mode by default.static DifferenceBetweenTablescompareTableByTxId(AdaptationTable table, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a table and returns the result.static DifferenceBetweenTablescompareTableByTxId(AdaptationTable table, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a table and returns the result.The comparison operates in unresolved mode by default.
-
Constructor Details
-
DifferenceHelper
public DifferenceHelper()
-
-
Method Details
-
compareHomes
public static DifferenceBetweenHomes compareHomes(AdaptationHome leftHome, AdaptationHome rightHome, boolean isResolvedMode) Compares two dataspaces or snapshots and returns the result.- Parameters:
leftHome- dataspace or snapshot on left to use for comparison.rightHome- dataspace or snapshot on right to use for comparison.isResolvedMode- specifies whether or not the comparison is in resolved mode.- Throws:
IllegalArgumentException- if one of the specified arguments isnull.
-
compareDataspaceByTransactionID
public static DifferenceBetweenHomes compareDataspaceByTransactionID(AdaptationHome aDataspace, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transactions for a dataspace or a snapshot and returns the result.The comparison operates in unresolved mode by default.- Parameters:
aDataspace- dataspace or snapshot to use for comparison.aStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationHomeisnullor if one of the specified transaction ids is negative.- Since:
- 6.2.1
-
compareDataspaceByTransactionID
public static DifferenceBetweenHomes compareDataspaceByTransactionID(AdaptationHome aDataspace, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transactions for a dataspace or a snapshot and returns the result.- Parameters:
aDataspace- dataspace or snapshot to use for comparison.isResolvedMode- specifies whether or not the comparison is in resolved mode.aStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationHomeisnullor if one of the specified transaction ids is negative.- Since:
- 6.1.3
-
compareDataspaceByDate
public static DifferenceBetweenHomes compareDataspaceByDate(AdaptationHome aDataspace, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataspace and returns the result.The comparison operates in unresolved mode by default.- Parameters:
aDataspace- the dataspace to compareaStartDate- the start transaction idaEndDate- the end transaction id- Throws:
IllegalArgumentException- if one of the specified arguments isnull.- Since:
- 6.2.1
-
compareDataspaceByDate
public static DifferenceBetweenHomes compareDataspaceByDate(AdaptationHome aDataspace, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataspace and returns the result.- Parameters:
aDataspace- the dataspace to compareisResolvedMode- specifies whether or not the comparison is in resolved mode.aStartDate- the start transaction idaEndDate- the end transaction id- Throws:
IllegalArgumentException- if one of the specified arguments isnull.- Since:
- 6.1.3
-
compareInstances
public static DifferenceBetweenInstances compareInstances(Adaptation instanceOnLeft, Adaptation instanceOnRight, boolean isResolvedMode) Performs a comparison between two datasets.- Parameters:
instanceOnLeft- dataset on left to use for comparison.instanceOnRight- dataset on right to use for comparison.isResolvedMode- specifies whether the comparison is in resolved mode.- Throws:
IllegalArgumentException- if one of the specified arguments isnull.
-
compareDatasetByTransactionID
public static DifferenceBetweenInstances compareDatasetByTransactionID(Adaptation aDataset, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction for a dataset and returns the result.- Parameters:
aDataset- the dataset to be comparedisResolvedMode- specifies whether the comparison is in resolved mode.aStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationisnullor if it is a table record or one of the specified transaction ids is negative.- Since:
- 6.1.3
-
compareDatasetByTransactionID
public static DifferenceBetweenInstances compareDatasetByTransactionID(Adaptation aDataset, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction for a dataset and returns the result.The comparison operates in unresolved mode by default.- Parameters:
aDataset- the dataset to be comparedaStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationisnullor if it is a table record or one of the specified transaction ids is negative.- Since:
- 6.2.1
-
compareDatasetByDate
public static DifferenceBetweenInstances compareDatasetByDate(Adaptation aDataset, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataset and returns the result.The comparison operates in unresolved mode by default.- Parameters:
aDataset- the Dataset to compareaStartDate- the start dateaEndDate- the end date- Throws:
IllegalArgumentException- if one of the specified arguments isnullor if the specifiedAdaptationis a table record.- Since:
- 6.2.1
-
compareDatasetByDate
public static DifferenceBetweenInstances compareDatasetByDate(Adaptation aDataset, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two transaction dates for a dataset and returns the result.- Parameters:
aDataset- the Dataset to compareisResolvedMode- specifies whether the comparison is in resolved mode.aStartDate- the start dateaEndDate- the end date- Throws:
IllegalArgumentException- if one of the specified arguments isnullor if the specifiedAdaptationis a table record.- Since:
- 6.1.3
-
compareAdaptationTables
public static DifferenceBetweenTables compareAdaptationTables(AdaptationTable tableOnLeft, AdaptationTable tableOnRight, boolean isResolvedMode) Performs a comparison between two tables.- Parameters:
tableOnLeft- table on left to use for comparison.tableOnRight- table on right to use for comparison.isResolvedMode- specifies whether the comparison is in resolved mode.- Throws:
IllegalArgumentException- if one of the specified arguments isnullor if tables do not have the same primary key definition.
-
compareTableByTxId
public static DifferenceBetweenTables compareTableByTxId(AdaptationTable table, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a table and returns the result.The comparison operates in unresolved mode by default.- Parameters:
table- the tableaStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationTableisnullor if one of the specified transaction ids is negative.- Since:
- 6.2.1
-
compareTableByTxId
public static DifferenceBetweenTables compareTableByTxId(AdaptationTable table, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a table and returns the result.- Parameters:
table- the tableisResolvedMode- specifies whether the comparison is in resolved mode.aStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationTableisnullor if one of the specified transaction ids is negative.- Since:
- 6.1.3
-
compareTableByDate
public static DifferenceBetweenTables compareTableByDate(AdaptationTable table, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a table and returns the result.- Parameters:
table- the table to compareisResolvedMode- specifies whether the comparison is in resolved mode.aStartDate- the start dateaEndDate- the end date- Throws:
IllegalArgumentException- if one of the specified arguments isnull.- Since:
- 6.1.3
-
compareTableByDate
public static DifferenceBetweenTables compareTableByDate(AdaptationTable table, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a table and returns the result.The comparison operates in unresolved mode by default.- Parameters:
table- the table to compareaStartDate- the start dateaEndDate- the end date- Throws:
IllegalArgumentException- if one of the specified arguments isnull.- Since:
- 6.2.1
-
compareOccurrences
public static DifferenceBetweenOccurrences compareOccurrences(Adaptation recordOnLeft, Adaptation recordOnRight, boolean isResolvedMode) Performs a comparison between two records.This method is equivalent to
compareOccurrences(recordOnLeft, recordOnRight, isResolvedMode, false). That is, it does show details on terminal complex nodes.- Parameters:
recordOnLeft- record on left to use for comparison.recordOnRight- record on right to use for comparison.isResolvedMode- specifies whether the comparison is in resolved mode.- Throws:
IllegalArgumentException- if one of the specified arguments isnull.
-
compareOccurrences
public static DifferenceBetweenOccurrences compareOccurrences(Adaptation recordOnLeft, Adaptation recordOnRight, boolean isResolvedMode, boolean showDetails) Performs a comparison between two records.- Parameters:
recordOnLeft- record on left to use for comparison.recordOnRight- record on right to use for comparison.isResolvedMode- specifies whether the comparison is in resolved mode.showDetails- iftrue, differences on terminal complex nodes are detailed; iffalse, comparison stops on terminal node elements even if they are complex.showDetailsis forced tofalseifisResolvedModeis set tofalse.- Throws:
IllegalArgumentException- if one of the specified arguments isnull.
-
compareRecordByTransactionID
public static DifferenceBetweenOccurrences compareRecordByTransactionID(Adaptation aRecord, boolean isResolvedMode, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a record and returns the result.Returns
nullif there is no differences between the two specified transactions.- Parameters:
aRecord- the record to compareisResolvedMode- specifies whether the comparison is in resolved mode.aStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationisnullor if it is not a table record or if one of the specified transaction ids is negative.- Since:
- 6.1.3
-
compareRecordByTransactionID
public static DifferenceBetweenOccurrences compareRecordByTransactionID(Adaptation aRecord, long aStartTransactionId, long aEndTransactionId) Performs a comparison between two transaction times for a record and returns the result.The comparison operates in unresolved mode by default.Returns
nullif there is no differences between the two specified transactions.- Parameters:
aRecord- the record to compareaStartTransactionId- the start transaction idaEndTransactionId- the end transaction id- Throws:
IllegalArgumentException- if the specifiedAdaptationisnullor if it is not a table record or if one of the specified transaction ids is negative.- Since:
- 6.2.1
-
compareRecordByDate
public static DifferenceBetweenOccurrences compareRecordByDate(Adaptation aRecord, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a record and returns the result.The comparison operates in unresolved mode by default.Returns
nullif there is no differences between the two specified dates.- Parameters:
aRecord- the record to compareaStartDate- the start dateaEndDate- the end date- Throws:
IllegalArgumentException- if the specifiedAdaptationisnullor if it is not a table record.- Since:
- 6.2.1
-
compareRecordByDate
public static DifferenceBetweenOccurrences compareRecordByDate(Adaptation aRecord, boolean isResolvedMode, Date aStartDate, Date aEndDate) Performs a comparison between two dates for a record and returns the result.Returns
nullif there is no differences between the two specified dates.- Parameters:
aRecord- the record to compareisResolvedMode- specifies whether the comparison is in resolved mode.aStartDate- the start dateaEndDate- the end date- Throws:
IllegalArgumentException- if the specifiedAdaptationisnullor if it is not a table record.- Since:
- 6.1.3
-