Skip to content
This repository was archived by the owner on Oct 28, 2019. It is now read-only.

File based instance configuration

Antonio García-Domínguez edited this page Sep 23, 2017 · 3 revisions

The server includes an API to manage Hawk instances, but sometimes you may prefer to set up those instances using plain old files. The server will be ready to receive user queries upon startup without any interaction from user or clients. Upon startup, the Hawk server reads and parses configuration files, and then it creates instances according to the configuration files.

NOTE: currently these configuration files are not updated on shutdown. If an instance configuration changes, this configuration is persisted through the Eclipse configuration area. The configuration files will not overwrite any of the changed settings either, except for the polling intervals (minimum and maximum).

Format

Configuration files are XML files that define the name of the instance and its configuration. The XML Schema can be found at HawkServerConfigurationSchema.xsd. A sample configuration file can be found at Sample Configuration File.

The XML should include the following elements:

Table 1: List of XML elements in configuration file

Element Name Parent Element Name multiplicity Value Description
‘hawk’ xml 1 None Root element
‘delay’ ‘hawk’ 1 None Polling configuration
‘plugins’ ‘hawk’ 0-1 None List of plugins (to be/that are) enabled
‘plugin’ ‘plugins’ 0-* None Plugin name
‘metamodels’ ‘hawk’ 0-1 None List of metamodels (to be/that are) registered
‘metamodel’ ‘metamodels’ 0-* None Metamodel parameters
‘repositories’ ‘hawk’ 0-1 None List of repositories (to be/that are) added
‘repository’ ‘repositories’ 0-* None Repository parameters
‘derivedAttributes’ ‘hawk’ 0-1 None List of derived attributes (to be/that are) added
‘derivedAttribute’ ‘derivedAttributes’ 0-* None Derived attribute parameters
‘derivation’ ‘derivedAttribute’ 0-1 None Derivation parameters
‘logic’ ‘derivation’ 0-1 CDATA section An executable expression of the derivation logic in the language specified.
‘indexedAttributes’ ‘hawk’ 0-1 None List of indexed attributes (to be/that are) added
‘indexedAttribute’ ‘indexedAttributes’ 0-* None Indexed attribute parameters

Table 2: ‘hawk’ attributes

Element Name Attribute name Optional/Required Type Description
‘hawk’ ‘name’ Required String The unique name of the new Hawk instance
‘backend’ Required String The name of the backend to be used (e.g.org.hawk.orientdb.OrientDatabase, org.hawk.orientdb.RemoteOrientDatabase)

Table 3: ‘delay’ attributes

Element Name Attribute name Optional/Required Type Description
‘delay’ ‘min’ Required String Minimum delay between periodic synchronization in milliseconds
‘max’ Required String Maximum delay between periodic synchronization in milliseconds (0 to disable periodic synchronization)

Table 4: ‘plugin’ attributes

Element Name Attribute name Optional/Required Type Description
‘plugin’ ‘name’ Required String e.g. (org.hawk.modelio.exml.listeners.ModelioGraphChangeListener, org.hawk.modelio.exml.metamodel.ModelioMetaModelResourceFactory, org.hawk.modelio.exml.model.ModelioModelResourceFactory)

Table 5: ‘metamodel’ attributes

Element Name Attribute name Optional/Required Type Description
‘metamodel’ ‘location’ Optional String Location of metamodel file to be registered
‘uri’ Optional String Metamodel URI. This value is set automatically by server to list registered metamodels

Table 6: ‘repository’ attributes

Element Name Attribute name Optional/Required Type Description
‘repository’ ‘location’ Required String Location of the repository
‘type’ Optional String The type of repository available repository types ()
‘user’ Optional String Username for logging into the VCS
‘pass’ Optional String Password for logging into the VCS
‘frozen’ Optional String If the repository is frozen (true/false)

Table 7: ‘derivedAttribute’ attributes

Element Name Attribute name Optional/Required Type Description
‘derivedAttribute’ ‘attributeName’ Required String The name of the derived attribute
‘typeName’ Required String The name of the type to which the derived attribute belongs
‘metamodelUri’ Required String The URI of the metamodel to which the de- rived attribute belongs
‘attributeType’ Optional String The (primitive) type of the derived attribute
‘isOrdered’ Optional String A flag specifying whether the order of the values of the derived attribute is significant (only makes sense when isMany=true)
‘isUnique’ Optional String A flag specifying whether the the values of the derived attribute are unique (only makes sense when isMany=true)
‘isMany’ Optional String The multiplicity of the derived attribute

Table 8: ‘derivation’ attributes

Element Name Attribute name Optional/Required Type Description
‘derivation’ ‘language’ Required String The language used to express the derivation logic. Available labguages in Hawk: org.hawk.epsilon.emc.EOLQueryEngine, org.hawk.orientdb.query.OrientSQLQueryEngine, org.hawk.epsilon.emc.EPLQueryEngine

Table 9: ‘indexedAttribute’ attributes

Element Name Attribute name Optional/Required Type Description
‘indexedAttribute’ ‘attributeName’ Required String The name of the indexed attribute.
‘typeName’ Required String The name of the type to which the indexed attribute
‘metamodelUri’ Required String The URI of the metamodel to which the indexed attribute belongs.

Location

Configuration files are expected to be located in the ‘configuration’ folder in the server’s home directory. Each Hawk instance should have its own configuration file. There are no rules on how the file should be named. It is a good practice to include hawk instance name in the file name for easy recognition.

How to use/enable Hawk instance configuration engine

You can follow this video tutorial, or alternatively follow these steps:

  1. Download the hawk-server-*.zip file for your operating system and architecture of choice from Hawk Server With Configuration)
  2. Create a configuration file for each instance required to run in the Hawk server.
  3. Edit configuration files:
  • Set instance name, backend, delay
  • Add list of plugins to be enabled
  • Add metamodel file to location to be registered
  • Add repositories that are to be indexed
  • Add any required derived attributes
  • Add any required indexed attributes
  1. Save the configuration files to the ‘configuration’ folder in the server’s home directory (see figure 1)
  2. Perform any other configuration that are required by Hawk Server and start the server (by following instructions at Deploying-and-running-the-server)
  3. Check if the hawk instances are added and running by typing ‘hawkListInstances’ in the server’s command terminal:

Usage Notes

Clone this wiki locally