ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 1 | // |
| 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 | |
| 16 | Now 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 | |
| 22 | We started the engine with the VPN policy example. |
| 23 | So 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 | |
| 31 | To sends events, simply copy the content of the event files into Terminal 3 (the console client). |
| 32 | It will read multi-line JSON text and send the events. |
| 33 | So copy the content of `SetupEvents.json` into the client. |
| 34 | APEX will trigger a policy and produce some output, the echo client will also print some events created in the policy. |
| 35 | In Terminal 1 (APEX) you’ll see some status messages from the policy as: |
| 36 | |
| 37 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 38 | ---- |
| 39 | include::{adsite-main-dir}/site-docs/adoc/fragments/howto-websockets/wsc-screens/vpn-setup-events.log[APEX output for VPN Setup Events] |
| 40 | ---- |
| 41 | |
| 42 | In Terminal 2 (echo-client) you see the received events, the last two should look like: |
| 43 | |
| 44 | [source%nowrap,sh,numbered,subs="attributes+"] |
| 45 | ---- |
| 46 | include::{adsite-main-dir}/site-docs/adoc/fragments/howto-websockets/wsc-screens/echo-client-received-events.log[Echo Client Received Events] |
| 47 | ---- |
| 48 | |
| 49 | Congratulations, you have triggered a policy in APEX using Websockets, the policy did run through, created events, picked up by the echo-client. |
| 50 | |
| 51 | Now you can send the Link 09 and Link 10 events, they will trigger the actual VPN policy and some calculations are made. |
| 52 | Let’s take the Link 09 events from `Link09Events.json`, copy them all into Terminal 3 (the console). |
| 53 | APEX will run the policy (with some status output), and the echo client will receive and print events. |
| 54 | |
| 55 | To terminate the applications, simply press `CTRL+C` in Terminal 1 (APEX). |
| 56 | This will also terminate the echo-client in Terminal 2. |
| 57 | Then type `exit<enter>` in Terminal 3 (or `CTRL+C`) to terminate the console-client. |
| 58 | |