Home Documentation
Download Report a Bug/Github About Contact

Configuring RedDog’s response Events

Index

Introduction

If the implementer wants to add events in every request response, it is necessary to configure an events configuration file considering the following details:

The content of the events can be configured in the WEB-INF/notices/ directory by creating an XML file named events.xml. This file is optional, so there is no events.xml default configuration file.

The events.xml file must have the following format:

The formal definition of the event can be found here.

The formal definition of the link array can be found here.

Here is an example of a events.xml file with all the elements that can contain the file.

<events>
   <event>
      <eventAction>registration</eventAction>
      <eventActor>An event actor</eventActor>
      <eventDate>2018-12-30T23:59:59Z</eventDate>
      <links>
         <link rel="" href="http://example.com" hreflang="" title="" media="" type="">http://example.com</link>
         <link rel="" href="http://example.com/file" hreflang="" title="" media="" type="">http://example.com/file</link>
      </links>
   </event>
   <event>
      <eventAction>last update of rdap database</eventAction>
      <eventDate>2018-12-30T23:59:59Z</eventDate>
      <links>
         <link rel="" href="http://example.com" hreflang="" title="" media="" type="">http://example.com</link>
         <link rel="" href="http://example.com/file" hreflang="" title="" media="" type="">http://example.com/file</link>
      </links>
   </event>
</events>

Querying live DB

When a RDAP service provider is querying its database directly, and therefore, using real-time data, and also an eventAction of type last update of RDAP database exists in the events file, the implementer may require that the timestamp in the event being the time when the client perform the request, in this case, the value can be override it by enabling the property is_db_data_live in the configuration.properties file.

Updater thread

The RDAP server contains a thread that constantly checks if there are changes in the “events” file.

The file required to update the old “events.xml” files should add the extension .updated

This thread is activated when the value events_timer_update_time in configuration.properties is greater than or equal to 10.

The thread will execute the verification every events_timer_update_time seconds, checking if there are files to be updated, if it detects that the files exist, then the thread reads and validates the new file and if valid, it will update the events in the requests and also will replace the previous file. Otherwise, if no new event file exists, the thread will fall asleep and wake up after the configured seconds.

Where to go next