+

Search Tips   |   Advanced Search

Delta Entry

A Delta Entry is an Entry that posseses all features and functions of a regular Entry. In addition to that the Delta Entry also contains delta operation codes. They indicate the type of change applied to the Entry – add, delete, modify or unchanged. The delta operation codes can be attached to Entries, Attributes and values to reflect their particular changes.


Overview

The process of assigning delta operation codes is called delta tagging and the delta codes are referred to as operation codes and delta tags. In a few words, the Delta Entry is actually a Delta tagged regular Entry. Here is an example of a regular Entry and a Delta Entry.Regular Entry:
{
	"#type": "generic",
	"#count": 3,
	"UserName": 
		"#type": "replace",
		"#count": 1,"tanders",
	"FullName": 
		"#type": "replace",
		"#count": 1,"Teddy Anderson",
	"id": 
		"#type": "replace",
		"#count": 1,"66"
}
Delta Entry:
{
	"#type": "modify",
	"#count": 3,
	"@delta.old": "{
	"UserName": "manders",
	"FullName": "Mary Anderson",
	"id": "66"
	}",
	"UserName": [
		"#type": "modify",
		"#count": 2,
		"tanders",
		"manders"
	],
	"FullName": [
		"#type": "replace",
		"#count": 1,
		"Mary Anderson"
	],
	"id": 
		"#type": "unchanged",
		"#count": 1,"66"
}

The process of evaluation of delta codes goes from top to bottom or from Entry level → Attribute level → AttributeValue level. The operation at the higher level takes precedence.

If an Entry operation is delete all other delta tags are ignored. If it is replace, modify or add the evaluation continues with the Attributes delta tags.

If an Attribute is tagged as delete, add or replace the delta tags of its values are ignored. Only if an Attribute is tagged as modify, the ' delta tags of AttributeValues will be considered. These delta tags indicate that AttributeValues can have different operation codes (for example, some of them are added and others deleted).

The AttributeValue delta tags have the following meaning in the context of Delta tagging:

Delta Entries are produced by the following components:

  1. Connectors in Iterator mode with enabled Delta;
  2. Change Detection Connectors;
  3. LDIF and DSMLv2 Parser when reading.

They are consumed by these components:

  1. Connectors in Delta mode;
  2. LDIF and DSMLv2 Parser when writing;
  3. Connectors in Update mode.


Getting and setting Delta operation codes using Script

Delta tagging is supported at Entry, Attribute and AttributeValue level. Here is how we can get/set the Entry operation using script:
var entryOper = work.getOperation();		//get Entry operations as string (e.g. 'add')
var entryOp = work.getOp();						//get Entry operations as char (e.g. 'a')

work.setOperation(“modify”);						//set Entry operation 
work.setOp ('m');
If you want to set/get the Delta flags for an Attribute we can do that with the following code:
var attr = work.getAttribute(“sn”);			// get Attribute object

var attrOper = attr.getOperation();			// get delta operation as string (e.g. 'replace')
var attrOp = attr.getOper();						// get delta operation as char (e.g. 'r')

attr.setOperation(“replace”);					// set Attribute delta operation
attr.setOper('r');
Delta tags at the AttributeValue level can be set/get using this script:
var attr = work.getAttribute(“sn”);			// get Attribute object

var valOper = attr.getValueOperation(0);// get value delta operation for first value
var valOp = attr.getValueOper(0);

attr.setValueOperation(1, “add”);				// set value delta operation for second value
attr.setValueOper(1, 'a');


Parent topic:

Delta Features