org.licas.def

## Interface DataServiceDef

- All Known Implementing Classes:
    Auto, AutoInterface, AutoSecure, DataService, ESB, InformationService, LinkService, ScriptService

      public interface DataServiceDef

  This defines the methods that should be implemented by a data service, to communicate the data with other services.
  Author:
    Kieran Greer

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dataXmlBM(java.lang.String adminKey)` This is used to send the current data and result to a behaviour mediator if one is running.
    `void` | `dataXmlDH(java.lang.String adminKey)` This is used to send the current data result to a data hub if one is running.
    `java.lang.String` | `getDataType()` Get the data type.
    `void` | `resetValues()` Reset variables for another test run.
    `boolean` | `setData(org.licas_xml.abs.Element dataXml, java.lang.String adminKey)` Set the value that this service will use as its data source.
    `boolean` | `setData(java.lang.String thisDataType, java.lang.Object thisDataObj, java.lang.String adminKey)` Set the value that this service will use as its data source.

- - ### Method Detail

    - #### resetValues

          void resetValues()

      Reset variables for another test run.

    - #### getDataType

          java.lang.String getDataType()

      Get the data type.
      Returns:
        the data type.

    - #### setData

          boolean setData(java.lang.String thisDataType,
                          java.lang.Object thisDataObj,
                          java.lang.String adminKey)
                   throws java.lang.Exception

      Set the value that this service will use as its data source. This method creates an `ObjResource` in the `DataModule` and stores the value directly.
      Parameters:
        `thisDataType` - the data type.
        `thisDataObj` - the data object.
        `adminKey` - the admin key for the service.
      Returns:
        true if set OK, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### setData

          boolean setData(org.licas_xml.abs.Element dataXml,
                          java.lang.String adminKey)
                   throws java.lang.Exception

      Set the value that this service will use as its data source. This method parses the data XML description to create the appropriate data `Resource` in the `DataModule`.
      Parameters:
        `dataXml` - the data description to parse.
        `adminKey` - the admin key for the service.
      Returns:
        true if set OK, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### dataXmlBM

          void dataXmlBM(java.lang.String adminKey)
                  throws PasswordException,
                         MethodNotFoundException,
                         java.lang.Exception

      This is used to send the current data and result to a behaviour mediator if one is running.
      1. The data object is the static metadata `Data` entry.
      2. The result object is retrieved and assumed to be in XMl here.
      3. This default method also sends link information.
      The behaviour service can aggregate all of the service info's, to produce graphs or other results.

      This version sends the data information to a service identified by `ServiceConst`.`BEHAVIOURMEDIATOR`. It includes the data element of this service, any links that it has formed and also the result of the evaluation process.

      Parameters:
        `adminKey` - as it would typically be called internally, it is protected by the service's admin key.
      Throws:
        `PasswordException` - incorrect password for the server or mediator service.
        `MethodNotFoundException` - the mediator does not have the calling method.
        `java.lang.Exception` - any other error.

    - #### dataXmlDH

          void dataXmlDH(java.lang.String adminKey)
                  throws PasswordException,
                         MethodNotFoundException,
                         java.lang.Exception

      This is used to send the current data result to a data hub if one is running. The data hub service can aggregate all of the service info's and make it available.

      This version sends the data information to a service identified by `ServiceConst`.`DATAHUB`. It includes the data element of this service, any links that it has formed and also the result of the evaluation process.

      Parameters:
        `adminKey` - as it would typically be called internally, it is protected by the service's admin key.
      Throws:
        `PasswordException` - incorrect password for the server or mediator service.
        `MethodNotFoundException` - the mediator does not have the calling method.
        `java.lang.Exception` - any other error.