Execution Manager Cookbook
This document includes instructions about installing and running the SENSEI Execution Manager.
Table of Contents
Introducion
The Execution Manager executes Execution Plans that the SQR created as a result of requests from Resource Users. The requests are either for retrieving information or executing actuation tasks. As the Figure shows, the Execution Manager consists of two logical internal components, the Request Management that executes the Execution Plan and the Request Monitoring that monitors the request execution in case of long-term requests.
Request Management
The Request Management executes short term requests received via the requestInformation operation as well as long term requests received via the requestSubscription or updateSubscription operations. The Request Management will process the requests and in the first case return information received from the Resources and in the second case set up sessions between Resources and Resource Users.
Request Monitoring
The Request Monitoring monitors the availability and reliability of REPs in order to provide a good quality of long term requests. After set up the a long term subscription by the Request Management, the Request Monitoring will set up the needed subscriptions to monitor the intended resources. When the Request Monitoring is notified that a change happened, it will notify the requesting ressource user.
Installation
Requirements
For the Execotion Managet, the following aditional Software is required:
- Java JDK or SDK, version 6.0 or higher. (tested with version 1.6.0_20) http://java.sun.com/javase/downloads/widget/jdk6.jsp
- MqSQL Server, version 5.0 or higher http://dev.mysql.com/downloads/mysql
Software Download
The Execution Manager and additional needed software packages are available from the following link.
To ensure the links berween the packages, all the software packsges have to be unpacked into the same directory
MYSQL Setup
After installing mysql a a new database with the name sensei_em
has to be created. This could be done with an mysql frontend or by executing the following command on the commmand line:
mysql --user YOURMYSQLUSERNAME -p -e"create database sensei_em;"
Then add mysql structure as defined in file executionManager/doc/database.sql. This can be done with the command
mysql --user YOURMYSQLUSERNAME -p sensei_em < executionManager/doc/database.sql
Execution Manager Configuration
open the File executionManager/xml/EmConfigs.xml and change the lines
<mysqluser>root</mysqluser> <mysqlpassword>root</mysqlpassword>
according to your mysql settings, and the lines
<Domain>localhost</Domain> <Port>8180</Port>
according to your preferences, where the REI Interface shall be deployed.
Run the Execution Manager
Startscripts
For your conveniance, start scripts for the Execution Manager had beed created. For staring the Execution Manager, change to the directory executionManager/scripts and execute the command following command on Linux:
./runExecutionManager.sh
or on Windows:
runExecutionManager.bat
Interfaces
The Execution Manager provides the REI interface on the given IP Adress and Port as defined in the Configuration File. Therefore, the REI interface of the Execution Manager can be accesed on the URL:
http://IP_OF_EM:PORT_OF_EM/subscribe
Example of REI Request
An example of a subscription request with one REP on the REI interface can be seen here. Thix XML Structure is tranmitted via http POST or GET to the REI interface of the execution manager. It can be seen that the Taskplan is embedded in a REI and a Requestsubscription structure.
<?xml version="1.0" encoding="UTF-8"?> <REI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="REI_TaskPlan.xsd"> <RequestSubscription> <TaskPlan> <TaskPlanNode> <ResourceType>WKRT_SENSOR</ResourceType> <ResourceID>0</ResourceID> <ResourceDescriptionID>0</ResourceDescriptionID> <RequestSpecification xsi:type="SubscriptionSpecification"> <Selector xsi:type="ContextSelector"> <EntityID>Room123</EntityID> <EntityType>http://sensei/Room</EntityType> <ContextAttribute> <AttributeName>http://sensei/hasIndoorTemperature</AttributeName> </ContextAttribute> </Selector> <Restriction/> <Scope/> <NotificationConditionSpecification> <Period>10000.0</Period> <OnlyOnChange>true</OnlyOnChange> <ThresholdSpecification> <Operation>GREATER_THAN</Operation> <ThresholdValue>25</ThresholdValue> </ThresholdSpecification> </NotificationConditionSpecification> <Callback>http://localhost:8179/notify/input0/SID00</Callback> <Lifetime>100000</Lifetime> <Contextualize>false</Contextualize> </RequestSpecification> <Operation>POST</Operation> <OperationURL>http://localhost:8190/s/temp123</OperationURL> <OperationParameters xsi:type="WKRTSensorSubscription"> <URL>http://localhost:8179/notify/input0/SID00</URL> <Period>10000</Period> <OnlyOnChange>1</OnlyOnChange> <Threshold> <Operation>1</Operation> <Value>25</Value> </Threshold> </OperationParameters> </TaskPlanNode> </TaskPlan> </RequestSubscription> </REI>
Attachments (1)
- em.png (42.4 KB) - added by 12 years ago.
Download all attachments as: .zip