The mergeprop utility manages and maintains OpenEdge property files. It includes a command-line interface, described in this topic, and a Java API, described in Java API.

Syntax

mergeprop -type file_type
           [-action operation_type [group_name]]
           [-target target_file] 
           [-delta delta_file]
           [-validate]
           [-nobackup]
           [-silent]
           [-recurse]

Parameters

-type (required) {ubroker|database|tools|plugin|none}
Each argument (other than none) implies a specific target file in the properties directory.
-target (optional) {update|create|delete|list group_name|listall group_name}
If no action is specified, then update is assumed by default.The list and listall actions require an additional argument, the name of the property group to be displayed (for example, ubroker.AS.asbroker1). Do not include the brackets ([]) that enclose the group name in the ubroker.properties file. With update and create actions, groups listed with no properties in the delta file are ignored.
-action Path to the property file to be modified
If you update a property file that is in the OpenEdge-install-dir/properties subdirectory, then you can omit this option. Only use this option when the property file you plan to update exists in a location other than the OpenEdge-install-dir/properties/ subdirectory.
-delta Path to the delta file containing changes to be made
The file containing create, update, or delete changes. To make changes with the mergeprop utility, you must list the affected groups and properties in a term delta file. The delta file must specify at least one property group. It can also specify one or more properties and associated values. The content of the delta file must conform to the syntax rules for property files.
Note: When listing (not changing) properties, you do not specify a delta file.

The delta file is expressed as an argument to the -delta command or as a parameter to the setTargetFile() or mergeprop() method.

-validate
Performs all processing without making changes to the target file. This option lets you test for errors.
-nobackup
Does not create a backup to the target file before making changes. Unless you invoke this option, mergeprop saves a copy of the original target file in the same directory. The backup copy has a system- generated unique string appended to the name (for example, ubroker.properties 31420040644533).
-silent
Suppresses all messages.
-recurse
Lists or deletes all groups, server groups, and configurations associated with the specified database.The recurse option is only valid when the file type is specified as database, and the action is identified as either list all or delete.
Note: The mergeprop utility is not intended for general user access. You must have Administrator rights to use this utility.

Property value

Command line input to the mergeprop command table identifies the value types that you can use to manage property files with the mergeprop utility. These property files allow you to:
  • Use the value of another existing property by reference.
  • Use the value of a Java system property by reference.
  • Specify a list of any number of syntactically valid values. The list entries are evaluated sequentially, and the first to be successfully resolved is the value of the property.
  • Specify a hexadecimal value.
In addition, two special value types can be included in the delta file specified with the mergeprop utility. These value types are valid only in the context of a delta file:
  • A value formed by appending a specified string to a current value
  • A system-generated globally unique identifier (GUID, or universally unique ID)

Target file

The target file is the existing property file in which you are operating. You can add, delete, modify, or list properties in the target file. The mergeprop utility automatically creates a backup of the original target file, unless you instruct it not to do so. You can also list existing properties without making any changes.

You can explicitly specify a target file, but it is not necessary to do so if you are operating on one of the standard property files listed in the following table. The file type that you provide as input implies a specific property file, which the program targets by default if no file is specified. These standard property files are located in the OpenEdge-Install-Directory\properties directory.

Table 1. Property files managed by the mergeprop utility
Property file Components configured Corresponding file type
ubroker.properties Unified Broker products, including all products managed through OpenEdge Management with the exception of the database products ubroker
conmgr.properties Database startup parameters database
JavaTools.properties Client-side tool configuration, for example OpenEdge Management and command-line tools tools
AdminServerPlugins.properties Plugin products loaded by the AdminServer plugins

If explicitly specified, the target file is expressed as an argument to the -target switch or as a parameter to the setTargetFile() or mergeprop() method.

File type

There are five distinct property file types:

  • ubroker
  • database
  • tools
  • plugin
  • none

As indicated in the property files managed by the mergeprop utility table, one standard property file of each type is found in the OpenEdge-install-dir\properties directory.

Specifying the file type enables the mergeprop utility to process delta and target files appropriately. It also makes it unnecessary to explicitly identify the target file, unless you are operating on a copy or test file other than the standard file in the properties directory. The program can recognize none as a valid type and perform default processing, but you should provide a specific type as input.

The file type is expressed as an argument to the -type command switch.

Action switch

Based on the operation_type you specify with the -action switch, the mergeprop utility operates on the target file in one of the following ways:

  • Update—Creates new property groups and modifies any existing groups found in the delta file. Properties in the target file are updated to match those in the delta file. This operation is performed by default if you do not explicitly specify an action.
  • Create—Creates new property groups listed in the delta file, with the properties specified in the delta file. (The delta file must contain only new groups. Including a group that already exists in the target file causes an error and cancels the operation.)
  • Delete—Removes from the target file any property groups listed in the delta file. The entire groups are deleted. Individual properties are not processed. No exception occurs if the delta file contains groups that do not exist in the target file. Such groups are ignored.
  • List—Displays (to stdout) all properties and values defined specifically for a given group. Inherited properties are not displayed.
  • List all—Displays (to stdout) all properties and values defined for a given group, including inherited properties.

    In this context, group refers to a group as listed in the ubroker.properties file, for example, UBroker.AS.asbroker1.

Note: The List and List all actions are useful for creating a delta file. You can redirect output to a file and use the result as a template for modifying existing instances or creating new ones.

mergeprop examples

The following examples show how you can perform various modifications using the mergeprop utility.

Define and add an instance

The first code example shows the contents of the delta file in which a new classic AppServer Broker instance, addasbroker2, is defined. The contents of this delta file is based on minor changes made to the sample default broker, asbroker1, as shown:

$ cat addasbroker2
[UBroker.AS.asbroker2]
appserviceNameList=asbroker2
brokerLogFile=@{WorkPath}\asbroker2.broker.log
portNumber=3092
uuid=932.99.999.XX:lee77e:cf3bbe3d33:-8000

The following code adds the new asbroker2 to the standard, OpenEdge-supplied ubroker.properties file:

$ mergeprop -type ubroker -action update -delta addasbroker2

This same command structure can be used to update a group.

Note: For an add action, you are only required to specify those properties whose values you intend to override. Default values are applied in all other circumstances.

Add a property

This example shows how to add a property specified as an environment property to the asbroker2 created in the earlier example.

The following code shows the environment property being added to the asbroker2 definition in the ubroker.properties file:

$ cat asbroker2prop
[UBroker.AS.asbroker2]
environment=asbroker2
[Environment.asbroker2]
MYENV=hello
$ mergeprop -type ubroker -action update -delta asbroker2prop

Delete a property

You can only delete a property at the group level.. You cannot delete a single property within a group. The following code shows how to delete the instance of asbroker2:

$ mergeprop -type ubroker -action delete ubroker.AS.asbroker2

Update properties

You can delete items in a property by updating the property:

  1. Save the property to a temporary file:
    $ mergeprop -type ubroker -action list UBroker.AS.asbroker2 > changeasbroker2
  2. Delete the property:
    $ mergeprop -type ubroker -action delete ubroker.AS.asbroker2
  3. Edit the temporary file, changeasbroker2, to remove the items no longer required.
  4. Add the property back to the ubroker.properties file:
    
     $ mergeprop -type ubroker -action update -delta changeasbroker2
    

List properties

The following code lists the properties defined specifically for the UBroker.AS.asbroker1 group in ubroker.properties, omitting the inherited properties:

$ mergeprop -type ubroker -action list UBroker.AS.asbroker1

The following code lists all properties of the UBroker.AS.asbroker1 group, including the inherited properties:

$ mergeprop -type ubroker -action listall UBroker.AS.asbroker1

The following code lists all properties, including the inherited properties of the FMCONFIGCLI.OSFI group in the file installation-path\%DLC%\properties/JavaTools.properties:

$ mergeprop -type tools -action listall FMCONFIGCLI.OSFI

The following code shows how to list a full group definition, specifically a full database group definition. In this example, the sports database is referenced and its full group definition, which lists all configurations and server groups associated with the sports database, is noted:

$ mergeprop -type database -action listall sports -recurse
[database.sports]
Autostart=false
Configurations=sports.defaultconfiguration
DatabaseName=/usr1/sports
DefaultConfiguration=sporsts.defaultconfiguration
DisplayName=sports
MonitoredLicense=true
[configuration.sports.defaultconfiguration]
AfterImageProcess=false
AsynchronousPageWriters=1
BeforeImageProcess=true
Database=sports
DisplayName=defaultConfiguration
Monitored=true
OtherArgs=
ServerGroups=sports.default.configuration.defaultservergroup
WatchDogProcess=true
[servergroup.serverGroups=sports.default.configuration.defaultservergroup]
Configuration=sports.defaultconfiguration
DisplayName=defaultServerGroup
Port=4441
Type=both

You can update a port specification for the sports database using the following commands:

$ cat changeport
[servergroup.sports.defaultconfiguration.defaultservergroup]
port=4444
$mergeprop -type database -action update -delta changeport