Hawk server includes an API to add Hawk instances that are used to index and query models. The configuration engine allows the server to create and configure Hawk instances as per user-created configuration files. The server should be ready to receive user queries upon startup without any interaction from user or clients. Upon startup, Hawk server reads and parses configuration files, and then it creates/updates hawk instances as per configuration files.

NOTE: the Hawk server no longer writes to configuration files. If an instance configuration changes during operation, this configuration is persisted through the current HawkConfig mechanism. Configuration files will not overwrite any of the changed settings. The only exception is the polling min/max which will revert to config file settings if a server is restarted.

Format

Configuration files are XML files that define hawk instance name and its configuration. An 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 NameParent Element NamemultiplicityValueDescription
‘hawk’xml1NoneRoot element
‘delay’‘hawk’1NonePolling configuration
‘plugins’‘hawk’0-1NoneList of plugins (to be/that are) enabled
‘plugin’‘plugins’0-*NonePlugin name
‘metamodels’‘hawk’0-1NoneList of metamodels (to be/that are) registered
‘metamodel’‘metamodels’0-*NoneMetamodel parameters
‘repositories’‘hawk’0-1NoneList of repositories (to be/that are) added
‘repository’‘repositories’0-*NoneRepository parameters
‘derivedAttributes’‘hawk’0-1NoneList of derived attributes (to be/that are) added
‘derivedAttribute’‘derivedAttributes’0-*NoneDerived attribute parameters
‘derivation’‘derivedAttribute’0-1NoneDerivation parameters
‘logic’‘derivation’0-1CDATA sectionAn executable expression of the derivation logic in the language specified.
‘indexedAttributes’‘hawk’0-1NoneList of indexed attributes (to be/that are) added
‘indexedAttribute’‘indexedAttributes’0-*NoneIndexed attribute parameters

Table 2: ‘hawk’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘hawk’‘name’RequiredStringThe unique name of the new Hawk instance
‘backend’RequiredStringThe name of the backend to be used (e.g.org.hawk.orientdb.OrientDatabase, org.hawk.orientdb.RemoteOrientDatabase)

Table 3: ‘delay’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘delay’‘min’RequiredStringMinimum delay between periodic synchronization in milliseconds
‘max’RequiredStringMaximum delay between periodic synchronization in milliseconds (0 to disable periodic synchronization)

Table 4: ‘plugin’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘plugin’‘name’RequiredStringe.g. (org.hawk.modelio.exml.listeners.ModelioGraphChangeListener, org.hawk.modelio.exml.metamodel.ModelioMetaModelResourceFactory, org.hawk.modelio.exml.model.ModelioModelResourceFactory)

Table 5: ‘metamodel’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘metamodel’‘location’OptionalStringLocation of metamodel file to be registered
‘uri’OptionalStringMetamodel URI. This value is set automatically by server to list registered metamodels

Table 6: ‘repository’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘repository’‘location’RequiredStringLocation of the repository
‘type’OptionalStringThe type of repository available repository types ()
‘user’OptionalStringUsername for logging into the VCS
‘pass’OptionalStringPassword for logging into the VCS
‘frozen’OptionalStringIf the repository is frozen (true/false)

Table 7: ‘derivedAttribute’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘derivedAttribute’‘attributeName’RequiredStringThe name of the derived attribute
‘typeName’RequiredStringThe name of the type to which the derived attribute belongs
‘metamodelUri’RequiredStringThe URI of the metamodel to which the de- rived attribute belongs
‘attributeType’OptionalStringThe (primitive) type of the derived attribute
‘isOrdered’OptionalStringA flag specifying whether the order of the values of the derived attribute is significant (only makes sense when isMany=true)
‘isUnique’OptionalStringA flag specifying whether the the values of the derived attribute are unique (only makes sense when isMany=true)
‘isMany’OptionalStringThe multiplicity of the derived attribute

Table 8: ‘derivation’ attributes

Element NameAttribute nameOptional/RequiredTypeDescription
‘derivation’‘language’RequiredStringThe 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 NameAttribute nameOptional/RequiredTypeDescription
‘indexedAttribute’‘attributeName’RequiredStringThe name of the indexed attribute.
‘typeName’RequiredStringThe name of the type to which the indexed attribute
‘metamodelUri’RequiredStringThe 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