meta (metacp)

Synopsis

[meta] addentry
    -entry entry_handle
    [-updateattr attribute_list]

[meta] appendresult
    -source source_search_result_handle
    -target target_search_result_handle

[meta] createindexlist
    [-exactaction]
    -conn connection_handle
    -handle index_list_handle
    [-type distinguished_name_syntax]

[meta] encryptdata
    -result result_handle
    -databindid data_bind_id
    -keybindid key_bind_id
    [-oldserialnumber old_serial_number]

[meta] encryptvalue string

[meta] escapechar string
    -characters characters

[meta] findentry
    -result result_handle
    -name distinguished_name or attribute_value
    -entry entry_handle
    [-getattr flag]
    [-tag tag]
    [-numbermatches number_variable]

[meta] getchangelog
    -name distinguished_name
    -changetype operation_change_type
    -changes list of changes
    -source handle_to_pseudo_LDIF-file
    -target entry_handle

[meta] getentry
    -source source_handle
    {-target entry_handle [-tag tag] [-mark]
    [-name distinguished_name [-countmatches flag]] |
    -reset}

[meta] gethandle
    -entry entry_handle
    -conn connection_handle

[meta] getnumentries
    -result result_handle

[meta] getstatistic statistic_variable

meta help [operation | -verbose]

[meta] initialize
    -file trace_file
    [-tracelevel level]
    [-maxtracerecords recordnumber]
    [-maxentries number]
    [-mode initialization_mode]
    [-nostatistics]

[meta] modifydn
    -entry entry_handle

[meta] modifyentry
    -newentry entry_handle
    [-oldentry entry_handle]
    [-tag tag]
    [-allowrename rename_flag]
    [-updateinfo update_flag]
    [-updateattr attribute_list]

[meta] openconn
    -type directory_type
    [-file filename -mode file_open_mode
    [-format file_format] [encoding encoding]]
    [-attribute attribute_list [-processallattr]]
    -attrconf attr_conf_handle
    -conn connection_handle
    [-bindid binding_id]
    [-ldifhandle LDIF_file_handle]

[meta] openldif
    -file filename
    -ldifhandle LDIF_file_handle

meta operations

[meta] readattrconf
    -file filename
    -attrconf attr_conf_handle
    [-encoding encoding]

[meta] releasehandle handle

[meta] removeentries
    -handle handle
    [-tag tag]

[meta] sortindexlist -handle index_list_handle
    [-keepnames index_list_access_flag]

[meta] sortresult
    -result result_handle
    -order sort_order
    [-key sort_key]

[meta] supinfo
    -rdn attribute_type
    {-attribute attribute_value | -remove}
    [-bindid binding_id]

[meta] terminate

[meta] unescapechar string

[meta] writeindexlist
    -handle index_list_handle
    -name distinguished_name
    -entry entry_handle

[meta] writerecord
    -entry entry_handle

[meta] writetext
    -conn connection_handle
    -text string
    [-nonewline flag]

[meta] writetrace
    -text string
    [-handle handle]

Purpose

A metacp object that performs directory synchronization operations.

Arguments

handle

A meta handle to be released by the releasehandle operation. A meta handle is a handle created by a meta operation that is associated with metacp information. The following table describes the types of meta handles.

Handle Type Associated Information Created by Dependencies

attribute configuration file handle

Attribute configuration file

meta readattrconf

none

connection handle

connected directory (file, DAP or LDAP)

meta openconn

attribute configuration file handle

result handle

search results list

obj search

meta appendresult

connection handle

entry handle

directory entry
directory entry
entry template

meta findentry
meta getentry
meta gethandle

result handle
result or connection handle
connection handle

index list handle

index list

meta createindexlist

connection handle

LDIF file handle

LDIF-CHANGE output

meta openconn

none

operation

The name of the meta operation for which to display help information.

string

The string to be processed (for example, in an escapechar operation).

Operations

meta addentry

Creates a new entry in the Identity store (a connected directory of type LDAP). The syntax is as follows:

[meta] addentry
    -entry entry_handle
    [-updateattr attribute_list]

Options

-entry entry_handle

A required option that specifies the handle to the entry to be added. Specify the name of an entry handle created by a meta gethandle operation called with a -conn option that specifies a connection handle to a connected directory of type LDAP.

-updateattr attribute_list

An optional parameter that specifies an additional attribute list. All these attributes are created together with the information associated with entry_handle. The attribute list has to be specified in native LDAP syntax, e. g.

[meta] addentry entry new_entry updateattr dxmState=NEW

Using the -updateattr switch allows to handle additional attributes which normally should not be synchronized under any circumstances. (Otherwise these attributes must have been selected in the associated entry_handle and therefore are always subject to synchronization. Thats not desirable in any cases.)

The addentry operation adds the entry associated with entry_handle into the Identity store (a connected directory of type LDAP). The Tcl variable array associated with entry_handle must contain a value for the Directory-Distinguished-Name (DDN) attribute. The add entry operation uses this value for the entry name when it creates the entry. The attributes that the operation creates for the entry correspond to the set of attributes present in the Tcl variable array associated with entry_handle.

The addentry operation creates the necessary superior entries when creating the entry provided that the required attribute information has been specified with a supinfo operation.

If the underlying connection handle (derived from entry_handle) is an LDAP directory with the parameter -ldifhandle set, the addentry is not applied to the LDAP directory; instead, an LDIF-CHANGE operation is created in the LDIF-CHANGE file associated with -ldifhandle parameter.

metacp automatically propagates a JMS message (containing the SPML add request) if at the beginning of a synchronization scenario ats initialize has been called with the options -topicprefix, -type, -cluster, and -resource. (See ats initialize for details.)

Return Values

Check the Tcl variable errorCode for error details. If this variable is not set or its value is empty, the entry was successfully created. Otherwise the error is logged in the trace file and the entry was not created.

0 The object creation succeeded, or it failed with an error that did not prevent further processing of operations in the Tcl script logic.

1

The object creation failed with a serious error; for example, "LDAP server not available". Examine your Tcl script logic to determine whether it makes sense to terminate the Tcl synchronization script.

Example

meta addentry -entry en

See Also

gethandle, initialize, openconn, openldif, supinfo, ats initialize

meta appendresult

Appends a new search result to an already existing search result. The syntax is as follows:

[meta] appendresult
    -source source_search_result_handle
    -target target_search_result_handle

Options

-source source_search_result_handle

A required option that specifies a search result (identified by its source_search_result_handle name) that should be appended to an already existing search result (identified by its target search result handle name). Specify the name of a search result handle created by a obj search operation called with a -conn option that specifies a connection handle to a connected directory of type LDAP.

-target target_search_result_handle

A required option that specifies a search result (identified by its target_search_result_handle name) that should be extended by another search result. Specify the name of a search result handle created by a obj search operation called with a -conn option that specifies a connection handle to a connected directory of type LDAP. If the target search result handle does not exist, then it will be created and the final search result is an exact copy of the source search result.

The appendresult operation appends a search result (identified by the source_search_result_handle) to an already existing target search result. If the target result does not exist as yet, the target search result handle will be created and consists of all the entries from the source search result.

The two search results can only be merged if the following conditions are satisfied:

  • Both search results are based on the same connection identified by the -openconn connection option.

  • If the search results are sorted, both of them are sorted using the same sort key.

  • If the search results are sorted, both of them are sorted using the same sort order.

  • If the option -exactaction was used in the obj search opration, then it must have been used either for both the search operations or for none of them.

Only if these conditions are satisfied, the final search result is consistent again.

If the target search result was already sorted (using meta sortresult), then the final search result will be sorted again with the same sort criterias.

  • When using appendresult the user must guarantee that the same object does not exist several times in the final search result. Otherwise its not predictable, whether the operation meta addentry, meta modifyentry and meta removeentries are correctly called by a synchronization TCL script.

  • If meta getentry has already been applied to the target search result before calling meta appendresult and therefore the current position in the search result is not the beginning of the search result, the current position is of no use any longer. Therefore the current position is set to the beginning of the search result; meta getentry will return the entries from the beginning of the search result again.

Return Values

None.

Example

meta appendresult -source new_result -target merged_result

See Also

obj search

meta createindexlist

Creates a handle to an index list. The syntax is as follows:

[meta] createindexlist
    [-exactaction]
    -conn connection_handle
    -handle index_list_handle
    [-type distinguished_name_syntax]

Options

-exactaction

Normally DNs are defined as CaseIgnore strings which implies that leading and trailing spaces are ignored and several spaces are reduced to one space during comparisions. There are no problems when modifying such an object and a reduced number of spaces is passed in the DN; the objects are still considered to be the same and the MODIFY operation is performed successfully. There are directory systems, that want to have the exact number of spaces when calling the MODIFY operation. Therefore, multiple spaces must not be dropped.

Using the option -exactaction guarantees that multiple spaces in the DNs are not dropped. The DNs are provided to the user the same way as they are retrieved from the directory server.

-conn connection_handle

A required option that specifies a handle to a connected directory. Specify the name of a connection handle created by a meta openconn operation called with the -type option FILE.

-handle index_list_handle

A required option that specifies the name to be assigned to the index list handle returned by the operation.

-type distinguished_name_syntax

Specifies the distinguished name syntax for entries in the index list. Specify the keyword LDAP to create an index list for entry distinguished names in LDAP format.

The createindexlist operation initializes an empty index list template, creates a handle to it, and assigns it the name specified with the -handle option. The index list can then be used to sort the entries in the connected directory, rather than sorting the connected directory (which is a file) itself. The process for using an index list to sort directory entries is as follows:

  1. Create the index list with meta createindexlist

  2. For each entry in the connected directory:

    • Use the meta getentry operation to read the entry. The meta getentry operation returns an entry handle to the entry. Obtain the entry’s distinguished name either from the entry itself (if it is stored in the entry, it is available in a Tcl variable) or through a Tcl mapping procedure.

    • Use the meta writeindexlist operation to write the distinguished name of the entry and its entry handle returned by meta getentry into the index list.

  1. Use the meta sortindexlist operation to sort the entries in the index list according to distinguished name or any other attribute, in alphabetical (ascending) order.

You can then continue the directory synchronization process using the sorted index list rather than using the connected directory. For example, you can perform meta getentry operations on the sorted index list by specifying its index handle rather than specifying the connection handle to the connected directory.

The createindexlist operation stores the distinguished name syntax keyword specified in the -type option in the index list handle. The meta sortindexlist operation uses this information to determine how to process the distinguished names in the index list. If the -type option is not specified, the operation uses DAP distinguished name processing.

Return Values

None.

Example

meta createindexlist -conn file_ch -handle ih

See Also

getentry, sortindexlist, writeindexlist

meta encryptdata

Performs data encryption for a search result handle based on the private keys and certificates stored for the server (IdS-C) admistrator object cn=server_admin,dxmc=DirXmetahub. There is a support of both an initial mode (encryption of cleartext data with the public key having the highest serial number) and a migration mode which includes

  • encryption of cleartext data with the public key having the highest serial number

  • data previously encrypted with a public key of older serial number is decrypted and encrypted again with the latest public key.

The command syntax is as follows:

[meta] encryptdata
    -result result_handle
    -databindid data_bind_id
    -keybindid key_bind_id
    [-oldserialnumber old_serial_number]

Options

-result result_handle

Specifies the ldap search result handle which includes relevant objects and attributes relevant for data encryption. The result_handle must be a handle which respresents an ldap search result,

-databindid data_bind_id

Specifies the bind identifier required for performing the attribute modifications in the Directory. This bind identifier must be the same as the bind identifier related to result_handle, and a bind with protocol LDAPv3 must have been performed with bindid data_bind_id.

-keybindid key_bind_id

Specifies the bind identifier required for reading the keys and certificates from the Server (IDS-C) administrator object. A suitable bind with protocol LDAPv3 must have been performed with bindid key_bind_id.

-oldserialnumber old_serial_number

This parameter is optional, the default is NONE. Either omit this option or specify NONE if you intend to perform initial encryption. Specify a hexadecimal value (e.g. 6E) or the keyword PREVIOUS, if you intend to perform data encryption in migration mode. In this case, the environment variable _DXC_OLD_PIN must contain the PIN suitable to the private key with _old_serial_number.

Return Values

None.

Example

An encryptdata operation for initial encryption:

meta encryptdata result resultHandle \
      -databindid dataBindId \
      -keybindid keyBindId

An encryptdata operation for migration from old serial number 6E to current serial number:

meta encryptdata result resultHandle \
      -databindid dataBindId \
      -keybindid keyBindId \
      -oldserialnumber 6E

See Also

obj bind, obj search, initialize, encryptvalue

meta encryptvalue

Performs data encryption for a string based on the certificates stored for the Server (IDS-C) administrator object cn=server_admin,dxmc=DirXmetahub. It uses the public key (certificate) with the highest serial number.

That function is only available when metacp runs in encryption mode.

The syntax is as follows:

[meta] encryptvalue string

Options

none

Return Values

The encrypted string.

In case of errors, an error message is returned and the errorCode variable is set.

Example

The encryptvalue operation

meta encryptvalue dirx

returns the encrypted value base on the currently available public key.

See Also

encryptdata

meta escapechar

Escapes one or more characters in a string. The syntax is as follows:

[meta] escapechar string
    -characters characters

Options

-characters characters

Escapes the characters specified in characters.

The escapechar operation escapes one or more characters by prefixing them with the backslash character (\) and returns the escaped string as a result. The backslash character itself is escaped as well.

Use the -characters option to escape only those characters specified in characters. To avoid conflicts with the Tcl shell escape mechanism, enclose the string that contains the characters to be escaped in curly braces (\{ }). If curly braces are to be a part of the string, they must be escaped.

Return Values

The escaped string.

Example

The escapechar operation

meta escapechar f{1}=2 -characters {\{\}=}

returns the string f\{1\}\=2

See Also

unescapechar

meta findentry

Retrieves an entry from the sorted results of an obj search operation. The syntax is as follows:

[meta] findentry
    -result result_handle
    -name distinguished_name or attribute_value
    -entry entry_handle
    [-getattr flag]
    [-tag tag]
    [-numbermatches number_variable]

Options

-result result_handle

A required option that specifies a handle to a directory search results list. Specify the name of a result handle created by an obj search operation that has been sorted by a meta sortresult operation.

-name distinguished_name or attribute_value

A required option that specifies the distinguished name of the entry to be retrieved if the result list has been sorted according to DDN. Specify the complete distinguished name in the format:

distinguished_name

For example:

cn=mueller,ou=board,o=pqr,c=de

or the attribute type and value to be retrieved if the result has been sorted according to a sort criteria different than DDN. Specify the value in the format

attribute_type=attribute_value

For example:

employeeNumber=98765

-entry entry_handle

A required option that specifies a name to associate with the entry handle created by the operation (if it finds the entry in the search results list).

-getattr flag

Controls whether the entry handle created by the operation is associated with a Tcl variable array containing the entry’s attributes. Specify one of the following keywords:

  • TRUE-associate the entry handle with a Tcl variable array

  • FALSE-do not associate the entry handle with a Tcl variable array (default)

-tag tag

Specifies a marking action to be performed on the found entry in the search results list. Specify the keyword MARK in the tag argument to this option in order to mark the entry.

-numbermatches number_variable

If an LDAP result is sorted according to a sort criteria different than DDN, then multiple matches could be present.

Therefore, if -numbermatches with a TCL variable name number_variable is specified, then findentry returns the first matched entry together with the number of matched entry that is stored in a TCL variable with the given name. In that case, findentry internally sets the search result pointer to the matched entry. Using subsequent calls of getentry then allow to retrieve all the matching entries one after the other.

If -numbermatches is not specified, then the matching entry that is returned is unpredictable (as described in the current release of the document).

The findentry operation attempts to match the entry specified in the -name option to an entry within the directory search results specified in the -result option. On success, the operation creates an entry handle associated with the matched entry and assigns it the name specified in the -entry option. By default, the entry handle created by meta findentry is not associated with a Tcl variable array. Use the -getattr option to associate the handle with a Tcl variable array.

If the result list has been sorted according to any attribute type, then that attribute must be single-valued for all the entries of the search result. Entries that don’t hold that specific attribute type will be listed at the end of the sorted list (if sorting has been done in ascending order) or at the beginning of the sorted list (if sorting has been done in descending order). If several such entries exist, their position at the beginning or end of the sorted list is undefined. As a consequence, it is unpredictable which entry will be returned by a "meta findentry" operation that uses such an ambiguous value. Therefore, it is strongly recommended to use only attributes as sort_key (in meta sortresult) that are unique, like employee number.

Return Values

0 The entry was found

1 The entry was not found

Example

meta findentry -name cn=zahn,ou=sales,o=ibis,c=us \
        -result ldap_res -entry eh

See Also

getentry, modifyentry, removeentries, obj search

meta getchangelog

Processes an LDIF change log entry as provided, for example, by iPlanet or Oracle Internet Directory (OID). The syntax is as follows:

[meta] getchangelog
    -name distinguished_name
    -changetype operation_change_type
    -changes list of changes
    -source handle_to_pseudo_LDIF-file
    -target entry_handle

Options

-name distinguished_name

Specifies the target DN of the object that is listed in the change log entry.

-changetype operation_change_type

Specifies the kind of LDIF change operation: add, delete, modify, moddn, modrdn

-changes list_of_changes

Specifies the list of changes that have been applied to the given DN

-source handle_to_pseudo_LDIF-file

Specifies the name of a handle to a pseudo LDIF file

-target entry_handle

Specifies the name of an entry handle that is created by the operation in case of success

Both iPlanet and OID store all the changes of directory entries and attributes in the directory itself as directory entries (changelog entries). The getchangelog operation processes a change log entry that has been read either from an iPlanet or OID directory using an obj search operation. The relevant attributes (targetDN, changetype, changes) of such a changelog entry are passed to getchangelog; as the format of these parameters are exactly the same as if an LDIF change file had been read, getchangelog will internally concatenate the values of these parameters as a byte stream in memory and then use its internal LDIF file parser. (Therefore, a handle to a pseudo LDIF file must be passed as -source handle.)

On success, getchangelog creates a handle to the entry and associates it with the name in the target option. The entry’s DN and its attributes become accessible as an array of Tcl variables. For details, see the description of getentry.

Return Values

0 The entry was successfully processed

1 The entry could not be processed

Example

In this example, the change log entry has been read by obj search and its data is available in the Tcl array named chlog:

meta getchangelog
      -name           {[lindex $chlog(targetdn) 0]}     \
      -changetype {[lindex $rh_x500(changetype) 0]}   \
      -changes       {[lindex $rh_x500(changes) 0]}      \
      -source   file_ch     \
      -target    rh"]

See Also

getentry, Chapter: Processing of ChangeLogEntries

meta getentry

Reads the next entry from a connected directory, a search results list, or an index list, reads a specific entry from an index list, or resets a search results list or index list. The syntax is as follows:

[meta] getentry
    -source source_handle
    {-target entry_handle [-tag tag] [-mark]
    [-name distinguished_name [-countmatches flag]] |
    -reset}

Options

-source source_handle

A required option that specifies a handle to a connected directory, a search results list, or an index list.

  • To operate on a connected directory, specify the name of a connection handle created by a meta openconn operation called with the -type option FILE and the -mode option READ.

  • To operate on a search results list, specify the name of a result handle created by an obj search operation.

  • To operate on an index list, specify the name of an index list handle created by a meta createindexlist operation. The connection handle inherited by the specified index list handle must specify a connected directory that has been opened with the -type option FILE and the -mode option READ.

-target entry_handle

Specifies a name to assign to the entry handle created by the operation on success.

-tag tag

Specifies whether the next marked or unmarked entry is to be read, if the operation is reading entries from a search results list or an index list. Specify one of the following keywords:

  • MARKED-read next marked entry

  • NOTMARKED-read next unmarked entry (default)

-mark

Specifies that an entry that is returned from a search result or an index list should be marked or not.

If -mark is not given, the entry will not be marked.

The -mark option is ignored, if the source handle does not represent a search result or an index list.

-name distinguished_name

Specifies the distinguished name of the entry to be read, if the operation is reading entries from an index list. Specify the complete distinguished name in the format:

distinguished_name

For example:

cn=mueller,ou=board,o=pqr,c=de

-countmatches flag

Specifies whether a status code or the number of entries that match the distinguished name specified in the -name option is to be returned, if the operation is reading entries from an index list. Specify one of the following keywords:

  • TRUE-return the number of matched entries found in the index list

  • FALSE-return 0 on success or 1 on end of index list (default)

-reset

Specifies that the list is to be reset to its beginning, if the operation is reading entries from a search results list or an index list.

Use the getentry operation to:

  • Read entries sequentially from a connected directory (for example, an import file on disk) or a search results list

  • Read entries sequentially or randomly by distinguished name from an index list

  • Reset an index list or a search results list to the beginning of the list

Specify the -reset option to reset an index list or a search results list to the beginning of the list.

Specify the -target option to read an entry from a connected directory, a search results list, or an index list into the metacp workspace. On success, the operation creates a handle to the entry and associates it with the name specified in the -target option. When the getentry operation reads an entry into the metacp workspace, the entry’s attributes to be synchronized become accessible as an array of Tcl variables. Each Tcl variable in the array represents a specific attribute to be synchronized; the variable is a Tcl list of the attribute’s values. The Tcl variable array corresponds to the set of attributes to be synchronized (SSA); the SSA is defined:

  • In the connection handle specified in the -source option, when operating on a connected directory

  • In the connection handle referred to by the result handle specified in the -source option, when operating on a search results list

  • In the connection handle referred to by the index list handle specified in the -source option, when operating on an index list

The Tcl variable array created by the getentry operation also contains two special attributes:

  • A Directory-Distinguished-Name (DDN) attribute. A value exists for this attribute when operating on a search results list, on an index list, or on a connected directory of type FILE that supplies the entry distinguished name as a specific attribute.

  • An LDIF "changetype" (_ldif_opcode) attribute. A value exists for this attribute when operating on a connected directory opened with the -format option LDIF-CHANGE and indicates that the entry specifies a type of directory modification. For valid handles with format LDIF-CHANGE, the value is one of ADD, DELETE, MODIFY or MODIFY-DN. If metacp fails to recognize the "changetype" attribute value when it reads an LDIF change entry, then the value will be an empty string. It is the responsibility of the user (or the metacp script author) to take the appropriate action (or error handling) depending on the attribute value. See the "LDIF Change Format" section in Chapter 3 (Directory Data File Formats) for more information about LDIF change file format and the types of directory modifications an entry in an LDIF change file can represent.

Use the Tcl notation $*entry_handle(abbreviation)* to reference an element of the Tcl variable array, where entry_handle is the name of the handle and abbreviation is the attribute abbreviation for the attribute defined in the Abbreviation (Abbr) field of the attribute configuration file. For example, suppose that:

  • The set of attributes to be synchronized are the attribute types Given Name, Surname, and Telephone Number

  • The attribute abbreviations defined in the attribute configuration file are givenName, sn, and telephoneNumber

  • The attribute abbreviation for Directory-Distinguished-Name defined in the attribute configuration file is DDN

  • The attribute abbreviation defined in the attribute configuration file for the attribute that holds an entry operation code is LCHNGTYPE

  • The name supplied for the entry handle created by the getentry operation is eh

Then the indexes to the values for these attributes in the Tcl array are

$eh(DDN) - to access the attribute value(s) for Directory-Distinguished-Name

$eh(LCHNGTYPE) - to access the attribute value for the entry operation code

$eh(givenName) - to access the attribute value(s) for Given Name

$eh(sn) - to access the attribute value(s) for Surname

$eh(telephoneNumber) - to access the attribute value(s) for Telephone Number

An attribute with a single value is represented as a Tcl list with one element. A multi-valued attribute is represented as a Tcl list of multiple elements, one for each value. Use Tcl statements for accessing list variables to manipulate the values in the Tcl variable array; for example, lindex.

For the "add" "delete" and "modify DN" LDIF change operations, each variable in the Tcl array contains a list of attribute values. For "modify" operations, each variable in the Tcl array contains a list of attribute changes. Each change is of the form:

{ changetype [ values] }

where changetype is

  • ADD-VALUE

  • DELETE-VALUE

  • REPLACE

to indicate the three different types of attribute value modifications. The Tcl list:

{ { ADD-VALUE 1111 2222 } { DELETE-VALUE 3333 } }

represents the addition of two attribute values and the removal or one attribute value for a specific attribute. If the variable eh(telephoneNumber) has this list value, the changes apply to the attribute telephoneNumber. The first element of eh(telephoneNumber) is:

{ ADD-VALUE 1111 2222} # Three elements. The first is the
# changetype followed by two attribute
# values to be added.
{ DELETE-VALUE 3333 } # Two elements. The first is the changetype
# and the second is the attribute value to
# be deleted

The "add" and "replace" Tcl lists must contain one or more attribute values as elements that follow the changetype element. A "delete" Tcl list with one element (the changetype) indicates that the attribute itself is to be removed.

The Tcl variable array for a "modify DN" LDIF operation contains three additional attributes:

  • A "new RDN" attribute-Supplies the new relative distinguished name for the entry

  • A "new superior" attribute-Supplies the new superior distinguished name of the entry

  • A "delete old RDN" attribute-Supplies the boolean value that specifies whether or not to delete the old relative distinguished name

The attribute abbreviations for these attributes are specified in the attribute configuration file.

The elements of the Tcl variable array remain accessible as Tcl variables until they are unset with the Tcl unset command or until the handle to the entry is released with meta releasehandle.

If the -target option specifies a result handle to a search results list, use the MARKED keyword in the -tag option to read the next entry from the Identity store (a connected directory of type LDAP) that the meta modifyentry or meta findentry operations have marked as "processed" in the results list. Use the NOTMARKED keyword to read the next entry that has not been marked by meta modifyentry or meta findentry.

If the -target option specifies an index list handle to an index list, and a meta sortindexlist operation with the -keepnames option has been performed on the index list specified in the -source option, you can use the -name option to read an entry with a specific distinguished name from the list. If there is more than one entry in the index list that matches the specified distinguished name, the entry handle returned by the operation represents the first matched entry in the index list. To retrieve the next matching entry, use the meta getentry operation without any options. Use the mark option to mark the entry in the index list before meta getentry is going to return that entry. Use the tag option in order to decide which entries should be returned from the index list: use the MARKED keyword, if an already marked entry should be returned once again; use the NOTMARKED keyword, if the next unmarked entry has to be returned.

Use the -countmatches option in conjunction with the -name option to select whether the meta getentry operation returns the number of entries that match the specified distinguished name, or whether it returns the status codes described in Return Values. The setting for the -countnames option affects how the operation’s return values are to be interpreted. For example, if the operation finds one matching entry, and -countnames is set to FALSE (or not specified at all), the operation returns 0, which represents success (and not the number of matching entries found). If the operation finds one matching entry, and -countnames is set to TRUE, the operation returns 1, which represents the number of matching entries found (and not "end of list".)

The type of handle specified in the -source option affects the handle dependencies for the handle created by getentry:

  • If the -source option specifies a connection handle, the entry handle depends on this connection handle.

  • If the -source option specifies a result handle, the entry handle has no dependencies.

  • If the -source option specifies an index list handle, the entry handle depends on the connection handle to which the index list handle refers.

Note: If the meta getentry operation retrieves an entry from an LDIF change file that does not contain an LDIF operation code (ADD, DELETE, MODIFY, or MODIFY-DN), it creates an empty _ldif_opcode Tcl variable when it creates the Tcl variable array.

Return Values

0

The entry was read or the search results list was reset to the beginning of the list

1

No more entries to read (end of file, end of search results list, or end of index list)

any non-negative number

The number of matched distinguish names, if the countnames option is set to TRUE and an index list is used

Example

meta getentry -source LDAP_rh -target eh

See Also

addentry, createindexlist, modifydn, modifyentry, obj search, openconn, removeentries, writerecord

Attribute Configuration File Format (Chapter 2)

meta gethandle

Creates a handle to an empty entry. The syntax is as follows:

[meta] gethandle
    -entry entry_handle
    -conn connection_handle

Options

-entry entry_handle

A required option that specifies a name to be assigned to the entry handle created by the operation.

-conn connection_handle

A required option that specifies a handle to a connected directory. Specify the name of a connection handle created by a meta openconn operation.

The gethandle operation creates an entry handle associated with a "template" directory entry and assigns it the handle name specified in the -entry option. The "template" entry is an array of Tcl variables initialized as empty lists in the same format as that created by the getentry operation. Subsequent Tcl statements or meta operations (issued in the synchronization profile) read values into the array. The elements of the Tcl variable array remain accessible as Tcl variables until they are unset with the Tcl unset command or until the handle to the entry is released with meta releasehandle.

Return Values

None.

Example

meta gethandle -entry eh -conn ch

See Also

addentry, getentry, modifydn, modifyentry, openconn, removeentries, writerecord

Attribute Configuration File Format (Chapter 2)

Section Synchronization Profile (DirX Identity Connectivity Administration Guide)

meta getnumentries

Returns the number of entries in a search result. The syntax is as follows:

[meta] getnumentries
    -result result_handle

Options

-result result_handle

A required option that specifies a handle to a search results list. Specify the name of a result handle returned by an obj search operation.

The getnumentries operation returns the number of entries contained in the results of a search operation.

Return Values

None.

Example

meta getnumentries -result LDAP_rh

See Also

obj search

meta getstatistic

Returns the statistic information as a (global) TCL array, if the statistic was not turned off in meta initialize. The syntax is as follows:

[meta] getstatistic statistic_variable

Options

none

Return Values

Fills the given TCL array with the following components:

  • DITEntries - Denotes the complete number of entries that were found in the DIT

  • FileEntries - Denotes the complete number of entries that were read from file (in case of an Import operation) or that were written to file (in case of an Export operation)

  • AddedOk - Denotes the complete number of entries that were added successfully to the DIT.

  • ModifiedOk - Denotes the complete number of entries that were modified successfully in the DIT.

  • ModdnOk - Denotes the complete number of entries that were renamed successfully in the DIT.

  • DeletedOk - Denotes the complete number of entries that were deleted successfully from the DIT.

  • UpToDate - Denotes the complete number of entries that were already up to date.

  • AddedFailed - Denotes the complete number of entries that could not successfully be added to the DIT.

  • ModifiedFailed - Denotes the complete number of entries that could not successfully be modified in the DIT.

  • ModdnFailed - Denotes the complete number of entries that could not successfully be renamed in the DIT.

  • DeletedFailed - Denotes the complete number of entries that could not successfully be deleted from the DIT.

  • AddedIgnored - Denotes the complete number of entries that normally should be added to the DIT, but that actually were not added as TRIAL mode is switched on.

  • ModifiedIgnored - Denotes the complete number of entries that normally should be modified in the DIT, but that actually were not modified as TRIAL mode is switched on.

  • ModdnIgnored - Denotes the complete number of entries that normally should be renamed in the DIT, but that actually were not renamed as TRIAL mode is switched on.

  • DeletedIgnored - Denotes the complete number of entries that normally should be deleted from the DIT, but that actually were not deleted as TRIAL mode is switched on.

  • AddAttrIgnored - Denotes the complete number of attribute creations that normally should be done, but that actually were not done as TRIAL mode is switched on.

  • DeleteAttrIgnored - Denotes the complete number of attribute deletions that normally should be done, but that actually were not done as TRIAL mode is switched on.

Example

The function

meta getstatistic statInfo

sets the following TCL array:

statInfo(Processed)
statInfo(AddedOk)
statInfo(ModifiedOk)
statInfo(DeletedOk)
statInfo(AddedFailed)
statInfo(ModifiedFailed)
statInfo(DeletedFailed)
statInfo(AddedIgnored)
statInfo(ModifiedIgnored)
statInfo(DeletedIgnored)

See Also

Initialize

meta help

Returns help information about the meta object and its operations. The syntax is as follows:

meta help [operation | -verbose]

Options

-verbose

Displays information about the meta object.

Used without an argument or option, the help command displays a list of the meta operations. The operations are listed in alphabetical order, except for help and operations, which are listed last. Use the operation argument to return a brief description of an operation and its associated options. Alternatively, you can use the -verbose option to return a description of the meta object itself.

Return Values

None (The requested information is displayed).

Example

meta help

The output of the sample command is as follows:

The following operations are available:
addentry createindexlist encryptdata encryptvalue
escapechar findentry getchangelog getentry
gethandle getnumentries getstatistic initialize
modifyentry modifydn openconn openldif
readattrconf releasehandle removeentries sortindexlist
sortresult supinfo terminate unescapechar
writeindexlist writerecord writetext writetrace
help operations
meta help readattrconf
meta help readattrconf

The output of the sample command is as follows:

readattrconf - Reads an attribute configuration file and
               creates an attribute configuration file handle.

-attrconf -    Specifies the name of the handle to be created.

-file -        Specifies the name of the attribute
               configuration file.

meta initialize

Initializes the metacp workspace and opens a trace file for writing. The syntax is as follows:

[meta] initialize
    -file trace_file
    [-tracelevel level]
    [-maxtracerecords recordnumber]
    [-maxentries number]
    [-mode initialization_mode]
    [-nostatistics]

Options

-file trace_file

The name of the file to which trace information is to be written. The operation creates the file relative to the current working directory if it is a relative pathname; otherwise, the full pathname is used.

-tracelevel level

The level of tracing to be performed for operations invoked after meta initialize is called. Specify one of the following values in level:

  • 1-To perform error tracing (default)

  • 2-To perform full tracing

  • 3-To perform full tracing excluding the tracing of entries that are up-to-date

-maxtracerecords recordnumber

The maximum number of records in the tracefile.

-maxentries number

The maximum number of entries in a search results list to be processed by a meta writetrace operation.

-mode initialization_mode

The mode in which metacp is to run when an import procedure from a connected directory to the Identity store (a connected directory of type LDAP). Specify one of the following values in initialization_mode:

  • REAL-Updates the Identity store with the imported data (default)

  • TRIAL-Bypasses actual update of the Identity store, and logs the update operations that would otherwise be performed

-nostatistics

If set, the statistic information that metacp internally calculates while performing the synchronization tasks is suppressed.

For more details about the default statistic information please refer to meta terminate.

Depending on the complex logic of the synchronization scripts, there are sometimes good reasons to suppress the statistics, because it may be confusing, e.g.

  • if a file is (for any purposes) read twice or

  • several files are processed in parallel or

  • searches in source and target directories are performed simultaneously or

  • searches for the same objects need to be repeated because additional attribute information is needed or

  • searches with different filter conditions overlap in the objects found in the DIT

The confusion in the first two cases is the following:
The "number of file entries" is misleading because it is the sum of all records ever read from any file.

The confusion in the remaining cases is the following:
The "number of X.500 entries" is misleading, because the number listed here is the count of entries ever read from any directory. That number may not be the exact number that is currently available in the DIT. Furthermore, if more than one directory is handled, that number has no meaning, because one does not know how many entries have been found in one directory and how many have been found in the other.

Therefore the user is advised to integrate his own statistic counters in the TCL logic itself, if he builds complex synchronization scripts because he is the only one that knows the information that is worth to be printed at the end of the synchronization.

The initialize operation initializes metacp data structures and creates a metacp trace file to be used to store information about the directory synchronization process. A synchronization profile must invoke the initialize operation before it invokes any metacp operations that operate on meta handles.

When they are invoked in a synchronization profile, the meta addentry, meta modifydn, meta modifyentry and meta removeentries operations automatically write information about their operation into the trace file specified with the -file option. The writetrace operation can also be used to write explicit trace information into the trace file.

Use the -tracelevel option to control the level of trace information that the meta addentry, meta modifydn, meta modifyentry and meta removeentries operations write to the trace file. A trace level of 1 directs the operations to perform error tracing. An error trace on an operation traces:

  • The original entry in the source

  • The attempted directory operation, prefixed with the # character

  • The error message, prefixed with the # character

With error tracing, if an error occurs on an entry being processed, the operation writes the entry as it appears in the original source file into the trace file together with the associated directory operation and error message, prefixed with the # character.

Here is a sample error trace record:

dn: cn=Filler, ou=Development, o=PQR
objectclass: person
objectclass: organizationalPerson
telephoneNumber: +44 1922 222222
facsimileTelephoneNumber: +44 1922 222223
userPassword: two
sn: Filler
description: Craftsman
postalCode: WS1 9YY
streetAddress: 17 Kelly Road
st: Walsall
# MODIFY operation: Mon Jan 4 10:19:49 1999 [Bind-ID: (default)]
# "cn=Filler,ou=Development,o=PQR " "-removeattr" "sn=Filler"
# ERROR: Object class violation.

A trace level of 2 directs the operations perform full tracing. A full trace on an operation traces:

  • The original entry in the source

  • The entry handle that was input to the operation, for a meta modifyentry operation on an entry in a connected directory of type LDAP

  • The entry handle for the matched entry, for a meta modifyentry operation on an entry in a connected directory of type LDAP

  • The attempted directory operation

  • No message, if the operation was successful; otherwise an informational message or an error message

With full tracing, the operations write both error trace information and successful operation information to the trace file. Entries that are successfully processed are written to the file and delimited with # characters.

Here is an excerpt from a full trace operation:

#dn: cn=Digger T., ou=Development, o=PQR
#cn: Digger T.
#telephoneNumber: +44 1902 111111
#postalAddress: FLAT 86B$24 Dougan Street$Fordhouses$Wolverhampton$West Midlands$WV1 9ZZ
#facsimileTelephoneNumber: +44 1902 111112
#userPassword: PASS1
#sn: Digger
#description: Salvage Clerk
#postalCode: WV1 9ZZ
#street: 24 Dougan Street
#st: Wolverhampton
#objectClass: inetOrgPerson
#objectClass: organizationalPerson
#objectClass: person
#objectClass: top
#createTimestamp: 20000308120947Z
# ADD operation: Wed Jul 12 12:34:21 2000 [Bind-ID: (default)]
# "cn=Digger T., ou=Development, o=PQR" "-attribute"
"objectClass=inetOrgPerson;organizationalPerson;person;top"
"telephoneNumber=+44 1902 111111"
"postalAddress=FLAT 86B$24 Dougan Street$Fordhouses$Wolverhampton$West
Midlands$WV1 9ZZ"
"facsimileTelephoneNumber=+44 1902 111112"
"userPassword=PASS1"
"sn=Digger"
"description=Salvage Clerk"
"postalCode=WV1 9ZZ"
"street=24 Dougan Street"
"st=Wolverhampton"
"cn=Digger T."
#dn: cn=Smith John, ou=Sales, o=PQR
#cn: Smith John
#sn: Smith
#description: Sales Manager
#telephoneNumber: +12 34 567 891
#telephoneNumber: +12 34 567 890
#userPassword: jps123
#labeledURI: http://www.sni.de
#mail: John.Smith@sales.pqr.de
#objectClass: inetOrgPerson
#objectClass: organizationalPerson
#objectClass: person
#objectClass: top
#createTimestamp: 20000308120946Z
# Mapped Entry:
# "cn=Smith John, ou=Sales, o=PQR"
# "objectClass=inetOrgPerson;organizationalPerson;person;top"
# "telephoneNumber=+12 34 567 891;+12 34 567 890"
# "userPassword=jps123"
# "sn=Smith"
# "description=Sales Manager"
# "mail=John.Smith@sales.pqr.de"
# "labeledURI=http://www.sni.de"
# "cn=Smith John"
# X500 Entry:
# "cn=Smith John,ou=Sales,o=PQR"
# "objectClass=person;organizationalPerson;inetOrgPerson;top"
# "cn=Smith John"
# "sn=Smith"
# "description=Sales Manager"
# "telephoneNumber=+12 34 567 890;+12 34 567 891"
# "userPassword=jps123"
# "labeledURI=http://www.sni.de"
# "mail=John.Smith@sales.pqr.de"
# "collectiveTelephoneNumber=+12 34 567 0"
# TRIAL operation: Wed Jun 28 12:41:35 2000 [Bind-ID: (default)]
# No update necessary !

The update operations that really result in some action in the DSA, are logged as "ADD operation:", "DELETE operation:", "MODIFY operation:" and "MOD-DN operation:".

In case a (potential) MODIFY operation needs to be sent to the server and metacp detects, that the object is already up to date, then such an operation is logged as "TRIAL operation:".

For readability, the previous example shows the attributes added to the entry on separate lines; in the trace file, all the attributes added to an entry appear on a single line.

A trace level of 3 directs the operation to perform full tracing except for entries that are already up-to-date. For example, the "add" operation shown in the previous example appears in the trace file, but the "modify" operation for which no update was necessary does not appear in the trace file.

If the -tracelevel option is not specified, the operations by default perform level 1 (error) tracing.

Use the -maxtracerecords option to limit the maximum number of records in a trace file. recordnumber specifies the maximum number of records. If the option is missing or the value is 0 only one trace file is written with an unlimited number of records.

If required several trace files are written each of them containing at least recordnumber trace records. The maximum number of records written to the trace files may differ slightly from the specified number because the maximum number is checked after the complete information about a synchronization entry is written. For example the source entry, the entry in the directory, the generated operation, and the result of the operation represent a logical unit and is written completely to the trace file before the maximum number of records written is checked.

If more than one trace file is written an internal sequence number in the format -number is inserted into the filename of the next trace file when a trace file exceeds the maximum number of records. Use the wildcard character (*) in the -file file_name option to specify the position of this sequence number. For example you specify the following options:

...
-file trace*_file.trc
...
-maxtracerecords 50000

After writing at least the 50000th record to the trace file currently in use the file is closed. A new trace file is created. The internal sequence number is inserted at the position of the wildcard character into the filename of the new file. After finishing the synchronization process you find for example the following trace files:

trace_file.trc
trace-1_file.trc
trace-2_file.trc
trace-3_file.trc

where "trace_file.trc" is the first trace file written and closed after exceeding the maximum number of records.

If you do not use a wildcard character to specify the position of the sequence number this number is appended to the filename (before its extension, if there is one), for example "trace_file-1.trc" or "trace-1".

Use the -maxentries option to set a limit on the number of entries in a search results list that will be processed by meta writetrace operations. When the -maxentries option is specified, the meta writetrace operation writes only the number of entries specified in number to the metacp trace file. If this option is not specified, the default is "no limit".

Use the -mode option to control whether or not metacp performs update operations on the Identity store (a connected directory of type LDAP) during an import process. When the -mode option is set to TRIAL, metacp logs update operations with the message "operation ignored" and does not make the changes to the Identity store. When the -mode option is set to REAL, metacp makes the updates to the Identity store.

The generated trace file contains the source entry information. Consequently, if errors occur during an import from a connected directory of type FILE into the Identity store (a connected directory of type LDAP), administrators can re-run the synchronization profile using the trace file as input (after first fixing the errors reported in the trace file)

See the "Return Values" section in the metacp reference page for a description of metacp error messages.

Return Values

None.

Example

meta initialize -file tracefile.log -tracelevel 2 -maxentries 10

See Also

addentry, modifydn, modifyentry, removeentries, terminate, writetrace

Section Synchronization Profile (Chapter 1, DirX Identity Connectivity Administration Guide)

Chapter 2, "Synchronization Templates", DirX Identity Connectivity Administration Guide

meta modifydn

Modifies an entry’s name in the Identity store (a connected directory of type LDAP). The syntax is as follows:

[meta] modifydn
    -entry entry_handle

Options

-entry entry_handle

A required option that specifies the handle to the entry whose distinguished name is to be changed. Specify the name of an entry handle created by a meta gethandle operation called with a -conn option that specifies a connection handle to a connected directory of type LDAP.

The modifydn operation modifies the distinguished name of the entry associated with entry_handle in the Identity store (a connected directory of type LDAP). The operation uses the following attributes of the Tcl variable array associated with entry_handle:

  • entry_handle(new_rdn)-the attribute that holds the new RDN for the entry. The name of this attribute is defined in the New-RDN field in the attribute configuration file.

  • entry_handle(del_old_rdn)-the attribute that represents the "delete old RDN" flag (optionally present in the Tcl variable array). The name of this attribute is defined in the Delete Old-RDN field in the attribute configuration file. The default value 1 means that the old RDN is to be deleted and the value 0 means that the old RDN is to be preserved.

  • entry_handle(new_sup)-the attribute that represents the new superior distinguished name (optionally present in the Tcl variable array). The name of this attribute is defined in the New Superior field in the attribute configuration file.

The modifydn operation changes the last RDN of an entry in the connected directory. The entry_handle(del_old_rdn) attribute controls whether or not the old RDN value should be preserved in the directory entry. If present, the entry_handle(new_sup) attribute directs modifydn to move the entry (or subtree) into a different subtree of the DIT. The pseudo attributes new_rdn, del_old_rdn, and new_sup must be selected with the -attribute option in the openconn operation.

If the underlying connection handle (derived from entry_handle) is an LDAP directory with the parameter -ldifhandle set, then the modifydn is not applied to the LDAP directory; instead an LDIF-CHANGE operation is created in the LDIF-CHANGE file associated with -ldifhandle parameter.

metacp automatically propagates a JMS message (containing the SPML add request) if at the beginning of a synchronization scenario ats initialize has been called with the options -topicprefix, -type, -cluster, and -resource. (See ats initialize for details.)

Return Values

Check the Tcl variable errorCode for error details. If this variable is not set or its value is empty, the entry was successfully renamed. Otherwise, the error is logged in the trace file and the distinguished name was not modified.

0 The distinguished name modification succeeded, or it failed with an error that did not prevent the further processing of operations in the Tcl script logic.

1

The distinguished name modification failed with a serious error; for example, "LDAP server not available". Examine your Tcl script logic to determine whether it makes sense to terminate the Tcl synchronization script.

Example

meta modifydn -entry en

See Also

gethandle, initialize, openconn, openldif, ats initialize

Attribute Configuration File Format (Chapter 2)

meta modifyentry

Updates the contents of an entry in the Identity store (a connected directory of type LDAP). The syntax is as follows:

[meta] modifyentry
    -newentry entry_handle
    [-oldentry entry_handle]
    [-tag tag]
    [-allowrename rename_flag]
    [-updateinfo update_flag]
    [-updateattr attribute_list]

Options

-newentry entry_handle

A required option that specifies the entry that contains the update information. Specify an entry handle created by a meta gethandle operation called with a -conn option that specifies a connection handle to a connected directory of type LDAP.

-oldentry entry_handle

Specifies the entry to be updated. Specify an entry handle created by a meta getentry operation called with a -source option that specifies a result handle, or by a meta findentry or meta gethandle operation. This option is not required if the -newentry option specifies an entry handle that refers to an LDIF change entry with changetype modify.

-tag tag

Specifies a marking action to be performed on the modified entry. Specify the keyword MARK in the tag argument to this option.

-allowrename rename_flag

Controls whether the distinguished name of the entry specified in the -oldentry option is to be renamed to the distinguished name of the entry specified in the -newentry option. Specify one of the following keywords:

  • TRUE-Rename the old entry’s distinguished name to the new entry’s distinguished name

  • FALSE-Do not rename old entry’s distinguished name (the default if this option is not specified)

-updateinfo update_flag

Controls whether a modifyentry operation returns a value that indicates that no operation was performed because the entry was already up-to-date. Specify one of the following keywords:

  • SIMPLE-Return a value that indicates when an entry is already up-to-date

  • NONE-Do not return a value when an entry is already up-to-date (default)

-updateattr attribute_list

An optional parameter that specifies an additional attribute list. All these attributes are created in case a difference in the attribute values of the old entry and the new entry has been detected and the necessary changes have been applied. The attribute list has to be specified in native LDAP syntax, e.g.

[meta] modifyentry newentry new_entry oldentry old_entry updateattr dxmState=CHANGED

Using the -updateattr switch allows to handle additional attributes, which normally should not be synchronized under any circumstances. (Otherwise, these attributes must have been selected in the associated entry_handles and therefore are always subject to synchronization. That is not desirable in any cases. Only in case the object has really been modified, the additional attributes from attribute_list should be stored in the directory entry.)

The modifyentry operation updates the contents of an entry with the contents of the entry specified by -newentry entry_handle.

The modifyentry operation compares the new entry to the old entry, evaluates the connection handle for any synchronization flags set on the attributes to be processed, and generates the operations that are necessary to convert the contents of the old entry to the contents of the new entry (adding, replacing, and deleting the entry attributes, depending on the sync flags set with the -attribute option in the openconn operation).

Use the -oldentry option to identify the entry that is to be updated with the contents of the entry specified with the -newentry option. You do not need to specify -oldentry if -newentry entry_handle refers to an LDIF change file entry with the modify changetype. In this case, the entry handle contains the information about the entry that is to be modified. But in case you do provide an oldentry entry_handle for LDIF change files, only changes that still can be applied to the directory entry will be processed. Changes that cant be applied (e.g. removal of an attribute telephone number even if telephone number doesn’t exist) will be ignored.

The Tcl variable arrays associated with both -oldentry entry_handle and -newentry entry_handle must contain the entry’s distinguished name in the DDN attribute.

Use the -tag option to mark a modified entry as "processed" by a modifyentry operation. The removeentries operation uses the tag to determine which entries to remove.

Use the -allowrename option to control whether metacp modifies the DDN attribute of an entry when it updates its other attributes. When this option is set to FALSE (or is not used), the distinguished name in the DDN attribute of the entry that contains the update information must match the distinguished name in the DDN attribute of the entry to be updated.

Use the -updateinfo option to control the modifyentry return values. Specify NONE to return the values 0 (modification of the entry was successful) or 1 (modification of the entry failed). Specify SIMPLE to return the values 0 (success) 1 (failure) or 2 (no operation because the entry was already up-to-date). The extended return values (0,1,2) allow you to use the modifyentry function in more complex ways within your synchronization profiles.

If the underlying connection handle (derived from entry_handle) is an LDAP directory with the parameter -ldifhandle set, then the modifyentry is not applied to the LDAP directory; instead an LDIF-CHANGE operation is created in the LDIF-CHANGE file associated with -ldifhandle parameter.

metacp automatically propagates a JMS message (containing the SPML add request) if at the beginning of a synchronization scenario ats initialize has been called with the options -topicprefix, -type, -cluster, and -resource. (See ats initialize for details.)

Return Values

Check the Tcl variable errorCode for error details. If this variable is not set or its value is empty, the entry was successfully modified and/or renamed. Otherwise, the error is logged in the trace file and the entry was not modified.

0 The entry modification succeeded, or it failed with one or more errors that did not prevent further processing of operations in the Tcl script logic.

1

The entry modification failed with a serious error; for example, "LDAP server not available". Examine your Tcl script logic to determine whether it makes sense to terminate the Tcl synchronization script.

2

(If -updateinfo specifies SIMPLE) Modification of the entry was not performed because the entry was already up-to-date.

Example

meta modifyentry -newentry eh_LDAP -oldentry cur_entry -tag MARK

See Also

findentry, gethandle, getentry, initialize, openconn, openldif, removeentries, ats initialize

meta openconn

Opens a connected directory for synchronization. The syntax is as follows:

[meta] openconn
    -type directory_type
    [-file filename -mode file_open_mode
    [-format file_format] [encoding encoding]]
    [-attribute attribute_list [-processallattr]]
    -attrconf attr_conf_handle
    -conn connection_handle
    [-bindid binding_id]
    [-ldifhandle LDIF_file_handle]

Options

-type directory_type

A required option that identifies the type of connected directory. Specify one of the following keywords:

  • FILE-A data file (an import file or an export file)

  • LDAP-A directory that is accessible over LDAP

-file filename

The name of the data file to be opened. This option can only be used if the -type option is FILE and is a required option in this case.

-mode file_open_mode

Specifies the mode to use when opening filename. This option can only be used if the -type option is FILE and is a required option in this case. Specify one of the following keywords:

  • READ-Opens the file read-only

  • WRITE-Opens the file write-only (and write from beginning of file)

  • APPEND-Opens the file for writing at end-of-file

-format file_format

The file format of the data file. Specify one of the following keywords:

  • TAGGED - If the -type option is FILE, the data file uses a tagged file format (the default if this option is not specified)

  • NON-TAGGED - If the -type option is FILE, the data file uses a non-tagged file format

  • LDIF-CHANGE - If the -type option is FILE, the data file uses LDIF change format. If the -type option is LDAP, LDIF changes are to be imported to the directory.

  • DSML or DSMLv1 - If the -type option is FILE, the data file uses Directory Services Markup Language (DSML) format (version 1)

  • DSMLv2-REQ - If the -type option is FILE and the mode option is either WRITE or APPEND, the data file uses Directory Services Markup Language (DSML) request format (version 2). In that case, the TCL variables that are used in meta writerecord use the same format as if LDIF change format would need to be produced.

  • DSMLv2-RSP If the -type option is FILE and the mode option is READ, the data file uses Directory Services Markup Language (DSML) response format (version 2). The only elements that will be processed are search responses.

  • FLAT-XML - If the -type option is FILE, the data file uses flat XML format

-encoding encoding

Specifies the character set encoding of the data file. If the encoding parameter is missing, then the encoding as defined in the _localcode Tcl variable is used.

Later on while reading the file (using getentry), the data read from file is internally converted from the local encoding to the internal Tcl format UTF-8.

Tcl 8.3 supports a variety of different encodings. (see install_path\lib\tcl8.3\encoding (on Windows) or install_path/lib/tcl8.3/encoding (on UNIX) or use the command encoding names in metacp). The encodings listed in these encoding files can be used by dropping the file suffix .enc.

Example:

Encoding file name: cp850.enc
encoding must be set to cp850.
-attribute attribute_list

A list of attributes to be processed.Specify attribute_list as a Tcl list in the format:

{attribute}

Each attribute in the Tcl list has the format:

abbreviation [{sync_flag}]

where abbreviation is an attribute abbreviation in the attribute configuration file specified in the -attrconf option and each sync_flag is one or more of the following keywords:

  • DONT-ADD-ATTR

  • DONT-ADD-REC-ATTR-VAL

  • DONT-DEL-ATTR

  • DONT-DEL-REC-ATTR-VAL

  • DONT-MOD-ATTR

  • REPLACE-ALL

Multiple sync_flag arguments are represented as a Tcl list.The sync_flag argument is only valid if the -type option is LDAP.

-processallattr

Specifies that all of the attributes defined in the attribute configuration file specified in the -attrconf option are to be processed. This option can only be used if the -type option is LDAP.

-attrconf attr_conf_handle

A required option that specifies the handle to the attribute configuration file for the connected directory. Specify an attribute configuration handle created by a meta readattrconf operation.

-conn connection_handle

A required option that specifies a name to be associated with the connection handle structure returned by the operation.

-bindid binding_id

Specifies a binding ID to be associated with the connected directory. Specify a binding ID created by an obj bind operation. This option can only be used if the -type option is LDAP.

-ldifhandle LDIF_file_handle

Specifies the name of an LDIF file handle (created by meta openldif) that is used when changes should not directly be applied to the LDAP directory; instead the changes are written as LDIF-CHANGE entries in the LDIF file associated with LDIF_file_handle. This option can only be used if the -type option is LDAP.

The openconn operation opens a connected directory for synchronization, creates a connection handle for it, and assigns it the name specified in the -conn option. The connection handle points to an import file, an export file, an LDAP connection to a directory, depending on the -type option specified in the command line. If a LDAP connection to a directory is being opened, the synchronization profile must perform an obj bind operation with suitable protocol (LDAPv2 or LDAPv3) before the openconn operation. The meta controller does not check for the bind in the openconn operation itself; but it does check in the addentry, modifyentry, modifydn, removeentries operations (which operate on handles containing a nested connection handle) and in obj search (with connection handle specified).

When multiple binds are open to different LDAP directories, you can use the -bindid option to associate the connection handle with a specific bind. The binding_id argument to this option specifies binding ID assigned to the bind during the obj bind operation. If the -bindingid option is not used, the openconn operation associates the connection handle with the default bind.

Use the -attribute option to select specific attributes for synchronization from the connected directory’s attribute configuration file. The selected set becomes the set of synchronized attributes (SSA). Use the sync_flag argument (for connected directories of type LDAP only) to specify the operations that are allowed during synchronization on each attribute in the subset specified in the -attribute option. The sync_flag keywords have the following effects on the synchronization of attribute values:

  • DONT-ADD-ATTR-Do not create an attribute in the target directory even if the corresponding attribute in the source directory exists. If metacp is processing an LDIF change entry and it encounters a changetype "modify" operation with an "add" modification for a specific attribute, metacp uses this flag to verify whether or not it can create the attribute. In this case, the Identity store may already hold the attribute; if it does, metacp creates an additional attribute value for the attribute.

  • DONT-ADD-REC-ATTR-VAL-Do not add additional attribute values in the source directory to the attribute in the target directory

  • DONT-DEL-ATTR-Do not delete the attribute in the target directory even if the corresponding attribute in the source directory is deleted

  • DONT-DEL-REC-ATTR-VAL-Do not delete a recurring attribute value in the target directory even if the corresponding attribute in the source directory does not have the recurring value.

  • DONT-MOD-ATTR-Do not modify the attribute value(s) of the attribute in the target directory. If this flag is set, no modification at all is performed (new attribute values cannot be created, and existing values cannot be removed)

  • REPLACE-ALL-replace the existing attribute value(s) in the target directory with the attribute value(s) in the source directory. If the Identity store has no equality matching rule for an attribute, this flag needs to be set for the attribute in order to permit it to be updated. An example of an attribute for which the Identity store has no matching rule is Facsimile-Telephone-Number. The Mrule field in the attribute configuration file specifies whether a matching rule is defined for the attribute.

Valid combinations of sync_flag are:

  • DONT-MOD-ATTR with no other flag set

  • REPLACE-ALL with no other flag set

  • Any combination of the flags DONT-ADD-ATTR, DONT-ADD-REC-ATTR-VAL, DONT-DEL-ATTR and DONT-DEL-ATTR

Use the -processallattr option to synchronize all of the connected directory’s attributes (when the -type option is LDAP). You can use this option in conjunction with the -attribute option to select certain attributes and assign special processing to them.

When the -type option is LDAP, the -attributes option must specify all of the naming attributes used in the connected directory, unless the -processallattr option is specified.

The connection handle created by openconn defines the set of attributes to be synchronized (SSA). This set is either the same as the set of attributes to be synchronized that is specified in the attribute configuration file (if the -attribute option is not specified, or if -processallattr is specified) or it is a subset of the SSAs specified in the attribute configuration file (if the -attribute option is specified).

Return Values

None.

Examples

  1. Open a tagged data file for reading and allow processing of all of the attributes associated with the attribute configuration file.

    meta openconn -type FILE \
        -file msexch.data \
        -mode READ \
        -format TAGGED \
        -attrconf ah \
        -conn ch
  2. Open a non-tagged data file for reading and select attributes for processing. The selected attributes correspond to the first through sixth fields of the data file.

    meta openconn -type FILE \
        -file msexch.data \
        -mode READ \
        -format NON-TAGGED \
        -attrconf ah \
        -attribute {o ou sn givenName telephoneNumber facsimileTelephoneNumber} \
        -conn ch
  3. Open a tagged data file for writing and allow processing of all attributes.

    meta openconn -type FILE \
        -file notes_out.data \
        -mode WRITE \
        -format TAGGED \
        -attrconf ah \
        -conn ch
  4. Open a non-tagged data file for writing and select attributes for processing. The selected attributes correspond to the first through sixth fields of the data file.

    meta openconn -type FILE \
        -file msexch.data \
        -mode WRITE \
        -format NON-TAGGED \
        -attribute {o ou sn givenName telephoneNumber facsimileTelephoneNumber} \
        -attrconf ah \
         -conn ch
  5. Open an LDAP connection and allow all attributes (except DDN) to be processed.

    meta openconn -type LDAP \
        -attrconf ah \
         -conn ch
  6. Open an LDAP connection and specify a set of attributes to be processed.

    meta openconn -type LDAP \
        -attrconf ah \
        -conn ch\
        -attribute {o ou sn givenName telephoneNumber facsimileTelephoneNumber}
  7. Open an LDAP connection and allow all attributes (except DDN) to be processed. For attribute sn, disallow attribute deletion. For attribute givenName, disallow attribute deletion and attribute creation.

    meta openconn -type LDAP \
        -attrconf ah \
        -attribute {{sn DONT-DEL-ATTR} \
        {givenName DONT-DEL-ATTR DONT-ADD-ATTR}} \
        -processallattr

See Also

getentry, gethandle, openldif, readattrconf, obj bind obj search

meta openldif

Creates an LDIF-CHANGE file. The syntax is as follows:

[meta] openldif
    -file filename
    -ldifhandle LDIF_file_handle

Options

-file filename

A required option that specifies the file name of the LDIF-CHANGE file.

-ldifhandle LDIF_file_handle

Specifies the name of an LDIF file handle that is used when changes should not directly be applied to the LDAP directory; instead the changes (calculated by meta addentry, meta modifydn, meta modifyentry, meta removeentries) are written as LDIF-CHANGE entries in the LDIF file associated with LDIF_file_handle.

The openldif operation opens the given file (as output file containg LDIF-CHANGE records) and associates that file with the given LDIF_file_handle. That handle can later on be used in meta openconn.

Return Values

None.

Example

meta openldif -file /homes/metadir/data/ldif.txt \
     -ldifhandle ldif_file

See Also

addentry, modifydn, modifyentry, openconn, removeentries

meta operations

Returns a list of operations that can be performed on the meta object. The syntax is as follows:

meta operations

The list of available operations is in alphabetical order except for help and operations, which are listed last.

Return Values

The requested information.

Example

meta operations

The output of the sample command is as follows:

addentry createindexlist escapechar findentry getentry gethandle getnumentries initialize modifydn modifyentry openconn openldif readattrconf releasehandle removeentries sortindexlist sortresult supinfo terminate unescapechar writeindexlist writerecord writetext writetrace help operations

meta readattrconf

Reads an attribute configuration file. The syntax is as follows:

[meta] readattrconf
    -file filename
    -attrconf attr_conf_handle
    [-encoding encoding]

Options

-file filename

A required option that specifies the pathname of the attribute configuration file. If only a file name is given, the file is assumed to be located the current working directory.

-encoding encoding

Specifies the character set encoding of the attribute configuration file. If the encoding parameter is missing, then the encoding as defined in the _localcode variable is used.

The data read from the attribute configuration file is internally converted from the local encoding to the internal Tcl format UTF-8.

Tcl 8.3 supports a variety of different encodings. (see install_path\lib\tcl8.3\encoding (on Windows) or install_path/lib/tcl8.3/encoding (on UNIX) or use encoding names in metacp). The encodings listed in these encoding files can be used by dropping the file suffix .enc.

Example:

Encoding file name: cp850.enc
encoding must be set to cp850.
-attrconf attr_conf_handle

A required option that specifies the name to be associated with the attribute configuration handle returned by the operation.

The readattrconf operation reads an attribute configuration file into the metacp workspace, creates a handle to it, and assigns it the name specified in the -attrconf option. An attribute configuration file defines the attributes that are present in a particular connected directory and supplies formatting information that metacp is to use when processing data files associated with the connected directory.

A synchronization profile generally contains two readattrconf operations: one to read the attribute configuration file associated with the source directory, and one to read the attribute configuration file of the target directory.

Return Values

None.

Example

meta readattrconf -file /homes/metadir/conf/mail/exchgattr.cfg \
-attrconf exchg_ah

See Also

openconn

Attribute Configuration File Format (Chapter 2)

meta releasehandle

Releases a meta handle. The syntax is as follows:

[meta] releasehandle handle

The releasehandle operation releases the meta handle specified in handle. See the handle argument description in this chapter for a list of meta handle types.

A meta handle’s context can be dependent on the context of another meta handle. For example, the entry handle context returned by a meta findentry operation is dependent on the context of a result handle returned by an obj search operation. In the case of handles with dependencies, you can only release a handle after you have first released all of its dependent handles. For example, you must release an entry handle before you can release the result handle on which it is dependent. Similarly, you must release a connection handle before you can release the attribute configuration file handle on which the connection handle is dependent. See the handle argument description for the list of handle dependencies.

Return Values

None.

Example

meta releasehandle LDAP_results_rh

meta removeentries

Removes an entry or removes entries in a sorted search results list from the Identity store (a connected directory of type LDAP). The syntax is as follows:

[meta] removeentries
    -handle handle
    [-tag tag]

Options

-handle handle

A required option that specifies an entry handle (for removal of a single entry) or a result handle (for removal of entries in a sorted search results list). Specify an entry handle created by a meta getentry, meta gethandle, or meta findentry operation or a result handle created by an obj search operation that has been sorted by a meta sortresult operation.

-tag tag

Specifies whether marked or unmarked entries are to be removed, if the operation is removing entries from a results list. Specify one of the following keywords:

  • MARKED-remove all marked entries

  • NOTMARKED-remove all unmarked entries (default)

The removeentries operation removes an entry specified by an entry handle or the entries in a results list specified by a result handle from the Identity store (a connected directory of type LDAP).

If the -handle option specifies a result handle to a search results list, use the MARKED keyword in the -tag option to remove all entries from the Identity store (a connected directory of type LDAP) that the meta modifyentry or meta findentry operations have marked as "processed" in the results list. Use the NOTMARKED keyword to remove all entries that have not been marked by meta modifyentry or meta findentry.

The meta controller will not remove an entry for which it has information that the entry has subordinates. The meta controller will have this information for an entry in two cases:

  • When it has attempted to remove a subordinate entry and the operation has failed

  • When is has encountered a subordinate entry that is marked as not to be deleted

If the underlying connection handle (derived from entry_handle) is an LDAP directory with the parameter -ldifhandle set, then the removeentries is not applied to the LDAP directory; instead an LDIF-CHANGE operation is created in the LDIF-CHANGE file associated with -ldifhandle parameter.

metacp automatically propagates a JMS message (containing the SPML add request) if at the beginning of a synchronization scenario ats initialize has been called with the options -topicprefix, -type, -cluster, and -resource. (See ats initialize for details.)

Return Values

Check the Tcl variable errorCode for error details. If this variable is not set or its value is empty, the entry (or all of the entries from the result list) was successfully removed. Otherwise the error is logged in the trace file and the entry (or entries) was not removed.

0 The entry removal succeeded, or it failed with one or more errors that did not prevent further processing of operations in the Tcl script logic.

1

The entry removal failed with serious error; for example, "LDAP server not available". Examine your Tcl script logic to determine whether or not it makes sense to terminate the Tcl synchronization script.

Example

meta removeentries -handle rh -tag MARKED

See Also

getentry, initialize, modifyentry, obj search, openconn, openldif, ats initialize

meta sortindexlist

Sorts the entries in an index list. The syntax is as follows:

[meta] sortindexlist -handle index_list_handle
    [-keepnames index_list_access_flag]

Options

-handle index_list_handle

A required option that specifies the name of an index list handle created by a meta createindexlist operation.

-keepnames index_list_access_flag

Selects whether random access to index list elements by distinguished name or sequential access to index list elements can be performed. Specify one of the following keywords in index_list_access_flag:

  • TRUE-permit random access to index list elements by distinguished name

  • FALSE-do not permit random access to index list elements (default)

The sortindexlist operation sorts the entries in the index list specified by the -handle option. The operation sorts the entries by distinguished name in alphabetical (ascending) order. Use the sortindexlist operation in conjunction with the meta createindexlist, meta getentry, and meta writeindexlist operations to create a sorted list (by distinguished name) of entries. Note that an index list can be sorted only once.

Use the -keepnames option to control whether the distinguished names specified in the -name option of previous meta writeindexlist operations can be used as indexes into the sorted index list, or whether only sequential access can be performed.

Return Values

None.

Example

meta sortindexlist -handle ih

See Also

getentry, createindexlist, writeindexlist

meta sortresult

Sorts the results of a read or search operation. The syntax is as follows:

[meta] sortresult
    -result result_handle
    -order sort_order
    [-key sort_key]

Options

-result result_handle

A required option that specifies a handle to a search results list. Specify the name of a result handle created by an obj search operation.

-order sort_order

A required option that specifies the order in which the results are to be sorted. Specify one of the keywords:

  • ASC-To sort in ascending order (a-z for alphabetic sort, 1-n for numeric sort)

  • DESC-To sort in descending order (z-a for alphabetic sort n-1 for numeric sort)

-key sort_key

Specifies one or more attribute abbreviations that indicate a precedence of sort criteria. (In the current release only one sort key is supported.)

Specify the keyword DDN to sort by distinguished name or any other attribute type.

The sortresult operation sorts the entries in the search result specified by the -result option, updates the result data structure with information about how the result has been sorted, and returns a handle to the sorted result.

Use the -key option to sort the results list by distinguished name or by any other attribute type.

If the result list has been sorted according to any attribute type, then that attribute must be single-valued for all the entries of the search result. Entries that don’t hold that specific attribute type will be listed at the end of the sorted list (if sorting has been done in ascending order) or at the beginning of the sorted list (if sorting has been done in descending order). If several such entries exist, their position at the beginning or end of the sorted list is undefined. As a consequence, it is unpredictable which entry will be returned by a "meta findentry" operation that uses such an ambiguous value. Therefore it is strongly recommended to use only attributes as sort_key that are unique, like employee number.

Return Values

None.

Examples

meta sortresult -result rh -order ASC -key DDN
meta sortresult -result rh -order DESC -key employeeNumber

meta supinfo

Supplies attribute information for creating a superior entry in the Identity store (a connected directory of type LDAP). The syntax is as follows:

[meta] supinfo
    -rdn attribute_type
    {-attribute attribute_value | -remove}
    [-bindid binding_id]

Options

-rdn attribute_type

A required option that specifies the naming attribute for the superior entry. For a connected directory of type LDAP, specify a valid LDAP attribute name.

-attribute attribute_list

Specifies one or more attributes to be applied to the superior entry. See the description of the -attribute option of the obj create operation in the obj reference pages for a description of attribute_list format. This option and the -remove option are mutually exclusive.

-remove

Deletes the attribute information for creating a superior entry. The -attribute option and this option are mutually exclusive.

-bindid binding_id

Specifies the binding ID to which the supinfo operation is to be applied. Specify a binding ID created by an obj bind operation.

The supinfo operation defines attribute information for the creation of superior entries in the Identity store. When it creates an entry in the Identity store (a connected directory of type LDAP), the meta addentry operation uses this information to create any required superior entries for the entry, if these superior entries do not already exist in the Identity store (a connected directory of type LDAP).

Use the -attribute option to specify the attributes to be applied to the superior entry. You must specify the ObjectClass (OCL for DAP connections, objectClass for LDAP connections) attribute as an attribute_list element; specifying additional attributes depends upon the object class (you must supply the mandatory attributes for the object class).

Use the -remove option to remove an attribute definition previously specified with supinfo.

When multiple binds are open to different LDAP directories, you can use the -bindid option to direct the supinfo operation to be applied to a specific bind. The binding_id argument to this option specifies the binding ID assigned to the bind during the obj bind operation. In this way, you can establish different sets of superior information, and then apply them to the appropriate connected directory. If the -bindid option is not used, the supinfo operation carries out the operation on the default bind.

Since there is no syntax checking, supinfo <→ openconn or supinfo <→ bind can be performed in any order. It is the responsibility of the user to keep supinfo/openconn/bind consistent for each bind ID.

Example

meta supinfo -rdn C -attribute objectClass=C -bindid ldb
meta supinfo -rdn O -attribute objectClass=organization
     -bindid ldb
meta supinfo -rdn OU -attribute objectClass=organizationalUnit
     -bindid ldb

See Also

addentry

meta terminate

Closes the metacp trace file and cleans up the metacp workspace. The syntax is as follows:

[meta] terminate

The terminate operation writes statistics to the trace file opened with the meta initialize operation (if -nostatistics not set) and closes it. Here is an example of the type of statistics written to the trace file:

# Statistics:
#     Number of X.500 entries: 110
#     Number of file entries: 14

#     Successful Additions: 1
#     Unsuccessful Additions: 1
#     Ignored Additions: 0
#     Successful Modifications: 3
#     Unsuccessful Modifications: 1
#      Ignored Modifications: 0
#      Ignored Modify-Attributes: 0
#      Ignored Delete-Attributes: 0
#      Ignored Add-Attributes: 0
#     Entries already up to date: 9

#     Successful Deletions: 2
#     Unsuccessful Deletions: 0
#     Ignored Deletions: 0

#     Successful Modify-DNs: 0
#     Unsuccessful Modify-DNs: 0
#     Ignored Modify-DNs: 0

Explanations:

  • Number of X.500 entries:

    Lists the number of entries read from the directory.

    There is only one global counter for entries read from the directory. As in some Tcl-Scripts several search operations are sent to the directory, the results can be overlapping and therefore that number can be misleading. In such scenarios, that number is therefore not the number of the basic search operation in the directory.
  • Number of file entries:

    Lists the number of entries read from a data file.

    There is only one global counter for entries read from data file. As in a synchronization template (Tcl scripts) several data files could be handled in parallel, that number is the total number of entries of all files.

    If the file is read a second time (e.g. while creating index lists), the entries are counted twice.

    Therefore, the number listed here may sometimes be misleading.

  • Successful Additions:

    Lists the number of successful ADD operations.

  • Unsuccessful Additions:

    Lists the number of unsuccessful ADD operations.

  • Ignored Additions:

    Lists the number of ADD operations that have been ignored, because the synchronization runs in TRIAL mode.

  • Successful Modifications:

    Lists the number of successful MODIFY operations.

  • Unsuccessful Modifications:

    Lists the number of unsuccessful MODIFY operations.

  • Ignored Modifications:

    Lists the number of MODIFY operations that have been ignored, because the synchronization runs in TRIAL mode.

  • Ignored Modify-Attributes:

    Lists the number of modify changes that are ignored, because the attribute flags (in the openconn operation) forbid to perform the modification.

  • Ignored Delete-Attributes:

    Lists the number of delete modifications that are ignored, because the attribute flags (in the openconn operation) forbid to perform the modification.

  • Ignored Add-Attributes:

    Lists the number of add modifications that are ignored, because the attribute flags (in the openconn operation) forbid to perform the modification.

  • Entries already up to date:

    Lists the number of entries that exist in the directory and whose attributes are already matching the attribute values read from the data file.

  • Successful Deletions:

    Lists the number of successful DELETE operations.

  • Unsuccessful Deletions:

    Lists the number of unsuccessful DELETE operations.

  • Ignored Deletions:

    Lists the number of DELETE operations that have been ignored, because the synchronization runs in TRIAL mode.

  • Successful Modify-DNs:

    Lists the number of successful MODIFY-DN operations.

  • Unsuccessful Modify-DNs:

    Lists the number of unsuccessful MODIFY-DN operations.

  • Ignored Modify-DNs:

    Lists the number of MODIFY-DN operations that have been ignored, because the synchronization runs in TRIAL mode.

If in meta initialize the parameter -nostatistics is set, the statistic information as listed above is not written to the tracefile.

In that case, the user is advised to integrate statistic information in his synchronization scripts. Before calling terminate, it’s his task to print this information using meta writetext.

Return Values

None.

Example

meta terminate

See Also

initialize, writetext

meta unescapechar

Unescapes one or more characters in a string. The syntax is as follows:

[meta] unescapechar string

The unescapechar operation "unescapes" one or more characters in a string by removing the backslash (\) prefix (previously inserted with meta escapechar or returned by an obj search operation). and returns the unescaped string as a result.

Return Values

The unescaped string.

Example

The unescapechar operation

meta unescapechar f\{1\}\=2

returns the string f{1}=2

See Also

escapechar

meta writeindexlist

Writes information about an entry into an index list. The syntax is as follows:

[meta] writeindexlist
    -handle index_list_handle
    -name distinguished_name
    -entry entry_handle

Options

-handle index_list_handle

A required option that specifies the name of an index list handle created by a meta createindex operation.

-name distinguished_name

A required option that specifies the distinguished name of the entry to be written to the index list.

-entry entry_handle

A required option that specifies the name of the entry handle for the entry to be written to the index list. Specify an entry handle created by a meta getentry operation.

The writeindexlist operation writes an entry’s distinguished name and the entry handle into the index list specified in the -handle option. Obtain the distinguished name either from the Tcl variable created by meta getentry (if the distinguished name is stored in the entry) or from a Tcl mapping operation. Use the writeindexlist operation in conjunction with the meta createindexlist, meta getentry, and meta sortindexlist operations to create a sorted list (by distinguished name) of entries from a connected directory of type FILE for directory synchronization processing.

A writeindexlist operation cannot be performed on an index list that has already been sorted with the sortindexlist operation.

Example

meta writeindexlist -handle ih \
    -name cn=fou,ou=mfg,o=pqr,c=de \
    -entry eh

See Also

getentry, createindexlist, sortindexlist

meta writerecord

Writes the contents of an entry into a connected directory. The syntax is as follows:

[meta] writerecord
    -entry entry_handle

Options

-entry entry_handle

The handle to the entry to be written. Specify the name of a handle created by a meta gethandle operation called with a -conn option that specifies a connection handle to a directory of type FILE (opened with openconn -type option FILE) that has been opened in WRITE or APPEND mode (opened with openconn -mode option WRITE or APPEND).

The writerecord operation writes the contents of the entry associated with entry_handle into the connected directory of type FILE inherited by entry_handle. The data format generated depends on the -format option specified in the openconn operation (TAGGED or NON-TAGGED) and the syntax specified in the attribute configuration file.

Example

meta writerecord -entry eh

See Also

gethandle, openconn, writetext

Attribute Configuration File Format (Chapter 2)

meta writetext

Writes text to a connected directory of type FILE that has been opened for WRITE or APPEND. The syntax is as follows:

[meta] writetext
    -conn connection_handle
    -text string
    [-nonewline flag]

Options

-conn connection_handle

A required option that specifies the name of a connection handle created by a meta openconn operation called with the -type FILE and the -mode WRITE or APPEND options.

-text string

The text to be written to the data file, enclosed in double quotation marks ("").

-nonewline flag

Controls whether a newline character is appended to string. Specify one of the keywords:

  • TRUE- Do not append a newline character

  • FALSE-Append a newline character (default)

The writetext operation writes the text string specified in the -text option to the output data file represented by the connection handle specified in the -conn option. Use the writetext operation to write headers, trailers and other text into a data file that contains entry information.

Example

meta writetext -conn conn_ch -text "Start of deleted entries"

See Also

gethandle, openconn

meta writetrace

Writes a trace message into the metacp trace file. The syntax is as follows:

[meta] writetrace
    -text string
    [-handle handle]

Options

-text string

The message to be written to the trace file, enclosed in double quotation marks ("").

-handle handle The name of an entry handle or a result handle that holds additional information to be traced. To trace an entry handle, specify the name of an entry handle created by a meta getentry or a meta gethandle operation. To trace a result handle, specify the name of a result handle created by an obj search operation.

The writetrace operation writes the message specified in the -text option into the trace file created and opened by the meta initialize operation. Use the -handle option to trace the current entry in a connected directory or to trace the contents of a search results list. Use the meta initialize -maxentries option to set a limit on the number of entries to trace in a search results list.

Example

meta writetrace -text "Base object 'O=pqr' does not exist"

See Also

getentry, gethandle, initialize, obj search