8 Configuration File


The HORB command can take -conf option, like;

    horb -conf sample.conf

where sample.conf is a configuration file.

See examples/config/all.conf for an example.

A configuration file is separated in four parts, 1) global configuration, 2) HORB servers configuration, and 3) autostart objects configuration, and 4) ACL configuration.

Each line in a configuration file has a key and a value conbined by '='.

       debug=true

Blank characters such as space or tab is not allowed around '='. Lines begins with ';' or '#' are comments.

Value must be one of them.

Keys are case insensitive.

8.1 Global Configuration

debug=BOOLEAN (default false)
If true, debug message will be displayed.
logfile=STRING (default none)
This is not supported yet.
aclMaster=BOOLEAN (default false)
If true, this HORB server becomes an ACL master server.

8.2 HORB Servers Configuration

If there is not a HORB server configuration in a configuration file or no -conf option is given to the HORB command, only one HORB server is started by a HORB command. Multiple HORB servers can be started from a configuration file.

Each key is a conbination is 'horbServer', server number rounded by [], and a subkey, for example:

Server number begins with zero. The above example starts two HORB servers in a HORB process, one for port 1990 and the other for port 1991.

horbServer[n].port=NUMBER (default 8887)
Starts a HORB server for port NUMBER.
horbServer[n].IOCIClassName=STRING (default horb.orb.BasicIOCI)
Starts a HORB server with given IOCI class. STRING must be a fully qualified classname of a IOCI class.
horbServer[n].HostNameLookup=BOOLEAN (default true)
If true, client's hostname is examined. If off, it gains speed. Usually keep this true.
horbServer[n].debug=BOOLEAN (default false)
If true, HORB server displays debug messages.
horbServer[n].loggig=BOOLEAN (default false)
If true, log messages are sent to a log file. This option is not implemented yet.

Here is an example that starts two HORB servers in a HORB process.

8.3 Autostart Objects Configuration

Arbitrary number of objects can be started automatically as daemon objects. Those become accessible immediately from clients.

Each key is a conbination is 'object', object number rounded by [], and a subkey, for example:

Object number begins with zero and it has meaning only in this configuration file.

object[n].className=STRING
Starts a daemon object of class STRING or interface STRING. STRING must be a fully qualified classname or interface name.
object[n].objectID=STRING
Starts a daemon object with the given object name. It must be unique in the HORB process.
object[n].implementation=STRING
If className is an interface, this class is used as an implementation class. STRING must be a fully qualified class name.
object[n].port=NUMBER (default 0)
Binds this object to the specified port. If 0, the object can be accessible from any port.

This example starts two daemon objects. Object[0] is a class, while Object[1] is an interface.

If you want to start only one object as a daemon object, you can use -start option of the HORB command.

8.4 ACL Configuration

HORB equips very strong security features. One of them is Distributed Access Control List described in the next section. ACL Configuration part specifies the sources of ACL and their properties.

Each key is a conbination is 'accessControl', ACL number rounded by [], and a subkey, for example:

ACL number begins with zero and ACL files are read in the system in this order.

accessControl[n].name=STRING
Name of this ACL file. This can be arbitrary string such like SECTION_ACL or LOCAL_ACL, but it must be unique in a HORB process. This name is used to give this ACL to ACL client machines, when this HORB process is a ACL master server.
accessControl[n].source=STRING
Source of this ACL file, either local file or remote ACL file. In case of a local file, STRING should begin with "file:" or NOT "horb:". For examples:

If STRING begins with "horb:", local ACL server downloads the specified ACL file from the specified ACL master server.

In this example, ACL master server is master.etl.go.jp. Object name is always SystemACLMaster. Ref part of the URL, SECTION_ACL, is ACL name at the master side. This Ref port must be same as the local ACL name.

accessControl[n].redistributable=BOOLEAN (default false)
If true and this HORB process is an ACL master server, ACL clients may download this ACL file.
accessControl.refreshInterval=NUMBER (default 0)
If not 0, ACL server reloads ACL files in NUMBER seconds interval. Reloading is done only for ACL files that are modified since last reloading. Reloading may occur either for load ACL files or for remote ACL files. This value is process wide value.

Here is an example using three ACL files.

accessControl.refreshInterval=3600

accessControl[0].name=USERLIST_ACL
accessControl[0].soruce=horb://master.etl.go.jp/SystemACLMaster#USERLIST_ACL
accessCtonrol[0].redistributable=true

accessControl[1].name=DEPARTMENT_ACL
accessControl[1].source=horb://cs.etl.go.jp/SystemACLMaster#DEPARTMENT_ACL
accessControl[1].redistributable=true

accessControl[2].name=LOCAL_ACL
accessControl[2].source=/usr/local/lib/horb/acl/local.acl
accessControl[2].redistributable=false

8.5 Configuring HORB Servers in a program

HORB servers might be started in your program instead of from a configuration file. See examples/multiServer for an example.