Apc Push Service Via Soap Examples v3.0

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

Reference manual

Push Service via SOAP Examples


Automatic People Counter APC
HAGL-120-00058, 2015-04, SW 3.0

HAGL-120-00058, 2015-04, SW 3.0


Hella KGaA Hueck & Co.
Rixbecker Strasse 75
59552 Lippstadt
Germany

Hella Aglaia Mobile Vision GmbH


Treskowstrasse 14
13089 Berlin
Germany
Telephone: +49 30 200 04 29 140
Fax: +49 30 200 04 29 149
Email: peoplecounter@hella.com
Internet: www.hella.de/peoplecounter

© 2015 Hella KGaA Hueck & Co., Lippstadt (hereinafter called 'Hella')

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
2
Table of contents

Table of contents
1 Introduction.......................................................................................................................................... 5
2 .NET Example....................................................................................................................................... 6
2.1 SOAPdServer.............................................................................................................................. 6
2.1.1 IIS server setup............................................................................................................ 6
2.2 SOAPd Server Control.............................................................................................................. 13
2.2.1 Connecting to the SOAP server................................................................................. 13
2.2.2 Viewing the APC SOAP communication.................................................................... 14
2.2.3 Managing the task list................................................................................................ 15
2.2.4 Creating a new task................................................................................................... 16
2.2.5 Monitoring a list of APC devices................................................................................ 17
3 Java Example..................................................................................................................................... 19
3.1 Build environment...................................................................................................................... 19
3.1.1 Installing the Java Development Kit........................................................................... 19
3.1.2 Installation of the Apache Maven Build Tool.............................................................. 19
3.1.3 Customizing the Maven Build Environment............................................................... 20
3.1.4 Setting up Maven to Work with a HTTP Proxy........................................................... 21
3.1.5 Appendix - Additonal JVM Options............................................................................ 21
3.1.6 Appendix - Installing Eclipse Java Enterprise Edition Juno....................................... 22
3.2 Building the sources.................................................................................................................. 26
3.2.1 Building APC.BIKE.Core............................................................................................ 27
3.2.2 Building APC.BIKE.Proxy........................................................................................... 29
3.2.3 Building APC.BIKE.DataLogger................................................................................. 31
3.2.4 Building APC.BIKE.ProxyDemo................................................................................. 31
3.2.5 Building APC.BIKE.DataLoggerDemo....................................................................... 33
3.2.6 Deploying the ProxyDemo application....................................................................... 33
3.2.7 Deploying the DataLoggerDemo application.............................................................. 33
3.3 Architecture............................................................................................................................... 34
3.3.1 APC.BIKE layered architecture.................................................................................. 34
3.3.2 Core API and Device Manager.................................................................................. 35
3.3.3 Application Management............................................................................................ 36
3.3.4 Device Management.................................................................................................. 37
3.3.5 Applications, Application Devices and Subscriptions................................................. 38
3.3.6 Managed Devices and Subscriptions......................................................................... 40
3.3.7 Application Layer........................................................................................................ 41
3.3.8 Available Demonstrations.......................................................................................... 42
3.4 Appendix - Classes and Log Messages.................................................................................... 44
3.4.1 APC Notification Messages........................................................................................ 45
3.4.2 Supported Subscriptions............................................................................................ 46
3.4.3 Trigger Support.......................................................................................................... 47

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
3
Table of contents

3.4.4 Digital I/O Support...................................................................................................... 48


3.4.5 Important Core API Log-Messages............................................................................ 48
4 Disclaimer.......................................................................................................................................... 51
5 Glossary and abbreviations............................................................................................................. 52

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
4
Introduction

1 Introduction
This document is in addition to the Hella "Reference manual Push
Service via SOAP". It includes the description of backend exam-
ples for developers. These examples are usable as try out or as a
reference implementation of the communication. Hella provide only
the APC sensors with protocols - no backend or database systems.

References

Example Link/Name Description


1 all Reference manual Push Service via Hella reference manual of Push Services via
SOAP (HAGL-120-00045) SOAP protocol
2 .NET SOAPdServerProject.zip Hella Push Services communication
example .NET server library for Microsoft IIS
and Demo Control Client Application
3 Java APC-BIKE.zip Hella Push Service Java example including
communication classes and simple demos
4 all http://www.w3.org/TR/soap/ W3C: SOAP Specifications
5 all http://www.cs.fsu.edu/~engelen/ gSOAP Toolkit
soap.html
6 Java http://www.oracle.com/technetwork/ Java SE Development Kit from the Oracle
java/javase/downloads/java-archive- downloads site
downloads-javase7-521261.html
7 Java http://maven.apache.org/download.cgi Apache Maven 3.0.5 from the apache.org
downloads site
8 Java http://maven.apache.org/settings.html Description of the Maven configuration set-
tings.
9 Java http://maven.apache.org/ Description of the Maven Proxy configuration
settings.html#Proxies settings.
10 Java http://www.eclipse.org/downloads/ Eclipse JavaEE Juno SR2 from the Oracle
packages/release/juno/sr2 downloads site
11 Java J. Kotamraju (Editor), The JAVA API Comprehensive JAX-WS documentation cov-
for XML-Based Web Services (JAX- ering WSDL to Java and Java to WSDL map-
WS) 2.2 – Maintenance Release, 10. ping as well as the web-service API.
December 2009, Sun Microsystems,
Inc., Santa Clara, US
12 Java Oracle, JAX-WS 2.2.8 Release Docu- Covers JAX-WS 2.2.8 release specific issues,
mentation, 25. July 2012 known problems and bug fixes.
https://jax-ws.java.net/2.2.8/docs/
release-documentation.pdf

Support
Service requests regarding the Automatic People
Counter and Push Services via SOAP can be sent to
the following e-mail address:
– people.counter.support@hella.com

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
5
.NET Example
SOAPdServer > IIS server setup

2 .NET Example
As an example for Microsoft Windows 7, the demonstration
includes:
n a .NET server library as add-on to Microsoft Internet Informa-
tion Services (IIS),
n a .NET control client application to view pushed data and to
create and send tasks.
The communication between server and APC is described by
SOAPd.wsdl (see file BaSS_SOAPd.wsdl).
The communication between server and control client is described
by Control.wsdl (SOAPdControl.wsdl).
Both reference SOAPd.xsd (BaSS_SOAPd.xsd). See Fig. 1 for an
overview.

Fig. 1: Demo server

We use Microsoft Visual Studio 2010 with installed Visual C# and


Visual Web Developer and the Service Pack 1 Maintenance on a
Windows 7 Professional System as tool chain.
The file SOAPdServerProject\source\SOAPdServer
\SOAPdServer.sln should be opened in Visual Studio. This sol-
ution consists of 3 parts: the 2 applications above and the genera-
tion of the SOAP stubs using the Microsoft wsdl.exe in the
Create-SOAPdStups.bat batch file in sub-solution
SOAPdServiceDefinition.
The generated parts are the SOAPdService.dll as SOAP server
for the IIS and the SOAPd-ControlClient.exe application.

2.1 SOAPdServer
2.1.1 IIS server setup
The setup of IIS for SOAP comprises several steps. This setup
guide is only a demonstration how the initial Intranet access to the
demo SOAP server is established.

WARNING!
This setup guide is not a general or comprehensive
setup guide for an IIS server on the Internet!

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
6
.NET Example
SOAPdServer > IIS server setup

IIS setup
- Enable IIS

Fig. 2: Enabling the IIS


1. Go to "Control Panel", "Programs and Features", "Turn Win-
dows features on or off" to enable the Microsoft "Internet
Information Services" (IIS) ( Fig. 2).
- Copy server library directory to IIS 2. Copy the "SOAPdService" directory with the complete set
of generated server libraries from SOAPdServerProject
\source\SOAPdServer\SOAPdService\ to C:\inetpub
\wwwroot\SOAPdService\ (root permissions are
required).
- Create log file path 3. Create the directory C:\inetpub\Log (root permissions are
required). Do not mix up "Log" with the existing IIS "logs"
directory.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
7
.NET Example
SOAPdServer > IIS server setup

- Open the firewall for incoming


APC SOAP data

Fig. 3: Firewall setup


4. Go to "Control Panel", "Windows Firewall", "Advanced Set-
tings", "Inbound Rules" and enable and allow the rules
"World Wide Web Services (HTTP Traffic-In)" and, if neces-
sary, "World Wide Web Services (HTTPS Traffic-In)" (
Fig. 3).
- Add virtual path to default website

Fig. 4: IIS Manager


5. Go to "Control Panel", "Administrative Tools", "Internet Infor-
mation Service (IIS) Manager" ( Fig. 4) and navigate to
"Default Web Site" ( Fig. 5).

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
8
.NET Example
SOAPdServer > IIS server setup

Fig. 5: "Add Virtual Directory" option


6. Right-click on "Default Web Site" to open the context menu
and choose "Add Virtual Directory...". ( Fig. 6).

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
9
.NET Example
SOAPdServer > IIS server setup

Fig. 6: Choose the path to the server library


7. Name the alias "SOAPdService" and choose the path to the
server library copied in step Ä ‘IIS setup’ on page 7 (Fig. 6).
Click the "Connect as..." button and select "Application user
(pass-through authentication)".
- ASP.NET registration 8. To configure the Active Server Pages .NET registration,
startup a command shell as root and use the following com-
mands:
cd C:\Windows\Microsoft.NET\Framework
\v4.0.30319
aspnet_regiis -i
iisreset
If iisreset cannot be found, use %SYSTEMROOT%
\System32\iisreset.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
10
.NET Example
SOAPdServer > IIS server setup

- Change to ASP.NET v4.0

Fig. 7: Change to ASP.NET v4.0


9. Go back to the IIS Manager, right-click on "SOAPdService"
(shown below "Default Web Site") to open the context menu,
select "Convert to Application" and change the "Application
pool" to "ASP.NET v4.0" ( Fig. 7).

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
11
.NET Example
SOAPdServer > IIS server setup

- Change the "ASP.NET v4.0" iden-


tity to the local system

Fig. 8: Switch identity to the local system


10. In the IIS Manager, enable the "Application Pools" view,
right-click on "ASP.NET v4.0" to open the context menu and
select "Advanced Settings" to change "Identity" to "Local-
System" for the "Process Model" option ( Fig. 8).
- Startup the web site 11. Right-click on "Default Web Site" in the IIS Manger to open
the context menu and select "Start" (or "Restart" if it is
already running)

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
12
.NET Example
SOAPd Server Control > Connecting to the SOAP server

- Test the setup

Fig. 9: SOAPd web service


12. Test the setup with your favorite browser using the URL:
localhost/SOAPdService/SOAPdService.asmx
A screen as in Fig. 9 should appear.

2.2 SOAPd Server Control


The control client application enables you to view APC messages
and manage tasks of the server for the APCs. Start the
SOAPdControl-Client.exe.
It has three tab screens:
n the "Control" screen for connecting the server and logging
n the "Task" screen for displaying tasks lists and managing and
creating tasks
n the "Counter List" for displaying the state of APCs including IP,
MAC, last notifications, etc

2.2.1 Connecting to the SOAP server


Configure the service URL in the "Control" tab screen according to
your setup:
http://localhost/SOAPdService/SOAPdService.asmx
Click the "Connect" button and configure the "Refresh Interval" for
the server, e.g. select automatic refresh every 3 seconds. Review
your setup activities in the Log panel ( Fig. 10). (If only a connec-
tion error appears, please check your IIS configuration and access
rights.)

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
13
.NET Example
SOAPd Server Control > Viewing the APC SOAP communication

Fig. 10: SOAPd Server Control - "Control" tab screen

2.2.2 Viewing the APC SOAP communication


The Log panel on the "Control" tab contains messages sent by the
APC.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
14
.NET Example
SOAPd Server Control > Managing the task list

WARNING!
Timestamps and time zones
APC firmware starting with version 2.60 supports time
zones and send time stamps with time zone offsets
e.g. 2014-05-12T12:04:38.025271+02:00.
Microsoft Windows and used libraries by the SOAP-
dService demo only support UTC or local time with
timestamps and will cut time zone informations in
views and logfiles.

After restarting an APC (power off/on, allowing approx. 45 sec for


restarting) it sends a startup message to the server that should be
shown in this Log as in the following example:

Startup example
[15:58:03.98] Notification 1/1 received at
server-time: 15:57:56.96
<?xml version="1.0"?>
<NotificationContainer
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">
<startup_notification
mac_address="00:0B:91:20:00:55"
customer_ID="COUNTER200055"
task_type="TASK_STARTUP"
notification_ID="1"
serverTask_ID="0"
callerType_ID="SELF"
timestamp=
"2014-05-12T15:58:00.038445+02:00"
osd_state="OSD_STATE_NOT_AVAIL"
ip_address="192.168.100.10"
firmware_version="2.60.3.0"
customer_version="unsupported feature"
reboot_type="SOAP_REBOOT_POWERON"
xml_version=
"http://www.aglaia-gmbh.de/xml/
2013/05/17/BaSS_SOAPd.xsd"
xmlns=
"http://www.aglaia-gmbh.de/xml/
2013/05/17/BaSS_SOAPd.xsd" />
</NotificationContainer>

In addition to the log view in this application, all communication is


logged both APC and between servers and between application
and server in the following file:
C:\inetpub\Log\SOAPdService.Service.log

2.2.3 Managing the task list


To view and create tasks switch to the "Tasks" tab.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
15
.NET Example
SOAPd Server Control > Creating a new task

The top panel shows the status of tasks. In the "Task List" the
deployment status is shown for tasks that are sent from the control
client to the server and at least to the APCs. It is possible to
retrieve the current server task list or to push new control client
tasks to the server.
The APC supports 10 tasks - in addition to the two standard tasks
for the startup message and the cyclic Alive Message every 3
hours.

2.2.4 Creating a new task


Keep in mind that there is no direct connection to the APC. Only if
the APC itself connects to the server, the task can be deployed to
the APC. So a good idea for a test is to create Alive Message tasks
with the time trigger of every 5 seconds, deploy it to the server and
reboot the connected APC for the first deployment to the APC.
At the bottom of the "Tasks" tab ( Fig. 11), a new task can be cre-
ated with possible time- or event-based triggers. To create your
task, click the "Create New Task" button ( Fig. 11). To deploy the
new task to the server click "Apply Tasks to Server" ( Fig. 11). The
next time the APC sends a message to the server it will retrieve the
new task and the status of the task will change to "Counter".
To deploy tasks to any APC with polls first, use the "Task Target
(APC)" value "DONT_CARE" (Fig. 11).

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
16
.NET Example
SOAPd Server Control > Monitoring a list of APC devices

Fig. 11: SOAPd Server Control - "Tasks" tab screen

2.2.5 Monitoring a list of APC devices


To view the list of APCs communicating to the server switch to the
"Counter List" tab.
The list displaying a summary of all APCs with state including IP,
MAC, last notifications, error mesages, etc. The visibility of col-
umns can be set below. The list can be sorted by clicking the
column header.

Activating "Auto Refresh" use only the "Server Status


Refresh" cycle of the first "Control" tab - not an own
cycle time.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
17
.NET Example
SOAPd Server Control > Monitoring a list of APC devices

Fig. 12: SOAPd Server Control - "Counter List" tab screen with only one

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
18
Java Example
Build environment > Installation of the Apache Maven Build Tool

3 Java Example
3.1 Build environment

Descriptions given here have been tested under Win-


dows 7 64-Bit. Note that since the tool chain used is a
32-Bit tool chain it is important to choose the program
installation folders for 32-Bit programs when deploying
the tools (i. e. ‘C:\Program Files (x86)’ but not ‘C:\Pro-
gram Files’)

3.1.1 Installing the Java Development Kit


Start setting up the build environment by installing the Java SE
Development Kit 7u17 for the Windows x86 platform (32bit) from
the Oracle downloads site1. It is recommended to perform a com-
plete installation (see Fig. 13).

Fig. 13: Choose complete JDK installation.


Having installed the JDK one needs to add the folder containing
the Java binaries (typically located in C:\Program Files (x86)\Java
\jdk1.7.0_17\bin) to your systems PATH environment variable. The
JDK installer is not extending the PATH variable itself. It is
assumed here that the user knows how to do that. Define a system
environment variable JAVA_HOME to point to the Java installation
directory (e. g. C:\Program Files (x86)\Java\jdk1.7.0_17).
Open a command line and verify that you are able to start
‘java.exe’.

3.1.2 Installation of the Apache Maven Build Tool


Download Apache Maven 3.0.5 from the apache.org Website2.
The distribution for Windows comes as a ZIP archive. Unpack the
ZIP archive. Deployment is a copy-deployment (e. g. into C:\Pro-
gram Files (x86)\apache-maven-3.0.5). Follow the instructions
“Installing Maven” given in the ‘README.txt’. Especially set
M2_HOME to point to the Maven installation directory (e. g. C:\Pro-
gram Files (x86)\apache-maven-3.0.5) and extend the system
PATH variable to include the Maven binary directory (e. g. C:\Pro-
gram Files (x86)\apache-maven-3.0.5\bin).

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
19
Java Example
Build environment > Customizing the Maven Build Environment

Verify the installation by opening a command prompt and carrying


out the command:

C:\>mvn --version
Apache Maven 3.0.5
(r01de14724cdef164cd33c7c8c2fe155faf9602da;
2013-02-19 14:51:28+0100)
Maven home: C:\Program Files (x86)\apache-
maven-3.0.5
Java version: 1.7.0_17, vendor: Oracle
Corporation
Java home: C:\Program Files (x86)\Java
\jdk1.7.0_17\jre
Default locale: en_US, platform encoding:
Cp1252
OS name: "windows 7", version: "6.1", arch:
"x86", family: "windows"
D:\>

Maven should answer with proper version information. Finally, it is


recommended to create a settings file ‘settings.xml’ in the users
‘.m2’ directory. Create the ‘.m2’ directory at the command line:

C:\Users\myself>mkdir .m2
C:\Users\myself>cd .m2

3.1.3 Customizing the Maven Build Environment


To customize the maven build environment create a settings.xml
file within the ‘.m2’ directory. It is recommended to define a local
repository not specific to a particular user. This enables several
users to share a particular local repository that gains several hun-
dreds of megabytes very quickly. A good starting point to get a
working copy is %M2_PATH%\config\settings.xml. Here is an
example of a settings file that only modifies the local repository
path:

<?xml version="1.0" encoding="UTF-8"?>


<settings
xmlns="http://maven.apache.org/SETTINGS/
1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://maven.apache.org/
SETTINGS/1.0.0
http://
maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:/Maven2Repository</
localRepository>
</settings>

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
20
Java Example
Build environment > Appendix - Additonal JVM Options

For a complete list of settings see the official Maven documenta-


tion. At this point one is ready to perform builds of the provided
code (see Ä Chapter 3.2 ‘Building the sources’ on page 26).
However, for more productive source code editing and refactoring
capabilities an integrated development environment like eclipse
may be used.

3.1.4 Setting up Maven to Work with a HTTP Proxy


It is common in protected environments that connecting to the out-
side world is established via a HTTP proxy server. To configure
Maven to use the proxy add the <proxy></proxy> setting as given
in the following example to the settings.xml configuration file:

<?xml version="1.0" encoding="UTF-8"?>


<settings
xsi:schemaLocation="http://maven.apache.org/
SETTINGS/1.0.0
http://
maven.apache.org/xsd/settings-1.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xmlns="http://maven.apache.org/SETTINGS/
1.0.0">
<localRepository>D:/Maven2Repository</
localRepository>
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>particular-user-name</username>
<password>password</password>
<host>proxy-host-name</host>
<port>port-id</port>
<nonProxyHosts>local.net|some.host.com</
nonProxyHosts>
</proxy>
</proxies>
</settings>

3.1.5 Appendix - Additonal JVM Options


In addition to the –jar option with witch the demonstrator archives
may be started as indicated for instance in section Ä Chapter 3.2.7
‘Deploying the DataLoggerDemo application’ on page 33 the fol-
lowing JVM system properties have proven to be helpful. These
properties have to be specified before the –jar switch to take effect.

3.1.5.1 Disable IPv6

-Djava.net.preferIPv4Stack=true

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
21
Java Example
Build environment > Appendix - Installing Eclipse Java Enterprise Edition Juno

This property disables IPv6 stack processing. If it is not set shutting


down the web-server may encounter problems due to improper
resolving IP '0.0.0.0'.

3.1.5.2 Reveal HTTP transport layer

-
Dcom.sun.xml.internal.ws.transport.http.HttpAda
pter.dump=true

This property will reveal HTTP SOAP traffic for investigation of any
problems related to the SOAP transport layer.

3.1.6 Appendix - Installing Eclipse Java Enterprise Edition Juno


Download Eclipse JavaEE Juno SR2 from Oracles download site.
As platform choose Windows 32-bit (file: eclipse-jee-juno-SR2-
win32.zip). The installation again is a copy deployment. So unpack
the ZIP-file. Inside the ZIP archive there is an ‘eclipse’ folder. Move
the ‘eclipse’ folder into a directory of your choice renaming it
‘eclipse-jee-juno-SR2’ (e. g. C:\Program Files (x86)\eclipse-jee-
juno-SR2). NOTE: The renaming is recommended so different
eclipse installations may live next to each other.
Start Eclipse executing ‘eclipse.exe’ inside the ‘eclipse-jee-juno-
SR2’ directory. Use the suggested workspace inside the user
directory for now.

3.1.6.1 Installing Eclipse Maven Plugins


Choose ‘Help’, ‘Install New Software …’. This will bring you to the
Sofware installation wizard:

Fig. 14: Installing Eclipse Maven Plugins


Click ‘Add…’ and enter ‘Maven2 Plugins’ as name as well as
‘http://download.eclipse.org/technology/m2e/releases’ as location.
Click OK.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
22
Java Example
Build environment > Appendix - Installing Eclipse Java Enterprise Edition Juno

Fig. 15: Installing Eclipse Maven Plugins


Select the two presented plugin options then click ‘Next>’. When
presented accept the license agreement and finally finish the
installation by restarting Eclipse.

3.1.6.2 Installing Eclipse Build-Helper Plugin


Repeat the steps of the previous section however as name enter:

M2E Buildhelper Connector

and as location enter:

http://repo1.maven.org/maven2/.m2e/connectors/
m2eclipse-buildhelper/0.15.0/N/
0.15.0.201207090124/

3.1.6.3 Working with the provided projects in Eclipse


Once all the Eclipse Plugins required are installed one can start
working with the projects. Start eclipse and open a Workspace by
selecting the directory into which all the APC.BIKE projects have
been copied into. For instance if the directory structure is like the
following:

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
23
Java Example
Build environment > Appendix - Installing Eclipse Java Enterprise Edition Juno

D:\Projects\Aglaia\APC.BIKE>dir
Volume in drive D is datavol Volume

Directory of D:\Projects\Aglaia\APC.BIKE
13.06.2013 09:50 <DIR> .
13.06.2013 09:50 <DIR> ..
13.06.2013 10:03 <DIR> .metadata
08.03.2013 17:34 146 .MySCMServerInfo
13.06.2013 13:37 <DIR> APC.BIKE.Core
06.06.2013 11:24 <DIR> APC.BIKE.DataLogger
04.06.2013 17:12 <DIR> APC.BIKE.DataLoggerDemo
21.05.2013 14:11 <DIR> APC.BIKE.MultiAppDemo
03.06.2013 18:49 <DIR> APC.BIKE.Proxy
04.06.2013 17:19 <DIR> APC.BIKE.ProxyDemo
18.04.2013 13:15 <DIR> Experiments
10.06.2013 10:59 <DIR> Model
18.04.2013 14:00 <DIR> RemoteSystemsTempFiles

1 File(s) 146 bytes


12 Dir(s) 126.723.608.576 bytes free

D:\Projects\Aglaia\APC.BIKE>

Choose ‘D:\Projects\Aglaia\APC.BIKE’ as the workspace.

Fig. 16: Eclipse select workspace


Eclipse will create the ‘.metadata’ and ‘RemoteSystemsTempFiles’
directories in each new workspace. Eclipse opens with the wel-
come page.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
24
Java Example
Build environment > Appendix - Installing Eclipse Java Enterprise Edition Juno

Fig. 17: Eclipse welcome


Import an existing Maven project by choosing File, Import, Maven,
Existing Maven Projects.

Fig. 18: Import maven projects


Choose ‘Next>’ and select the project folder of the project to be
opened (e. g. D:\Projects\Aglaia\APC.BIKE\APC.BIKE.Core).
Every project folder contains a ‘POM.xml’ file which is being
scanned for at this point.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
25
Java Example
Building the sources

Fig. 19: Import maven projects


Make sure the ‘.project’ file inside the project folder is writable (The
files '.classpath' and '.project' can be re-created any time using the
eclipse:eclipse maven build goal - mvn eclipse:eclipse). Choose
Finish to complete the import operation.

Fig. 20: Eclipse start working


One can now start working with the project (e. g. APC.BIKE.Core)
using the capabilities of the Eclipse IDE.

3.2 Building the sources


To get all source code simply copy the delivered APC.BIKE ZIP-
archive to the desired destination (e. g. ‘C:\’) and unpack it. Avoid
paths containing spaces. Two main folders will be created at the
root node:
n Projects - contains the projects with the source code and
n Build - contains base products for projects.
Before starting any build set the system environment variable
BUILD_DIR to point to the Build directory created in the step above
(e. g. ‘C:\Build’).

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
26
Java Example
Building the sources > Building APC.BIKE.Core

3.2.1 Building APC.BIKE.Core


Open a command prompt. Change to directory ‘…/Projects/Aglaia/
APC.BIKE.Core’. Enter the following command

C:\Projects\Aglaia\APC.BIKE\APC.BIKE.Core> mvn
package

This will start the Maven build-process. Upon first invocation


Maven will detect dependencies and download required packages.
At different build phases Maven will:
n Generate JAVA-code from the given WSDL service description
(\src\wsdl\ BaSS_SOAPd.wsdl and \src\XML-Schema\
BaSS_SOAPd.xsd)
n Compile Code and Tests
n Execute Tests
n Create Javadoc HTML-Helpfiles.
The output will be packed into:
n \target\APC.BIKE.Core-0.2.0.jar (Core Library)
n \target\APC.BIKE.Core-0.2.0-javadoc.jar (Core Library HTML-
Help).
NOTE: The unzipped content is found in \target\apidocs\...
Start browsing by opening ‘index.html’

3.2.1.1 Setting version information


Several places have to be set to obtain the correct version of the
deliverables. The deliverables are listed in …\APC.BIKE.Core
\APC.BIKE.Core Release History.txt in the deliveries section. The
version of the whole product APC.BIKE.Core is found in the pub-
lish script 'APC.BIKE.Core.Publish.js' (e. g. 2.10.00).

3.2.1.1.1 Setting version information for the JAR


To obtain the desired version of the Java archive file produced by
the 'package' goal edit the 'pom.xml' file in the build package root
directory. Modify the <version></version> element to contain
the desired value. Then build the product.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
27
Java Example
Building the sources > Building APC.BIKE.Core

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://
maven.apache.org/POM/4.0.0
http://maven.apache.org/
maven-v4_0_0.xsd">
...
<artifactId>APC.BIKE.Core</artifactId>
<packaging>jar</packaging>
<name>APC.BIKE.Core</name>
<version>2.10.0</version>
</project>

3.2.1.1.2 Setting version information for the HTML help files


The version information of the product displayed in the HTML help
files is found the POM-file section responsible for the execution of
the Javadoc tool execution.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
28
Java Example
Building the sources > Building APC.BIKE.Proxy

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://
maven.apache.org/POM/4.0.0
http://maven.apache.org/
maven-v4_0_0.xsd">
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</
groupId>
<artifactId>maven-javadoc-plugin</
artifactId>
<version>2.9</version>
<executions>
<execution>
. . .
<configuration>
. . .
<!-- TODO adapt header as
required -->
<header>
<![CDATA[<b>APC BIKE Core </
b><br>v2.10.0]]>
</header>
<!-- TODO adapt copyright notice
as required -->
<bottom>
<![CDATA[Copyright 2013,
<a href="http://www.hella.de/
peoplecounter">
Hella Aglaia Mobile Vision
GmbH.
<a>]]>
</bottom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Edit the plain HTML section (CDATA) of the <header></


header> element to provide the desired text inside the header of
every help page of the HTML help. Choose the version string as
appropriate. The footer can be adapted by editing the data con-
tained within the <bottom></bottom> element to include the
desired copyright notice.

3.2.2 Building APC.BIKE.Proxy


Open a command prompt. Change to directory ‘…/Projects/Aglaia/
APC.BIKE.Proxy’. Enter the following command:

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
29
Java Example
Building the sources > Building APC.BIKE.Proxy

C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.Proxy>CScript
APC.BIKE.Proxy.InstallBaseProducts.js

This will install the Java APC.BIKE.Core archive into the local
Maven repository. Having installed the necessary base products,
one is ready to perform the build of the Proxy application by exe-
cuting the Maven package goal:

C:\Projects\Aglaia\APC.BIKE\APC.BIKE.Proxy>mvn
package

The resulting JAR is found in the projects \target directory. The


build step is complete.

3.2.2.1 Setting version information


Like the APC.BIKE.Core product the Proxy has a POM file in the
product root folder. Edit the projects <version></version> element
to set the Proxy product version. Since the Proxy project has the
APC.BIKE.Core product as its base product the dependency is
modeled in Maven inside the dependency section as shown in the
following example:

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://
maven.apache.org/POM/4.0.0
http://maven.apache.org/
maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hella.bike</groupId>
<artifactId>APC.BIKE.Proxy</artifactId>
<packaging>jar</packaging>
<version>2.10.0</version>
<name>APC.BIKE.Proxy</name>
. . .
<dependencies>
. . .
<dependency>
<groupId>com.hella.bike.api</groupId>
<artifactId>APC.BIKE.Core</artifactId>
<version>2.10.0</version>
</dependency>
</dependencies>
. . .
</project>

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
30
Java Example
Building the sources > Building APC.BIKE.ProxyDemo

In addition to the version string maintained within the POM file


when creating a new version also the publish script
('APC.BIKE.Proxy.Publish.js') needs to be maintained when using
the FileDistributor tool for product version management (not essen-
tial necessary! You can copy and exchange the target files by your-
self to the build directories). Alternatively Maven could be used for
product version management given a repository server has been
set up.
The release history file ('APC.BIKE.Proxy Release History.txt') con-
tains relevant version information for every released product ver-
sion.

3.2.3 Building APC.BIKE.DataLogger


Follow the steps described in section Ä Chapter 3.2.2 ‘Building
APC.BIKE.Proxy’ on page 29 except that the base directory is ‘…/
Projects/Aglaia/APC.BIKE.DataLogger’ and scripts do not contain
Proxy but DataLogger in their names, respectively.

3.2.3.1 Setting version information


Like the APC.BIKE.Proxy product the data logger product has its
own product version that is maintained in the POM file, in the pub-
lish script ('APC.BIKE.DataLogger.Publish.js') and in the release
history file ('APC.BIKE.DataLogger Release History.txt') where ver-
sion information is kept.

3.2.4 Building APC.BIKE.ProxyDemo


Open a command prompt. Change to directory ‘…/Projects/Aglaia/
APC.BIKE.ProxyDemo’. Enter the following command:

C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo>CScript
APC.BIKE.ProxyDemo.InstallBaseProducts.js

This will install the Java APC.BIKE.Core and APC.BIKE.Proxy


archive into the local Maven repository. Further, both JARs are
copied to the target directory along with the WSDL description
used by the JAX-WS service.
Having installed the necessary base products, one is ready to per-
form the build of the Proxy demonstration application:

C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo>mvn package

The resulting JAR is found in the projects \target directory. The


build step is complete.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
31
Java Example
Building the sources > Building APC.BIKE.ProxyDemo

3.2.4.1 Starting ProxyDemo


After a successful build-step of the demonstration is started by the
following command:

C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo> java.exe -jar target/
APC.BIKE.ProxyDemo-2.10.0.jar

After successful start the output at the command window should


look similar to this:

C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo>java.exe -jar
target/APC.BIKE.ProxyDemo-2.10.0.jar
Using classpath: target/
APC.BIKE.ProxyDemo-2.10.0.jar
Proxy Demo starting ...
Jun 03, 2013 8:11:11 PM
com.hella.bike.api.implementation.DeviceManager
Impl tryRestoreFromConfigFile
INFO: Restoring device manager from 'bass-
configuration.xml' failed: 'bass-
configuration.xml (System can not find file)'
Listening at port: 80 ...
Jun 03, 2013 8:11:11 PM
com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDL
Parser
parseWSDL
WARNING: Import of jar:file:/C:/Projects/
Aglaia/APC.BIKE/APC.BIKE.ProxyDemo/target/
APC.BIKE.ProxyDemo-2.10.0.jar!/XML-Schema/
BaSS_SOAPd.xsd is violation of BP 1.1 R2001.
Proceeding with a warning.
R2001 A DESCRIPTION MUST only use the WSDL
"import" statement to import another WSDL
description.

The Web-Service is now successfully started. Automatic people


counter devices may be configured to connect to the service using
the servers IP and (in this case) port 80. The port can be changed
by using the –p <port-id> switch as additional command line
parameter. Use the –h switch to get help on available options.

3.2.4.2 Setting version information


Like the APC.BIKE.Proxy product the proxy demonstrator product
has its own product version that is maintained in the POM file, in
the publish script ('APC.BIKE.ProxyDemo.Publish.js') and in the
release history file ('APC.BIKE.ProxyDemo Release History.txt')
where version information is kept.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
32
Java Example
Building the sources > Deploying the DataLoggerDemo application

3.2.5 Building APC.BIKE.DataLoggerDemo


Follow the steps described in section Ä Chapter 3.2.4 ‘Building
APC.BIKE.ProxyDemo’ on page 31 except that the base directory
is ‘…/Projects/Aglaia/APC.BIKE.DataLoggerDemo’ and scripts do
not contain Proxy but DataLogger in their names, respectively.
After successful build the executable may be started by following
the instructions given in section Ä Chapter 3.2.4.1 ‘Starting Proxy-
Demo’ on page 32 (replace Proxy with DataLogger).

3.2.5.1 Setting version information


Like the APC.BIKE.Proxy product the data logger demonstrator
product has its own product version that is maintained in the POM
file, in the publish script ('APC.BIKE.DataLoggerDemo.Publish.js')
and in the release history file ('APC.BIKE.DataLoggerDemo
Release History.txt') where version information is kept.

3.2.6 Deploying the ProxyDemo application


Deployment of the application is a simple copy deployment. Being
inside the target directory (e. g. C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo\target) copy the three JAR files (version
numbers may change as new versions emerge):
n APC.BIKE.Core-2.10.0.jar
n APC.BIKE.Proxy-2.10.0.jar
n APC.BIKE.ProxyDemo-2.10.0.jar
as well as the ‘classes’ directory (which is at the same level as the
JARs) with all its sub-directories to the install-directory. Open a
command window and CD into the install-directory. Carry out the
JAVA command:

C:\DemoInstallDir> java.exe -jar


APC.BIKE.ProxyDemo-2.10.0.jar

3.2.7 Deploying the DataLoggerDemo application


Deployment of the application is a simple copy deployment. Being
inside the target directory (e. g. C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.DataLoggerDemo\target) copy the three JAR files (ver-
sion numbers may change as new versions emerge):
n APC.BIKE.Core-2.10.0.jar
n APC.BIKE.DataLogger-2.10.0.jar
n APC.BIKE.DataLoggerDemo-2.10.0.jar
as well as the ‘classes’ directory with all its sub-directories to the
install-directory. Open a command window and CD into the install-
directory. Carry out the JAVA command:

C:\DemoInstallDir> java.exe -jar


APC.BIKE.DataLoggerDemo-2.10.0.jar

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
33
1 Overview
Java Example
The application programming interface (API) of the backend integration kit including example
applications (short BIKE) is a convenience wrapper API around the automatic people counter
Architecture
(APC) SOAP-API specified in [1]. The BIKE > APC.BIKE
API is provided layered architecture
as a convenience wrapper API on
top of the APC SOAP API to hide the complexity of the SOAP API and ease the development
of APC applications leveraging the push service feature of the Hella-Aglaia APC devices.
3.3 Architecture
The current BIKE API Java implementation uses the JAX-WS [3, 4] web-service framework
The application
distributed with Java 7programming interface
to run a web-service (API)
required of APC
by the the SOAP
Backend Inte-
API for single point
gration
data Kit and
collection including Example applications (short BIKE) is a con-
processing.
venience wrapper API around the Automatic People Counter
The final application
(APC) SOAP-API deployment
specified requires
in [1]a (Java 7 installation along
Ä ‘References’ on with
page a copy deployment
5). The
of BIKE
the actual APC Java application as a JAR.
API is provided as a convenience wrapper API on top of the
APC SOAP API to hide the complexity of the SOAP API and ease
the development of APC applications leveraging the push service
2 APC.BIKE Layered
feature of Architecture
the Hella-Aglaia APC devices.
TheThe current
provided BIKE API
APC.BIKE Java implementation
distribution usessixthe
comprises the following JAX-WS organized
sub-products [11], in
three ( Ä ‘References’
[12]software on1):
layers (see Figure page 5) web-service framework distrib-
A utedCore API Java
with layer 7 to run a web-service required by the APC SOAP
A1 APIAPC.BIKE.Core The core
for single point datausescollection
a thin web-service (JAX-WS) for SOAP communication with
and processing.
the APC devices. The proprietary SOAP-interface is defined by a WSDL file provided by
TheHella-Aglaia (BaSS_SOAPd.wsdl,
final application deployment BaSS_SOAPd.xsd).
requires a JavaUsing7the wsimport tool provided
installation
with with
along the JDK the WSDL
a copy is translated
deployment intoactual
of the a set of
APCJavaJava
classes that are then used
application
asthroughout
a JAR. the API layer to form proper SOAP telegrams sent to the APC devices or to
understand the notification messages sent by the APC devices, respectively. The core
also contains the logic to manage applications, devices and their subscriptions in such a
way that the actual inversion of control imposed by the APC push service is hidden from
the core API user.
B BIKE application layer – contains two reference applications to demonstrate the use of
3.3.1 APC.BIKE layered architecturethe API and to serve as quick start examples when developing own applications.
B1 TheAPC.BIKE.Proxy – This application
provided APC.BIKE holds a proxy
distribution object for
comprises theevery physical six
following device on the
network. Each APC proxy object reflects the current state of the remote APC as it is
sub-products organized in three software layers (see
observable via subscribed messages. Detecting a state change of a proxy the
Ä further information on page 34):

Executable Demonstrator

Application Application Application


(Proxy) (Data Logger) #3

Core API
(JAX-WS using SOAP)

Figure 1 The three software layers of the APC BIKE distribution.


Fig. 21: The three software layers of the APC BIKE distribution.

© 2013 FORTecH Software GmbH

A Core API layer


A1 APC.BIKE.Core The core uses a thin web-service (JAX-WS) for SOAP communication with the
APC devices. The proprietary SOAP-interface is defined by a WSDL file provided by Hella-
Aglaia (BaSS_SOAPd.wsdl, BaSS_SOAPd.xsd). Using the wsimport tool provided with the JDK
the WSDL is translated into a set of Java classes that are then used throughout the API layer to
form proper SOAP telegrams sent to the APC devices or to understand the notification mes-
sages sent by the APC devices, respectively. The core also contains the logic to manage appli-
cations, devices and their subscriptions in such a way that the actual inversion of control
imposed by the APC push service is hidden from the core API user.
B BIKE application layer – contains two reference applications to demonstrate the use of the API
and to serve as quick start examples when developing own applications.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
34
Java Example
Architecture > Core API and Device Manager

B1 APC.BIKE.Proxy – This application holds a proxy object for every physical device on the net-
work. Each APC proxy object reflects the current state of the remote APC as it is observable via
subscribed messages. Detecting a state change of a proxy the application posts a notification to
an attached demonstrator.
B2 APC.BIKE.DataLogger – Similar to the proxy-application this application keeps track of each
APC on the network. Instead of notifying the demonstrator of each detected APC state change,
this application logs those state changes into a CSV-file that can be processed further for
instance with Microsoft Excel to evaluate interesting statistics.
C Executable demonstrator layer – This layer is delivered with three executable Java archives
(JAR). These archives are distributed with a manifest defining the executable class that is pro-
viding the main() method as well as the JARs this demonstration depends upon. Thus these
archives may be executed using the -jar switch of the Java virtual machine (JVM).
C1 APC.BIKE.ProxyDemo – Demonstration set on top of the proxy application.
C2 APC.BIKE.DataLoggerDemo – Demonstration on top of the data logger application.
C3 APC.BIKE.MultiAppDemo – Demonstration showing the simultaneous use of proxy and data
logger application at the same time. Using this paradigm several applications would be able to
use the core API simultaneously.

The following sections cover the particular layers in more detail.

3.3.2 Core API and Device Manager


One starts working with the core API by obtaining a reference to
the DeviceManager interface (Ä further information on page 35).
The device manager is a singleton. Therefore the access method
DeviceManagerImpl.getDeviceManager() is the factory
method that has to be invoked to obtain the object reference, see
Ä further information on page 36. The backend contracts ensure
testability of the Core API classes in terms of unit tests using
dependency injection. This is accomplished via the
BackendServiceFactory interface. The DeviceManagerImpl
class’s factory method is overloaded for this purpose. The method
receiving a factory is used during testing with a factory able to
supply mock objects for web service and time manager. The
backend web-service mock may supply artificially constructed
SOAP messages via the BackendServiceListener interface. To
construct such messages from WSDL derived classes are used by
the test classes. The JDK tool wsimport is used to obtain java
classes from a WSDL description. The backend time manager sup-
plies fixed time stamps to ensure deterministic test behavior.
The factory method with the void argument list is used to run the
production system. It uses the default factory providing the real
JAX-WS web-service and real system time.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
35
The backend web-service mock may supply artificially constructed SOAP messages via the
BackendServiceListener interface. To construct such messages from WSDL derived classes are
used by the test classes. The JDK tool wsimport is used to obtain java classes from a WSDL
Java Example
description. The backend time manager supplies fixed time stamps to ensure deterministic test
behavior.
Architecture > Application Management

BIKE API

A pplication D eviceMan ager Man agedD evice

BIKE API Implementation


-deviceManager
A pplication Impl D eviceMan agerImpl Man agedD eviceImpl
0..* {leaf} 0..*
-applications -managedDevices

Backend Contracts -timeManager -factory


-backendService

~listener
B acken dService B acken dServiceListen er TimeMan ager B acken dServiceFactory

Backend Implementation

B acken dServiceImpl TimeMan agerImpl D efau ltB acken dServiceFactoryImpl


+ createBackendService() :BackendService
+ createTimeManager() :TimeManager

Name: APC.BIKE.Core Top Level Classes


Leg end Author: FPP
Core API implementation classes Version: 1.01 RevA
Created: 16.04.2013 17:07:45
Core API backend implementation classes Updated: 08.07.2013 18:10:38

Figure
Fig. 22: UML 2: UML
class classCore
diagram; diagram; Core classes
API, main API, main classes.

© 2013 FORTecH Software GmbH

3.3.3 Application Management


Applications are accessed given their name. That is an implemen-
tation gains access to an application object providing the name of
the application.

Access to applications and man-


aged devices.
import com.hella.bike.api.*;
import
com.hella.bike.api.implementation.DeviceManager
Impl;

// ...
DeviceManager deviceManager =
DeviceManagerImpl.getDeviceManager();
Application proxyApplication =
deviceManager.getApplication("APC-Proxy");

if (null == proxyApplication) {
// No proxy application created yet
proxyApplication =
deviceManager.createApplication("APC-Proxy");
}

HashMap<String, ManagedDevice> managedDevices


= deviceManager.getDeviceMap();

for (ManagedDevice device : managedDevices) {


// Access particular managed device
System.out.println(String.format("Dev (MAC:
'%s') present", device.getMAC()));
}

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
36
Java Example
Architecture > Device Management

3.3.4 Device Management


Access to all currently managed devices is proviced by querying a
clone of the currently managed device clollection of the device
manager. The provided collection may be used present information
about currently managed devices in a suitable way.
To stay informed whether the collection of managed devices
changes or whether a particular managed device within the collec-
tion has changed an application registers two listeners with the
DeviceManager:
n A DeviceMapChangeListener being invoked on collection
changes and
n A DeviceChangedListener being invoked when a particular
device has changed.
With both of these listeners installed an application is able to track
changes to the collection of managed devices.

3.3.4.1 Management of Black and White Lists


The DeviceManager is responsible for accepting and rejecting
particular physical devices based on their MAC address. The
DeviceManager can operate in two different modes:
n Accept every device appearing on the network (default
behavior) or
n Reject every device appearing on the network.
In the first case the black list has to be used to exclude particular
devices from being available to applications. Using
acceptDevice("*") will set the DeviceManager into accept all
mode.
In the second case the white list is used to explicitly allow particular
devices to be used by applications. Using rejectDevice("*")
will set the DeviceManager into reject all mode.

3.3.4.2 Managed Devices and Application Devices


To understand the API it is important to understand the semantic
difference between managed devices and application devices. A
managed device represents a physical device on the network.
Physical devices announce themselves with notification messages.
In addition they may be announced via the DeviceManager inter-
face using acceptDevice() or rejectDevice(), respectively.
Invoking either method means that the devices announcement to
the server is expected soon. It also says how the server shall pro-
ceed with the announcement. A black listed device is a managed
device but will not be available to applications. A white listed
device is a managed device and an application device. It becomes
available to applications via the Application interfaces listener
mechanism.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
37
managed device. Application devices, as perceived by the API user, are associated with
subscriptions. Consequently the application device has a subscription manager interface
which is used to manage its associated subscriptions. A subscription is thought of as a multi-
time task. Subscriptions are covered in detail in Section 2.1.3. Device classes and their
relationships are depicted in Figure 3. Java Example
Architecture > Applications, Application Devices and Subscriptions

2.1.3 Applications, Application Devices and Subscriptions


This introduces the term application device. An application device
refers to a white listed managed device. Application devices, as
New applications can be created through
perceived the API
by the createApplication("app-Name")
user, are associated with subscriptions. Con-
method of the device manager given an application
sequently with device
the application the samehasname does notmanager
a subscription exist. inter-
Applications manage application devices.
face whichOne does to
is used notmanage
create its
application
associateddevices directly A sub-
subscriptions.
invoking any API methods. Rather, scription is thoughtaofdevice
one attaches as a multi-time task. Subscriptions
map change listener to theare
covered
application interface and gets informed as in detail in
devices arrive andÄgo
section Chapter
away, 3.3 ‘Architecture’
respectively. This is
illustrated in on page 34. Device classes and their relationships are depicted in
Ä further information on page 37.

Su bscription Man agedD evice A pplication D evice ObservableSu bscription Man ager

Man agedD eviceImpl A pplication D eviceImpl Su bscription Man agerImpl

-managedDevice 0..*
-subscriptionManager
Server Task IDs -applicationDevice -subscriptionManager
are assigned by
managed Subscriptions from all
devices. application devices of As many application devices Subscriptions
all applications. as there are applications are associated with the
associated with one particular application
-subscriptions 0..* managed device. device.

TaskImpl
Subsc riptio n Impl -subscriptions

0..*

-trigger

TriggerImpl

Name: Managed Devices, Application Devices and Subscriptions


Author: FPP
Version: 1.00 RevA
TimeTriggerImpl Even tTriggerImpl Created: 01.07.2013 17:19:58
Updated: 02.07.2013 14:46:34

Figure
Fig. 23: UML 3: UML
class classRelations
diagram; diagram;between
Relations betweendevices,
managed managed devices, devices
application application
and devices
subscriptions.
and subscriptions.

© 2013 FORTecH Software GmbH


3.3.5 Applications, Application Devices and Subscriptions
New applications can be created through the
createApplication("app-Name") method of the device man-
ager given an application with the same name does not exist.
Applications manage application devices. One does not create
application devices directly invoking any API methods. Rather, one
attaches a device map change listener to the application interface
and gets informed as devices arrive and go away, respectively.
This is illustrated in

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
38
APC BIKE 1.01 Architecture Rev. A – APC.BIKE Layered Architecture 11 Java Example
Architecture > Applications, Application Devices and Subscriptions

ProxyA pplication Impl

A n on ymou s Listen er

-applicationSubscriptionManager -application

BIKE API

Su bscription Su bscription Man ager D eviceMapC h an geListen er A pplication A pplication D evice


0..*

Su bscription Man agerImpl A pplication Impl

-subscriptionManager
-subscriptionManager
Application
Device Map

-subscriptions Subscription
0..* Templates 0..*
TaskImpl A pplication D eviceImpl
Sub sc rip tio n Imp l

Name: Application, Application Device and Subscriptions Le g e nd


Author: FPP
Version: 1.00 RevB Implemented by application layer
Created: 02.07.2013 14:02:08 Implemented by Core API layer
Updated: 08.07.2013 20:35:23

Figure
Fig. 24: UML class 4: UML
diagram; class diagram;
Relations Relations between
between applications, applications,
application application
devices and devices
application and
subscription
templates. application subscription templates.
As a convenience, templates for subscriptions can be defined for
As a convenience, templates an for subscriptions
application. This can be defined
is done via the for an application.
subscription managerThisattached
is done
via the subscription manager attached
to the to the As
application. application.
managed devices are announced to the
device manager the device manager checks whether the device
As managed devices are must announced
be made toavailable
the device manager theIf this
to applications. device manager
is the case thechecks
fol-
whether the device must be lowing
made steps are performed
available for all applications:
to applications. If this is the case the following
steps are performed for allnapplications:
A new application device is created and associated with the
A A new application device is created
announced and associated
managed device that with the the
trigger announced
scenario,managed
device that trigger thenscenario,
Each application subscription template is cloned,
B Each application subscription template
n The cloned is cloned,
template is added as a pending subscription to the
C The cloned template is added as a pending
application device and subscription
in turn totothetherelated
application device
managed and in
device.
turn to the related managed device.
n As subscriptions are added to the related managed device they
D As subscriptions are added to the
obtain related
their servermanaged device they obtain their server task
task ID (see
ID (see Figure 3). Ä further information on page 37).
In addition
In addition to the subscription templatesto the subscription
cloned templates
on application cloned
device on application
creation the observable
device creation the observable subscription manager associated
subscription manager associated with every application device must be used to access the
with every application device must be used to access the clones
clones and to define furtherandsubscriptions specific
to define further to a particular
subscriptions application
specific device.
to a particular Via the
applica-
observable subscription manager interface a listener may be attached enabling the
tion device. Via the observable subscription manager interface a tracking
of subscription state changes.
listener may be attached enabling the tracking of subscription state
changes.

2.1.3.1 Subscription Life-Cycle

Due to the inversion of control capsulated by the API and the limited amount of subscriptions
that can be kept by a physical device, subscriptions undergo a life cycle. The related state
machine is depicted in Figure 5. All transitions are observable through the listener interface
given that the listener object is attached immediately when the new application device is
announced.

© 2013 FORTecH Software GmbH

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
39
the user may take action such that the number of remaining subscriptions on the device is
small enough and then try to re-subscribe which effectively sets the subscription state into
pending again. The core API will again put a subscription request into the answer to the next
message obtained from the device. Java Example
If the user unsubscribes, the subscription is set into Architecture
delete pending state.
> Managed Fromand
Devices thisSubscriptions
state there
is no turning back. The API will send a kill request for the subscription on next device contact
3.3.5.1 and removes
Subscription it from internally kept lists. This finalizes the subscription life cycle.
Life-Cycle
Due to the inversion of control capsulated by the API and the
limited amount of subscriptions that can be kept by a physical
2.1.4 Managed Devices and Subscriptions
device, subscriptions undergo a life cycle. The related state
machine is depicted in Ä further information on page 40. All transi-
Managed devices keep theirtionsownare list
observable through
of associated the listener interface
subscriptions. given
This list is not that the
accessible
through any interfaces at listener
the API.object
That is is there
attached immediately
is no subscription when the new
manager application
available at the
ManagedDevice interface device
(see is announced.
Figure 3). The list of subscriptions at the managed device
however is a direct reference
Afterofcreation
all the tasks that are supposed
a subscription is pending. toThe
be present at thewith
next contact physical
the
device on the network. The serverdevice,
physical task IDs must
either be uniqueorfor
a notification an aerror
particular
message device only.
will col-
lect pending
Hence, the API assigns server task IDssubscriptions
per managed anddevice.
send them to theasdevice.
As soon The sub-is
a subscription
associated with a managed scription
deviceisitactive
obtainsthen since no response
a dedicated server task canIDbefrom
expected from
the managed
the subscription
device. This also means that device. If thetemplates
device sends
kept an error
with to indicatehave
applications a problem with a
no assigned
subscription
server task ID. They have an invalid ID thewithsubscription
value -1. state changes to failed. In case the
reason for rejection are too many subscriptions on the device the
user may take action such that the number of remaining subscrip-
tions on the device is small enough and then try to re-subscribe
2.2 Application Layer which effectively sets the subscription state into pending again.
The core API will again put a subscription request into the answer
to the
The application layer of the next
BIKE APImessage
consists obtained from theapplications,
of two example device. the APC proxy
application and the data logger application.
If the user unsubscribes, the subscription is set into delete pending
state. From this state there is no turning back. The API will send a
kill request for the subscription on next device contact and
removes it from internally kept lists. This finalizes the subscription
life cycle.

Pen din g A ctive


Subscribe Subscription Sent

Initial Device Error


Message
Unsubscribe
Unsubscribe
Re-subscribe

Failed D elete Pen din g


Unsubscribe

Unsubscribe Sent

Name: Subscription States


D eleted Author: FPP
Remove Version: 1.00 RevA
Created: 02.07.2013 17:10:31
Updated: 02.07.2013 17:34:03
Final

Fig. 25: UML stateFigure 5: UML


diagram; state diagram;
Subscription Subscription life cycle.
life cycle.

© 2013 FORTecH Software GmbH

3.3.6 Managed Devices and Subscriptions


Managed devices keep their own list of associated subscriptions.
This list is not accessible through any interfaces at the API. That is
there is no subscription manager available at the ManagedDevice
interface (see Ä further information on page 37). The list of sub-
scriptions at the managed device however is a direct reference of
all the tasks that are supposed to be present at the physical device
on the network. The server task IDs must be unique for a particular
device only. Hence, the API assigns server task IDs per managed

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
40
Java Example
Architecture > Application Layer

device. As soon as a subscription is associated with a managed


device it obtains a dedicated server task ID from the managed
device. This also means that subscription templates kept with
applications have no assigned server task ID. They have an invalid
ID with value -1.

3.3.7 Application Layer


The application layer of the BIKE API consists of two example
applications, the APC-Proxy and the data logger application.

3.3.7.1 Proxy Application


At startup the applications checks for the presence of the "APC-
Proxy" application, creates it if required, and attaches the device
map changed listener to be informed of arriving and disappearing
devices. Further all listeners for the possible application events:
n alive event listener,
n count event listener,
n fill level event listener,
n digital input event listener,
n clear zone event listener,
n current item list event listener and
n historic item list event listener
are attached to receive events associated with particular subscrip-
tions. To achieve this anonymous classes are used. If the applica-
tion was not present at startup it is assumed that the configuration
for the device manager was not present. The application then sub-
scribes a fixed set of four subscriptions related to the event types
listed above. This is done in such a way as to get as much events
as possible for demonstration purposes. The user can choose
between three subscription sets using passing the subscription set
ID to the applications constructor. The device manager is left in its
initial state of accepting every device on the network.
The application has at its heart the class ProxyAPCImpl respon-
sible for collection APC information such as count data (see
Ä further information on page 41). Events from the Core API are
forwarded to the respective APC proxy object based on the MAC
address. The proxy checks if a change in the cached data (e. g.
the counts or OSD state) have occurred and generate respective
calls to the ProxyApplicationListener interface in case a
proxy application listener is attached.
Refer to Section 3.1 on how to present the data transported over
the listener interface.
The related project in the APC BIKE distribution is
APC.BIKE.Proxy.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
41
The application has at its heart the class ProxyAPCImpl responsible for collection APC
information such as count data (see Figure 6). Events from the Core API are forwarded to the
respective APC proxy object based on the MAC address. The proxy checks if a change in the
cached data (e. g. the counts or OSD state) have occurred and generate respective calls to
the ProxyApplicationListener interface in case a proxy application listener is Java Example
attached.
Architecture > Available Demonstrations
Refer to Section 3.1 on how to present the data transported over the listener interface.

A pp

-logic
Proxy API

ProxyA pplication Listen er ProxyA pplication ProxyA PC

~applicationListener

ProxyA pplication Impl proxyDevices ProxyA PC Impl


0..*

-digitalInputListener
-deviceMapChangeListener -countingListener
-aliveListener -fillListener -currentItemListener -clearZoneListener
-historicItemListener

A n on ymou s A n on ymou s A n on ymou s A n on ymou s A n on ymou s A n on ymou s A n on ymou s A n on ymou s


Listen er Listen er Listen er Listen er Listen er Listen er Listen er Listen er

-application -applicationDevice
BIKE API

D eviceMapC h an geListen er C ou n tin gListen er FillListen er C u rren tItemListen er H istoricItemListen er


A liveListen er 0..* D igitalIn pu tListen er C learZ on eListen er
A pplication 0..* 0..* A pplication D evice
0..* 0..* 0..* 0..* 0..*

Le g e nd
Demonstrator class
Proxy application interfaces and classes A pplication Impl A pplication D eviceImpl
Application Device Map
Core API interfaces and classes
0..*

Name: Proxy Demonstrator


Author: FPP
Version: 1.01 RevA
Created: 02.07.2013 19:23:22
Updated: 08.07.2013 20:32:11

Figure
Fig. 26: UML 6: UML
class class Proxy
diagram; diagram; Proxy demonstrator
demonstrator selected classes.
selected classes.

© 2013 FORTecH Software GmbH

3.3.7.2 Data Logger Application


This application performs similar steps to those described in the
first paragraph of the previous section. Except that it checks for the
presence of the application with the name "APC-DataLogger".
The application has at its heart the class DataLoggerAPCImpl
responsible for collection APC information similar to the functions
that ProxyAPCImpl is performing in the proxy example. However,
instead of notifying a listener of the demonstration layer this appli-
cation writes a formatted line of text into a CSV file for further stat-
istical analysis e. g. by Microsoft Excel.
The related project in the APC BIKE distribution is APC.BIKE.Data-
Logger.

3.3.8 Available Demonstrations


The layer of executable demonstrators is on top of the two deliv-
ered applications. The main responsibilities of each demonstrator
are:
n Evaluate command line parameters as for instance the TCP
port for the web service
n Setup a suitable logger and to attach the desired logging han-
dlers and select the desired logging level.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
42
Java Example
Architecture > Available Demonstrations

n Save the device manager configuration if no configuration was


present.
n To start the web service.

3.3.8.1 Proxy Demonstration


The class App implements the ProxyApplicationListener
interface and attaches itself as listener to the one and only
ProxyApplicationImpl object it creates. Therefore it is notified
via the listener interface of the following events:
n ARRIVED – A new device has been announced,
n CONTACTED – A devices time (server time) of last contact
has changed,
n COUNT – The device related count data (in / out) has
changed,
n DIGITAL_INPUT – The state of the devices digital input(s)
changed,
n FILL_LEVEL – The fill level in terms of number of counted
items in the AOI has changed,
n GONE – A device has gone,
n OSD – The devices OSD state has changed.
The according device is asked to renter itself into a string. The noti-
fication code along with the string is then logged to the active
logger. In case of the proxy demonstration the logger output is
send to a console handler and the output is seen on console
screen.
For a list of available command line parameters please refer to the
proxy project. The related project in the APC BIKE distribution is
APC.BIKE.ProxyDemo.

3.3.8.2 Data Logger Demonstration


The class App has no need to implement any listener interface in
this case. It just creates one instance of the
DataLoggerApplicationImpl class, creates the log-file and
starts the web-service at the requested port.
For a list of available command line parameters please refer to the
data logger project. The related project in the APC BIKE distribu-
tion is APC.BIKE.DataLoggerDemo.

3.3.8.3 Multi-Application Demonstration


This demonstrator shows how two (or more) applications could be
run in parallel using the BIKE API. The class MultiAppDemo
implements the ProxyApplicationListener interface just like
the App class in the proxy demonstrator it instanciates both, one
ProxyApplicationImpl object and one
DataLoggerApplicationImpl object. It sets up a log-file and
starts the web-service. The events provided by the proxy applica-
tion are logged to the console window. At the same time the data
logger application writes its events into the configured log-file.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
43
Java Example
Appendix - Classes and Log Messages

For a list of available command line parameters please refer to the


data multi-application project. The related project in the APC BIKE
distribution is APC.BIKE.MultiAppDemo.

3.4 Appendix - Classes and Log Messages


This appendix contains a description of capsulated data structures
defined by the SOAP interface WSDL description. The classes
shown are generated automatically during the APC.BIKE.Core
build process using the wsimport tool provided with the JAX-WS
library. These backend classes are used by the Core API layer to
access the SOAP messages received and sent by the web-service,
respectively.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
44
4.1

22.04.2015
«enumeration» No tif ic atio n B ase
TaskType
# callerTypeID :String LogfilesNotification
TASK_STARTUP #taskType # customerID :String
TASK_UPDATE # macAddress :String # logData :BinaryData
TASK_COUNT # notificationID :long
TASK_FILL_LEVEL # serverTaskID :long
TASK_DIGIT_INPUT # taskType :TaskType
TASK_DIGIT_OUTPUT # timestamp :XMLGregorianCalendar
TASK_CAM_IMAGE
TASK_PARAM

© 2013 FORTecH Software GmbH


TASK_SEND_PARAM D igitalIn pu tNotification
TASK_LOG # digitalInputPort :List<DigitalInputElement>
TASK_ERR_LOG
TASK_VIDEO_STORE «enumeration»
TASK_SET_DATE_TIME OSD State
TASK_CURRENT_OBJECT_LIST
TASK_HISTORIC_OBJECT_LIST OSD_STATE_OK
3.4.1 APC Notification Messages

TASK_ALIVE OSD_STATE_ERROR_SENSOR_FAIL #osdState No tif ic atio n W ith OSDState


TASK_REBOOT_NOW OSD_STATE_WARNING_DARK
# osdState :OSDState
TASK_CLEAR_ZONE OSD_STATE_ERROR_DARK
OSD_STATE_WARNING_BRIGHT
OSD_STATE_ERROR_BRIGHT
OSD_STATE_NOT_AVAIL
sent by the web-service, respectively.

OSD_STATE_INVALID H istoricObjectListNotification B ase


APC Notification Messages

C ameraImagesNotification # binaryData :BinaryData


# cameraImages :BinaryData # obj :List<HistoricObject>
# evalMap :BinaryData

Exten dedNo tif ic atio n B ase

Fig. 27: Backend notification classes related to BIKE API events.


# customerVersion :String H istoricObjectListNotification
# firmwareVersion :String # lostCount :long
# ipAddress :String FillNotification C u rren tObjectListNotification
# fillLevel :long # binaryData :BinaryData
# fillRegionId :FillRegionID # obj :List<CurrentObject>
Leg end
Adressed by BIKE-API, implemented
A liveNotification Startu pNotification C ou n tNotification C learZon eNotification Not adressed by BIKE-API

Figure 7: Backend notification classes related to BIKE API events.


# rebootType :RebootType # countIn :long # clearZoneId :ClearZoneID
# countingGateId :CountingGateID # isBlocked :boolean
# countOut :long
Name: APC Notification Messages (from WSDL)
Author: FPP
ErrorLogfilesNotification Version: 1.01 RevA
Created: 24.06.2013 13:31:48
# errorLogData :BinaryData Updated: 08.07.2013 17:22:46

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
Appendix - Classes and Log Messages > APC Notification Messages
Java Example
interface WSDL description. The classes shown are generated automatically during the

backend classes are used by the Core API layer to access the SOAP messages received and
APC.BIKE.Core build process using the wsimport tool provided with the JAX-WS library. These

45
18 APC BIKE 1.01 Architecture Rev. A – Appendix A
Java Example
Appendix - Classes and Log Messages > Supported Subscriptions

4.2 Supported Subscriptions


3.4.2 Supported Subscriptions

«enumeration» Task
TaskType
# serverTaskID :long TaskRebootNow
TASK_STARTUP # taskType :TaskType
TASK_UPDATE
TASK_COUNT TaskSetD ateTime
TASK_FILL_LEVEL
TASK_DIGIT_INPUT #taskType # timeToSet :XMLGregorianCalendar
TASK_DIGIT_OUTPUT
TASK_CAM_IMAGE
TASK_PARAM TaskRequ estU pdate
TASK_SEND_PARAM
# packetUrl :String
TASK_LOG
# updateType :UpdateType
TASK_ERR_LOG
TASK_VIDEO_STORE
TASK_SET_DATE_TIME TaskRequ estParameters
TASK_CURRENT_OBJECT_LIST
TASK_HISTORIC_OBJECT_LIST # packetUrl :String
TASK_ALIVE
TASK_REBOOT_NOW
TASK_CLEAR_ZONE
Task W ith A c tivity
TaskSetD igitalOu tpu t
# activityState :boolean
# digitalOutputPort :List<DigitalOutputElement>

Trigger #trigger Task Subsc ribeTriggered


TaskSu bscribeC ameraImages
# eventTrigger :EventTrigger # trigger :Trigger
# timeTrigger :TimeTrigger
TaskSu bscribeSen dParameters

TaskSu bscribeLogfiles

TaskSu bscribeErrorLog

TaskSu bscribeVideoStore

TaskSu bscribeA live Task Subsc ribeTriggeredSaf e TaskSu bscribeObjectList


# storeOnTransmissionError :Boolean # transferType :TransferType

TaskSu bscribeFill TaskSu bscribeD igitalIn pu t TaskSu bscribeC learZon e


# fillRegionId :FillRegionID # digitalInputPort :List<DigitalInputControl> # clearZoneId :ClearZoneID

Name: Server Tasks (from WSDL)


Leg end Author: FPP TaskSu bscribeC ou n tin g
Accessible via BIKE API Version: 1.01 RevA
# countingGateId :CountingGateID
Created: 24.06.2013 15:01:17
Not adressed by BIKE API Updated: 08.07.2013 17:31:03

Figure 8: Classes supporting the subscription of backend multi-time tasks.


Fig. 28: Classes supporting the subscription of backend multi-time tasks.

© 2013 FORTecH Software GmbH

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
46
4.3

22.04.2015
TaskWithActivity
#trigger Trigger
Task Subsc ribeTriggered
# eventTrigger :EventTrigger
# timeTrigger :TimeTrigger
3.4.3 Trigger Support

© 2013 FORTecH Software GmbH


#eventTrigger #timeTrigger
Trigger Support

Even tTrigger TimeTrigger

# clearZoneEvent :ClearZoneEvent # cycle :Duration


# countEvent :CountEvent # date :Date

Fig. 29: Backend trigger support classes.


# currentObjectListEvent :CurrentObjectListEvent # randomOffset :Duration
# digitalInputEvent :DigitalInputEvent # start :ClockTime
# fillEvent :FillEvent
# oneTimeEvent :OneTimeEvent
# osdEvent :OSDEvent #start
#osdEvent #oneTimeEvent #date

D ate C lockTime

Figure 9: Backend trigger support classes.


OSD Even t On eTimeEven t
# dayOfMonth :Long # hours :long
# dayOfWeek :DayOfWeek # minutes :long
# kind :DateType # seconds :long

#countEvent
#clearZoneEvent

C learZ on eEven t #digitalInputEvent C ou n tEven t


Le g e nd
# clearZoneEventType :ClearZoneEventType D igitalIn pu tEven t
# countEventType :CountEventType
Accessible via BIKE API
# delta :Long
# event :List<DigitalInputEventType> Not addressed by BIKE API

#currentObjectListEvent #fillEvent
Name: Trigger Classes (from WSDL)
C u rren tObjectListEven t FillEven t Author: FPP
Version: 1.01 RevA
# skip :Long # fillEventType :FillEventType

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
Created: 24.06.2013 16:19:33

disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
# threshold :Long
Updated: 08.07.2013 17:36:45
APC BIKE 1.01 Architecture Rev. A – Appendix A 19

Appendix - Classes and Log Messages > Trigger Support


Java Example

47
20 APC BIKE 1.01 Architecture Rev. A – Appendix A
Java Example
Appendix - Classes and Log Messages > Important Core API Log-Messages

4.4 Digital I/O Support


3.4.4 Digital I/O Support
TaskSubscribeTriggeredSafe NotificationBase TaskWithActivity
TaskSu bscribeD igitalIn pu t D igitalIn pu tNotification TaskSetD igitalOu tpu t

# digitalInputPort :List<DigitalInputControl> # digitalInputPort :List<DigitalInputElement> # digitalOutputPort :List<DigitalOutputElement>

#digitalInputPort 0..*

D igitalIn pu tC on trol #digitalInputPort 0..* #digitalOutputPort 0..*


# activityState :boolean D igitalIn pu tElemen t D igitalOu tpu tElemen t

# value :DigitalInputValue # activity :DigitalOutputActivity

#value #activity
Even tTrigger
«enumeration» «enumeration»
# clearZoneEvent :ClearZoneEvent D igitalIn pu tValu e D igitalOu tpu tA ctivity
# countEvent :CountEvent
DIGITAL_INPUT_ACTIVE DIGITAL_OUTPUT_LOW
# currentObjectListEvent :CurrentObjectListEvent
DIGITAL_INPUT_INACTIVE DIGITAL_OUTPUT_HIGH
# digitalInputEvent :DigitalInputEvent
DIGITAL_INPUT_NOT_AVAIL DIGITAL_OUTPUT_HOLD_LOW
# fillEvent :FillEvent
DIGITAL_OUTPUT_HOLD_HIGH
# oneTimeEvent :OneTimeEvent
DIGITAL_OUTPUT_UNTOUCHED
# osdEvent :OSDEvent

#digitalInputEvent

D igitalIn pu tEven t

# event :List<DigitalInputEventType>

#event 0..*

«enumeration»
D igitalIn pu tEven tType Name: Digital I/O Classes (from WSDL)
Le g e nd Author: FPP
DIGITAL_INPUT_EVENT_INACTIVE Accessible via BIKE-API Version: 1.01 RevA
DIGITAL_INPUT_EVENT_ACTIVE Created: 24.06.2013 15:47:07
DIGITAL_INPUT_EVENT_ANY Not addressed by BIKE API Updated: 08.07.2013 17:43:44
DIGITAL_INPUT_EVENT_IGNORE

Figure
Fig. 30: Classes 10: to
related Classes related
backend to backend
trigger support. trigger support.

3.4.5 Important Core API Log-Messages


This appendix lists log-messages issued by the core API layer. Log
messages are partitioned into three categories:
n INFO – Informative messages
n WARNING – Indication that in the course of execution the
system found an unexpected condition. It is attempted to con-
tinue but as a consequence normal operation may not be pos-
sible.
n SEVERE – Indicates a situation in which execution has to be
aborted.

Level Src. Message Description


Nr.
info 3 Device (MAC: %s) added. Active: %s Device added to white list. Active state is
dumped. If device is active it has been seen
on the network.
info 3 Configuration file '%s' - exists, trying Configuration file (named) exists. The system
to overwrite tries to overwrite this file.

© 2013 FORTecH Software GmbH

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
48
Java Example
Appendix - Classes and Log Messages > Important Core API Log-Messages

Level Src. Message Description


Nr.
info 3 Saving device manager to '%s' failed: The device manager cannot be saved.
'%s' Exception message is printed.
info 3 Error (MAC: %s): '%s' Device manager received a SOAP error mes-
sage. The error text is printed. The error
message is processed by the device man-
ager. Normal program behaviour.
info 3 Configuration file '%s' - not existent The configuration file is not existent.
info 3 Configuration file '%s' - cannot read The configuration file exists but the system
cannot read it.
info 3 Restoring device manager from '%s' The device manager cannot be restored.
failed: '%s' Exception printed.
info 3 Device startup (MAC: %s, reboot Network startup notification of device.
type: %s).
info 3 ManagedDevice (MAC: %s, Active: A new managed device was created and
%s) added. added to the managed device map.
info 4 Re-assinging task IDs It was detected that a message with an
invalid server task ID has arrived. The tasks
for a managed device get new Ids starting at
ArrivalID+50, where 50 is a heuristic number.
info 5 %s - Assigning ID: %d (prev: %d) An application subscription template gets
cloned and the assignment is printed.
info 5 Deleting task (ID: %d, type: %s) A task delete message for ID and particular
type is being created.
info 6 %s - Force active (ID: %d) The device manager is receiving a start-up
notification of managed device previously
active. The APC is forced to use the previ-
ously defined set of tasks of the related man-
aged device.
warning 1 Restored subscription must not con- The restored subscription has an invalid task-
tain invalid task-ID ID.
warning 2 Managed device (MAC: '%s') has not The device was not restored. MAC is printed.
been restored. Hint the related XML-Configuration may be ill
formed.
warning 2 Device (MAC: %s), killing task (ID: A delete task entry is prepared for the device.
%d type: %s) Server task ID and task type are displayed.
warning 3 MAC cannot be null or empty! Accept and reject device operation are
refused by the device manager for invalid
MAC addresses.
warning 3 Configuration file '%s' - no write The configuration file exists but the System
access has no write access.
warning 3 Application '%s' already exists. The given application (named) already exists.
warning 3 Unknown device (MAC: %s, Active: The device is not yet managed but starts with
%s) a different message than the start-up mes-
sage. The device started up before the server
did and contains an unknown set of tasks.
The device is added as managed device.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
49
Java Example
Appendix - Classes and Log Messages > Important Core API Log-Messages

Level Src. Message Description


Nr.
warning 3 Application '%s' managed device Device manager could not add the device to
(MAC:%s) creation failed: '%s' the application. There was a problem while
cloning the application subscriptions onto the
device.
warning 3 Found XML configuration version %d. The device manager found an XML configu-
%d not understood, expected %d.%d ration that is using version that cannot be
understood. This indicates versioning
problem.
warning 3 (%d) - Device (MAC: %s, range: [%d, The device manager tries to activate a device
%d) already active! that is already active. This indicates that the
system is in an ill state.
warning 3 Backend trigger is neither EVENT nor The type of backend trigger is not defined.
TIME trigger. Both references are null. The trigger is in an
ill state.
warning 3 Unknown state: %s The task state is unknown.
warning 3 Current state: %s, cannot assume Being in the current state (printed first) the
%s targeted state (printed second) cannot be
reached.
warning 8 Already started. The JAX-WS server is already started. It can
only be started once.

Src. Log Source Identifier


Nr.
1 com.hella.bike.api.implentation.applicationdeviceimpl
2 com.hella.bike.api.implentation.applicationimpl
3 com.hella.bike.api.implentation.devicemanagerimpl
4 com.hella.bike.api.implentation.manageddeviceimpl
5 com.hella.bike.api.implentation.taskimpl
6 com.hella.bike.api.implentation.taskstateimpl
7 com.hella.bike.api.serializablesubscriptionimpl
8 com.hella.bike.backendservice.implentation.backendserviceimpl

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
50
Disclaimer

4 Disclaimer
The examples are only intended for demo purposes to use at your
own risk!
The example servers do not save any counting data or accumulate
data in typical databases!
The .NET example recovers tasks not after APC reboots. It only
performs communication tasks between the APCs and a server.
The demo servers are not designed for secure communication. No
blocking mechanism for data flooding is used.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
51
Glossary and abbreviations

5 Glossary and abbreviations


AOI Area Of Interest
The area to be evaluated using image processing
APC Automatic People Counter
People counter manufactured by the company Hella
API Application Programming Interface
Programming interface for external access
ASCII American Standard Code for Information Interchange
Coding for character sets
Availability Marks the first firmware version, which includes a feature or
attribute - newer versions include this feature or attribute too,
if not marked as deprecated
BIKE Backend Integration Kit including Examples
Java example implementation of Push Services backend for
developers.
CZM Clear Zone Monitoring
Checking in a customizable area the existence of people or
objects.
Default Standard value; value of a configuration parameter upon
delivery of the device
DNS Domain Name System
Resolves queries for FQDN names into IP addresses
Fill Level Current amount of people of a detection area.
FQDN Fully Qualified Domain Name
Address of a device or server using DNS instead of an IP
address
HAGL Hella Aglaia
Identification for IBIS protocol extensions developed by Hella
for the API message interface
HMI Human Machine Interface
Web-based configuration interface for the APC
HTTP Hypertext Transfer Protocol
Application protocol for data transmissions in networks.
HTTP is the basis for data communications in the World
Wide Web.
HTTPS Hypertext Transfer Protocol Secure
Application protocol for secure communication in networks,
with particularly wide deployment on the World Wide Web.
I/O Input/Output
Input and output
IIS Microsoft Internet Information Services
Web server application and set of feature extension modules
created by Microsoft for use with Microsoft Windows
IP address Internet Protocol address

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
52
Glossary and abbreviations

Manually or dynamically assigned in the network


ISO 8601 International standard of representation of dates, times and
durations
JAR Java Archive
JAVA Trademark of Sun Microsystems, Inc.; object-oriented pro-
gramming language
The JAVA runtime environment (JRE) is necessary for exe-
cuting the configuration HMI on a PC.
JDK Java Development Kit
JRE Java Runtime Environment
Necessary runtime environment for executing the configura-
tion HMI on a PC
JVM Java Virtual Machine
MAC address Media Access Control address
Unique hardware address of a network device
NAT Network Address Translation
Process of modifying IP address information during transit
across a traffic routing device
NTP Network Time Protocol
Protocol for the synchronization of time and date settings
between computer systems
OBU On-Board Unit
OSD Optical Self Diagnosis
Software function for checking the visual range
Polling Data request by a server or OBU from the APC via Hella
message API (the connection is established by the server)
POM Project Object Model (Maven)
Push service Sending data from the APC to a data server (the connection
is established by the APC)
SDK Software Development Kit
SOAP Simple Object Access Protocol
Network protocol for exchanging data between systems and
implementing remote procedure calls
UTC Universal Time Coordinated
Coordinated Universal Time (UTC) is the main time standard
by which the world regulates clocks and time.
VPN Virtual Private Network
Technology using the Internet to connect computers to iso-
lated remote computer networks that would otherwise be
inaccessible
Web service Method of communication between two electronic devices
over the web (Internet)
WSDL Web Services Description Language
XML-based language that is used for describing the func-
tionality offered by a web service.

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
53
Glossary and abbreviations

XML Extensible Markup Language


Defines a set of rules for encoding documents in a format
that is both human-readable and machine-readable. XML
has been employed as the base language for communica-
tion protocols.
XSD XML Schema Document
A document written in the XML schema language

This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or
22.04.2015 disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
54
Germany
59552 Lippstadt
Rixbecker Strasse 75
Hella KGaA Hueck & Co.
© 2015 Hella KGaA Hueck & Co., Lippstadt, HAGL-120-00058, 2015-04, SW 3.0

You might also like