Entity class

All registrars have to sub-class psoft.hsphere.manager.Entity class. This class is bundled with Registrar SDK, and can be found in RegistrarSDK.jar. The class implements persistance for registrar settings. While used in H-Sphere, the class will use h-sphere database to store & load data. Yet, in Registrar SDK it reads (but does not write) data from file. This mode was specifically designed to accomodate new registrar development without the need of h-sphere system.

How to use Entity class

To instantiate your registrar, you have to:
  1. create file in /path/to/entity_file_dir, named ID.entity. The ID is any integer. You will pass it to your registrar constructor as a first Integer argument (see Implementing Registrar).
  2. Add a statement to your java code: Entity.setBase("/path/to/entity_file_dir")
  3. Instatiate your registrar, by calling constructor, and passing entity ID.

When used with default Register SDK junit test system (see Testing Your Registrar), the file name has to be 1.entity and file has to reside in entity directory inside Registrar SDK base directory. You don't have to call Entity.setBase(...) anywhere, as it will be done for you by the test suite. The entity file itself has to be defined

Entity file format

ID.entity file is used to define name/value pairs that are loaded by registrar. The file is used for testing purposes. It is needed to provide to registrar configuration data, that in real system would be entered by admin through web interface.

The syntax of entity files is:
name1=value1
name2=value2
name3=value3
...
Example:
server=www.onlinenic.com
port=20001
login=123545
password=test123