Professional Documents
Culture Documents
Apc Push Service Via Soap Examples v3.0
Apc Push Service Via Soap Examples v3.0
Apc Push Service Via Soap Examples v3.0
© 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
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
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.
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
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
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
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
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
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
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
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
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.
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>
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.
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
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
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
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:\>
C:\Users\myself>mkdir .m2
C:\Users\myself>cd .m2
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
-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
-
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.
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
http://repo1.maven.org/maven2/.m2e/connectors/
m2eclipse-buildhelper/0.15.0/N/
0.15.0.201207090124/
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
D:\Projects\Aglaia\APC.BIKE>
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
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
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
C:\Projects\Aglaia\APC.BIKE\APC.BIKE.Core> mvn
package
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>
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>
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
<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
C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo>CScript
APC.BIKE.ProxyDemo.InstallBaseProducts.js
C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo>mvn package
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
C:\Projects\Aglaia\APC.BIKE
\APC.BIKE.ProxyDemo> java.exe -jar target/
APC.BIKE.ProxyDemo-2.10.0.jar
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.
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
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
Core API
(JAX-WS using SOAP)
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.
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
~listener
B acken dService B acken dServiceListen er TimeMan ager B acken dServiceFactory
Backend Implementation
Figure
Fig. 22: UML 2: UML
class classCore
diagram; diagram; Core classes
API, main API, main classes.
// ...
DeviceManager deviceManager =
DeviceManagerImpl.getDeviceManager();
Application proxyApplication =
deviceManager.getApplication("APC-Proxy");
if (null == proxyApplication) {
// No proxy application created yet
proxyApplication =
deviceManager.createApplication("APC-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.
36
Java Example
Architecture > Device Management
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
Su bscription Man agedD evice A pplication D evice ObservableSu bscription Man ager
-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
Figure
Fig. 23: UML 3: UML
class classRelations
diagram; diagram;between
Relations betweendevices,
managed managed devices, devices
application application
and devices
subscriptions.
and subscriptions.
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
A n on ymou s Listen er
-applicationSubscriptionManager -application
BIKE API
-subscriptionManager
-subscriptionManager
Application
Device Map
-subscriptions Subscription
0..* Templates 0..*
TaskImpl A pplication D eviceImpl
Sub sc rip tio n Imp l
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.
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.
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.
Unsubscribe Sent
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
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
~applicationListener
-digitalInputListener
-deviceMapChangeListener -countingListener
-aliveListener -fillListener -currentItemListener -clearZoneListener
-historicItemListener
-application -applicationDevice
BIKE API
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..*
Figure
Fig. 26: UML 6: UML
class class Proxy
diagram; diagram; Proxy demonstrator
demonstrator selected classes.
selected classes.
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
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
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
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
«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>
TaskSu bscribeLogfiles
TaskSu bscribeErrorLog
TaskSu bscribeVideoStore
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
D ate C lockTime
#countEvent
#clearZoneEvent
#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
47
20 APC BIKE 1.01 Architecture Rev. A – Appendix A
Java Example
Appendix - Classes and Log Messages > Important Core API Log-Messages
#digitalInputPort 0..*
#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.
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
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
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
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
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
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