blob: 3f5955869e3944e2afdd28b907c208dc02af0921 [file] [log] [blame]
ramvermaaf74a622018-07-31 18:25:39 +01001//
2// ============LICENSE_START=======================================================
3// Copyright (C) 2016-2018 Ericsson. All rights reserved.
4// ================================================================================
5// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
6// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
7//
8// SPDX-License-Identifier: CC-BY-4.0
9// ============LICENSE_END=========================================================
10//
11// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
12//
13
14=== Send Events
15
16Now you have the full system up and running:
17
18- Terminal 1: APEX ready and loaded
19- Terminal 2: an echo client, printing received messages produced by the VPN policy
20- Terminal 2: a console client, waiting for input on the console (standard in) and sending text to APEX
21
22We started the engine with the VPN policy example.
23So all the events we are using now are located in files in the following example directory:
24
25[source%nowrap,sh,numbered]
26----
27#: $APEX_HOME/examples/events/VPN
28> %APEX_HOME%\examples\events\VPN
29----
30
31To sends events, simply copy the content of the event files into Terminal 3 (the console client).
32It will read multi-line JSON text and send the events.
33So copy the content of `SetupEvents.json` into the client.
34APEX will trigger a policy and produce some output, the echo client will also print some events created in the policy.
35In Terminal 1 (APEX) youll see some status messages from the policy as:
36
37[source%nowrap,sh,numbered,subs="attributes+"]
38----
39include::{adsite-main-dir}/site-docs/adoc/fragments/howto-websockets/wsc-screens/vpn-setup-events.log[APEX output for VPN Setup Events]
40----
41
42In Terminal 2 (echo-client) you see the received events, the last two should look like:
43
44[source%nowrap,sh,numbered,subs="attributes+"]
45----
46include::{adsite-main-dir}/site-docs/adoc/fragments/howto-websockets/wsc-screens/echo-client-received-events.log[Echo Client Received Events]
47----
48
49Congratulations, you have triggered a policy in APEX using Websockets, the policy did run through, created events, picked up by the echo-client.
50
51Now you can send the Link 09 and Link 10 events, they will trigger the actual VPN policy and some calculations are made.
52Lets take the Link 09 events from `Link09Events.json`, copy them all into Terminal 3 (the console).
53APEX will run the policy (with some status output), and the echo client will receive and print events.
54
55To terminate the applications, simply press `CTRL+C` in Terminal 1 (APEX).
56This will also terminate the echo-client in Terminal 2.
57Then type `exit<enter>` in Terminal 3 (or `CTRL+C`) to terminate the console-client.
58