Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

SMILA/Documentation/Mock Agent

< SMILA‎ | Documentation
Revision as of 05:43, 24 January 2012 by (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is deprecated for SMILA 1.0, the connectivity framework is still functional but will aimed to be replaced by scalable import based on SMILAs job management.


The Mock agent is a sample implementation of an agent used for testing. It creates new records in a configurable interval and sends add requests to the AgentController.

A record can contain the following attributes:

  • Identifier
  • MimeType
  • LastModifiedDate
  • Content

Agent configuration

The example configuration file is located at configuration/org.eclipse.smila.connectivity.framework/mockAgent.xml.

Defining Schema: org.eclipse.smila.connectivits.framework.agent.mock/schemas/MockDataSourceConnectionConfigSchema.xsd.

Agent configuration explanation

The root element of the configuration is DataSourceConnectionConfig and contains the following sub elements:

  • DataSourceID – the identification of a data source
  • SchemaID – specifies the schema for the data source
  • DataConnectionID – describes which agent or crawler should be used
    • Crawler – service ID a crawler
    • Agent – service ID of an agent
  • CompoundHandling – specify if packed data (like a ZIP container containing files) should be unpack and files within should be processed(YES or NO).
  • Attributes – list all attributes provided by the data source
    • Attribute
      • Type (required) – the data type (String, Integer or Date).
      • Name (required) – attributes name.
      • HashAttribute – specify if a hash should be created (true or false).
      • KeyAttribute – creates a key for this object, for example for record id (true or false).
      • Attachment – specify if the attribute return the data as attachment of record.
  • Process – contains parameters for the agent business logic.
    • SleepTime – the number of seconds to wait betweeen creation of records.

Mock agent configuration example

    <Attribute Type="Date" Name="LastModifiedDate" HashAttribute="true">
    <Attribute Type="String" Name="Path" KeyAttribute="true">
    <Attribute Type="String" Name="Content" Attachment="true" MimeTypeAttribute="MimeType">
    <Attribute Type="String" Name="MimeType">

Output example

A record created by the Mock agent will have the following structure:

<Record xmlns="" version="2.0">
  <Val key="_recordid">mockAgent:&lt;Path=1241449855624&gt;</Val>
  <Val key="_source">mockAgent</Val>
  <Val key="LastModifiedDate" type="datetime">2009-05-04 16:44:46.541</Val>
  <Val key="Path">1241449855624</Val>
  <Val key="MimeType">text/html</Val>

See also

Back to the top