Roots remote server and client

Content

  1. Roots remote server and client
    1. Content
    2. Introduction
    3. RemoteServerAgent factory
    4. RemoteClientAgent factory

Introduction

The agent factories RemoteServerAgent and RemoteClientAgent can be used to create Roots agents for sending data from Roots client to Roots server.
For more informations about creating Roots application containing Roots agents see TODO link.

In the following chapters the definition and creation of application specific RemoteServer agents and RemoteClient agents will be described.

RemoteServerAgent factory

To define an agent (processor) for receiving data from Roots client the factory name /RemoteServerAgent must be used as value of the configuration property useFactory in the processor definition definition.
The processor property remoteTarget is mandatory and must be identical to the corresponding property in the remote client agent.

Received data are saved in properties of outgoing agent event (in example: myRemoteServerOutEvent event).
Event property names of server agent outgoing event correspond to the event property names of the client agent.

Example:

<rem:processor NAME="MyRemoteServerProcessor">

<rem:properties>
<rem:property name="remoteTarget" type="String" valueKind="REQUIRED" value="myTarget"></rem:property>
</rem:properties>
<rem:configProperties>
<rem:property name="useFactory" type="String" valueKind="FIXED" value="/RemoteServerAgent">
</rem:property>
<rem:property name="instantiate" type="Boolean" valueKind="REQUIRED" value="true">
</rem:property>
</rem:configProperties>
<rem:outgoingEventTypes>
<rem:outgoingEventType eventTypeName="myRemoteServerOutEvent"></rem:outgoingEventType>
</rem:outgoingEventTypes>

</rem:processor>

The schema definition(s) must be placed in RES-INF directory of the application bundle an instantiated by @LoadSchema annotation on bundle Activator class.

Example of Activator class implementation containing schema instantiation:

@LoadSchema(details = { @Schema(dependsOn = { RemoteServerAgent.MY_SCHEMA },
file = "mySchemaDefinition.xml", name = "mySchema") })
public class MyActivator extends AECPActivator {
...
}

RemoteClientAgent factory

To define an agent (processor) for sending data to Roots server the factory name /RemoteClientAgent must be used as value of the configuration property useFactory in the processor definition definition.
The processor property remoteTarget is mandatory and must be identical to the corresponding property in the remote server agent.
RemoteClientAgent contains two further mandatory properties: remoteUrl and clientId.
remoteUrl identifies the server IP and may also include the port. clientId is the unique client identifier.

Data to be send from client to server are saved in properties of incoming agent event (in example: myRemoteClientInEvent event).
If connection is refused, agent will try it again if retry event is defined (in example: myRetryRemoteClientInEvent).
Retry event is optional.
Wait time to next try is set to 5 milliseconds by default and can be changed by optional agent property waitTime.

Example:

<rem:processor NAME="MyRemoteClientProcessor">

<rem:properties>
<rem:property name="remoteTarget" type="String" valueKind="REQUIRED" value="myTarget"></rem:property>
<rem:property name="remoteUrl" type="String" valueKind="REQUIRED" value="localhost:8080"></rem:property>
<rem:property name="clientId" type="String" valueKind="REQUIRED" value="comp1"></rem:property>
<rem:property name="waitTime" type="Long" valueKind="DEFAULT" value="10000"></rem:property>
</rem:properties>
<rem:configProperties>
<rem:property name="useFactory" type="String" valueKind="FIXED" value="/RemoteClientAgent">
</rem:property>
<rem:property name="instantiate" type="Boolean" valueKind="REQUIRED" value="true">
</rem:property>
</rem:configProperties>
<rem:incomingEventTypes>
<rem:incomingEventType eventTypeName="myRemoteClientInEvent"></rem:incomingEventType>
<rem:incomingEventType eventTypeName="myRetryRemoteClientInEvent"></rem:incomingEventType>
</rem:incomingEventTypes>
<rem:outgoingEventTypes>
<rem:outgoingEventType eventTypeName="myRetryRemoteClientInEvent"></rem:outgoingEventType>
</rem:outgoingEventTypes>
</rem:processor>

The schema definition(s) must be placed in RES-INF directory of the application bundle an instantiated by @LoadSchema annotation on bundle Activator class.

Example of Activator class implementation containing schema instantiation:

@LoadSchema(details = { @Schema(dependsOn = { RemoteClientAgent.MY_SCHEMA },
file = "mySchemaDefinition.xml", name = "mySchema") })
public class MyActivator extends AECPActivator {
...
}