Asynchronous XML/HTTP Communication

Preview:

DESCRIPTION

Emergency Manager. Web Browser. Asynchronous XML/HTTP Communication. Event Manager. HTML. GMaps. G-AJAX . Client. Server. G-AJAXGoogle AJAX API Gmaps Google Maps API GAEGoogle Web AppEngine. HTTP Request Processor GAE Python. EvE. RES. PoV Pacient or Victim - PowerPoint PPT Presentation

Citation preview

AsynchronousXML/HTTP

Communication

Web Browser

HTML

GMaps G-AJAX HTTP Request Processor

GAE Python

Emergency Manager

Event Manager

Client Server

G-AJAX Google AJAX APIGmaps Google Maps APIGAE Google Web AppEngine

Emergency Detection

Emergency Event created ISMU

MUDEMUAEMURGLISCLMU

MUDL MUAL ETL LRE

PoV

PoV Pacient or VictimEvE Emergency EventRES Remote Emergency ServiceLnM LandmarkMEU Mobile Emergency UnitISMU In Search for Closest MEUMUDE MEU Dispatched to EventMUAE MEU Arrived at EventMURGL MEU Ready to Go to LandmarkISCLMU In Search for Closest MEUMUDL MEU Dispatched to LandmarkMUAL MEU Arrived at LandmarkETL Emergency Event Transferred to LandmarkLER Landmark Received Emergency Event

EvE RES

RES MEUMEU EvEMEURES LnM

RES MEU MEU LnM LnM EvE LnM EvE

Emergency Detection

Emergency Event created

ISMU MUDE

MUAE

MURGL ISCLMU

MUDL

MUAL

ETLLRE

PoVPoV Pacient or VictimEvE Emergency EventRES Remote Emergency ServiceLnM LandmarkMEU Mobile Emergency UnitISMU In Search for Closest MEUENH Emergency Event Not HandledMUDE MEU Dispatched to EventMUAE MEU Arrived at EventMURGL MEU Ready to Go to LandmarkISCLMU In Search for Closest MEUMUDL MEU Dispatched to LandmarkMUAL MEU Arrived at LandmarkETL Emergency Event Transferred to LandmarkLRE Landmark Received Emergency Event

EvE

RES

RES MEU

MEU EvE

MEU RES LnM

RES MEU

MEU LnM

LnM EvELnM EvE

ENH

EvE

Emergency Service

Mobile Emergency Unit

Emergency Landmark

Application

PCM AS Adp

ES/P

Communication Request Processor (GAE Python)

EMSASPaCAdp

EvtQIBWSsProxy

ServicesActivities

Media

PCM Profile and Context ManagerAS Activity Scheduler ServiceES/P Event Service/ProcessorAdp Adaptation ModulePaC Profile and Context ServiceIBWSs Information-Based Web ServicesEMS Event Management ServiceEvtQ Event QueueGAE Google Web AppEngine

Event-basedActivities

Event Processor

EventGenerator

Change ofState

EventChannel

EventSensor

TCP/IPFile, Listener

ServiceApplicationService

UserProducer/Consumer

MessageBroker

PhysicalConnection

UserProducer

AMQPModel

X

XEvent-basedActivities

Event Processor/Broker

Event-based Activities

Event Generator Changes of

State

EventSensor

ServiceApplicationService

UserConsumer

MessageBroker

UserProducer

AMQPModel

Event-based Activities

Event Generator

PhysicalConnection

TCP/UDP

PhysicalConnection

TCP/UDPX

X

Event FiltersEvent Queues

Logical Channel (Stateful)

ExchangesQueues

Event Channel

Event-basedActivities

EventProcessor

EventGenerator

Change ofState

EventChannel

EventSensor

TCP/IPFile, Listener

ServiceApplicationService

EventGenerator

Change ofState

Environmentor Device

LocalEvents

RemoteEvents

Event-basedServices

P3

Consumer ProducerRequest

Response

Event Queue

ProducerInformation

Consumer ProviderRequest

Response

RequestForwarding

P1

P2

Producers Event Queue

Consumer ProducerSubscription

Response(Callback)

Event Queue

SubscribedConsumers

P3Consumer

Event Processor

Request

Response

EventChannel P1

P2

Producers

ProducedEvents

Event QueuePer Topic

Subscriptionper Topic

Consumer ProducerRequest

Response

Event Queue

ProducerInformation

P3Consumer Provider

Request

Response

RequestForwarding

P1

P2

Producers

Consumer ProducerSubscription

Response(Callback)

Event Queue

SubscribedConsumers

P3Consumer

Event Processor

Request

Response

EventChannel P1

P2

Producers

Event QueuePer Topic

Subscriptionper Topic

(a) Requisição-Resposta (b) Requisição-Resposta Anônimo

(c) Callback (d) Baseado em Eventos

Consumer Producer

Consumer

Consumer

Producer

ProducerTopic

Service/Broker

Transport

Weather

Food

Traffic

Applications and Services

Profile and Context Manager

Client Event Processor

EnvironmentSensors

Local Profile andContext Data

Server Event Processor

Subscriptionsper User

Subscriptionsper Topic

Eventsper User

Eventsper Topic

Event Management Service

(1) Publish

new services

(2) Mobileuser login

(3) Get list ofservices forsubscription

(4) Publishchanges inLocal PaCdata

(5, 8) Get user subscribed services and topics

(6) Share PaC data

(7) Publish changesin remote PaC data

(9) Get eventsfor mobile user

(10) Send eventsto mobile user

Adaptation!

EnvironmentSensors

Remote Profile andContext Data

(11) Notifyincommingevents

Subscription Manager Event Container

ApplicationMgmt. Container

InformationBased

Web Services

Applications and Services

Profile and Context Manager

Client Event Processor

EnvironmentSensors

Local Profile andContext Data

Server Event Processor

Event Management Service

(1) Publish

new services

(2) Mobileuser login

(3) Get list ofservices forsubscription

(4) Publishchanges inLocal PaCdata

(5, 8) Get user subscribed services and topics

(6) Share PaC data

(7) Publish changesin remote PaC data

(9) Get eventsfor mobile user

(10) Send eventsto mobile user

Adaptation!

EnvironmentSensors

Remote Profile andContext Data

(11) Notifyincommingevents

Subscriptionsper User

Subscriptionsper Topic

Subscription Manager

Eventsper User

Eventsper Topic

Event Container

ApplicationMgmt. ContainerInformation

BasedWeb Services

Local Profile andContext Data

Server Event ProcessorEvent

Management Service

(1) Publish

new services

(2) Mobile user Authentication

(3) Get list ofservices forsubscription

(4) Publishchanges inLocal PaCdata

(5, 8) Get user subscribed services and topics

(6) Share PaC data

(7) Publish changesin remote PaC data

(9) Get eventsfor mobile user

(10) Send eventsto mobile user

Remote Profile andContext Data

(11) Notifyincommingevents

Subscriptionsper User

Subscriptionsper Topic

Subscription Manager

Eventsper User

Eventsper Topic

Event Container

ApplicationMgmt. ContainerInformation

BasedWeb Services

Applications and Services

PCM

Client Event Processor

Adp. Sched

!

EnvironmentSensors

EnvironmentSensors

Local Profile andContext Data

Server Event

ProcessorEvent Management Service

(1) Publishnew

services

(2) Mobile user Authentication

(3) Get list ofservices forsubscription

(4) Publishchanges inLocal PaCdata

(5, 8) Get user subscribed services and topics

(6) Share PaC data

(7) Publish changesin remote PaC data

(9) Get eventsfor mobile user

(10) Send eventsto mobile user

(11) Notifyincomingevents

Subscriptionsper User

Subscriptionsper Topic

Subscription Manager

Eventsper User

Eventsper Topic

Event Container

ApplicationMgmt. ContainerInformation

BasedWeb Services

Applications and Services

PCM

Client Event Processor

Adp. Sched

!

Remote Profile andContext Data

EnvironmentSensors

EnvironmentSensors

Local Profile andContext Data

Server Event

ProcessorEvent Management Service

(1)

(2) (3) (4)

(5, 8)

(6)

(7)

(9)

(10)

(11)

Subscriptionsper User

Subscriptionsper Topic

Subscription Manager

Eventsper User

Eventsper Topic

Event Container

ApplicationMgmt.

Container

InformationBased

Web Services

Applications and Services

PCM

Client Event Processor

Adp. Sched

!

Remote Profile andContext Data

EnvironmentSensors

EnvironmentSensors

1- Publish new services

2- Mobile user authentication 3- Get list of services for subscription

4- Collect and publish changes in local PaC data

5- Get user subscribed services and topics

6- Share local PaC data

7- Publish changes in remote PaC data

8- Get user subscribed services and topics

9- Get events for mobile user

10- Send events to mobile user

11- Process and notify incoming events

Local Profile andContext Data

Server Event

ProcessorEvent Management Service

(1)

(2)

(3, 6)

(4)

(5)

(6)

(7)

Subscriptionsper User

Subscriptionsper Topic

Subscription Manager

Eventsper User

Eventsper Topic

Event Container

ApplicationMgmt.

Container

InformationBased

Web Services

Context

Web Browser

!

Remote Profile andContext Data

EnvironmentSensors

EnvironmentSensors

(5)

(a) (b)

(c) (d)

Application

PCM Adp AS

ES/P

Communication Python Request Processor

EMSASAdpPaC

Events

IBWS Proxy

Services

Activities

Media

Pac Data

EMS Event Management ServiceIBWSs Information-Based Web ServicesES/P Event Service/ProcessorAS Activity SchedulerPCM Profile and Context ManagerPaC Profile and ContextAdp Content Adaptation

Client ServerHTTP Get Request

XML/HTTP Response

Application

PCM

ES/P

Communication Request Processor

EMS

Event Container

IBWS Proxy

Services

EMS Event Management ServiceIBWSs Information-Based Web ServicesES/P Event Service/ProcessorPCM Profile and Context Manager

Client ServerHTTP Get Request

XML/HTTP Response

Android

Firefox

AndroidFirefox

EntryPoint

Client

Persistence ManagerFactory

Server

Cloud DB

Service Impl

UserManager

EventManager

EmergencyManager

UserService

EventService

EmergencyService

Service Proxy

Web Application

DECS Context

AJAXXMLHTTP

Web Browser

WebKit (Android)Mozilla Firefox

MS IESymbian Skyfire

LandmarkService

Device Information-Location-Energy & Processing-Connectivity (cost & velocity)

User Information-Status-Global context (traffic)-Landmark and Emergency

Cloud InfrastructureAJAX Context

LandmarkManager

Statistics

Events

Routes

Emergencies

Messages

Users

Queue List

Statistics

Events

Routes

Emergencies

Messages

Users

Queue List

LoginPanel

OKCancelOKCancel

ActionAction CallbackCallbackActionActionActionAction CallbackCallbackCallbackCallback

ClickHandlerClickHandlerClickHandlerClickHandlerClickHandlerClickHandlerClickHandlerClickHandler

UnM

PoV

LnM

Users

UnMUnMUnM

PoVPoV

LnMLnM

Users

Subscription Manager

Client

Persistence ManagerFactory

Server

Cloud DB

Service Impl

UserManager

EventManager

EmergencyManager

UserService

EventService

EmergencyService

Service Proxy

Cloud Web App

DECS Context

AJAXXMLHTTP

WebKit (Android)Mozilla Firefox

MS IESymbian Skyfire

LandmarkService

Device Information-Location-Energy & Processing-Connectivity (cost & velocity)

User Information-Status-Global context (traffic)-Landmark, Activities and Emergency

Cloud InfrastructureAJAX Context

LandmarkManagerStatistics

Events

Routes

Emergencies

Messages

Users

Queue List

Statistics

Events

Routes

Emergencies

Messages

Users

Queue List

LoginPanel

OKCancelOKCancel

ActionAction CallbackCallbackActionActionActionAction CallbackCallbackCallbackCallback

ClickHandlerClickHandlerClickHandlerClickHandlerClickHandlerClickHandlerClickHandlerClickHandler

UnM

PoV

LnM

Users

UnMUnMUnM

PoVPoV

LnMLnM

Users

WebBrowser

Entry Point

GuideManager

SubscriptionManager

A T

a1

a2

a3

a4

a5

t1

t2

t3

t4

t5

Ra1 t3

Ra3 t4a5

Profile and ContextProperties/Attributes

Subscription Topics

Context-Topic Relation

A T

a1

a2

a3

a4

a5

t1

t2

t3

t4

t5

Ra1 t3

Ra3 t4a5

Profile and ContextProperties/Attributes

Subscription TopicsContext-Topic Relation

(CTR)

ea3 t4a5

p1 c1

Publishes changes inPaC data

Notifies of changes inPaC data

Producer Consumer

Event Object

S1,4 = (c1,t4)

Topic Subscription for Consumer

A T

a1

a2

a3

a4

a5

t1

t2

t3

t4

t5

Ra1 t3

Ra3 t4a5

Profile and ContextProperties/Attributes

Subscription TopicsContext-Topic Relation

(CTR)

ea3 t4a5

p1 c4Publishes changes in

PaC dataNotifies of changes in

PaC data

Event Object

S1,4 = (c4,t4)

Topic Subscription for Consumer

C

c1

c2

c3

c4

c5

Consumers

sc4 t4

P

p1

p2

p3

p4

p5

Producers

ObservedPropertiesAttributes

E t4

E c4

EventQueues

E t4

E c4

Client Server

(1) Request

(2) Response

Client ServerData

Client

Server

Data

Client

Client

InterestedTopics

Client

Server

(1) Request (2) Response

Client

Server

Pull-based

Data

Client

Server

Data

Client

InterestedTopics

Push-based Publish/Subscribe

Client

tj

[cl,cm,cn]

TopicConsumers Consumer Topics

fs1

fs2fs3 cjtk [ti,tj,tk][cl,cm,cn]

citj

Consumers per Topic Topics per Consumer

f s1 (c i , t j )=si , jNew Subscription

Topics subscribed by consumer

Consumers subscribed to topic

a b c d

a b c

a b c d

User Pol01 User Amb01 User Pol01 User Amb01

a b c d

Client

Server

List Markers

List Events

Create NewEmergency

ISMU MUDE

a b c d

1 5 10 20 50 1000

10000

20000

30000

40000

50000

60000

70000f(x) = 261.917753078642 exp( 0.936214565740072 x )R² = 0.985715996044684

Requests/Replies

Number of Emergency Events Handled

Number ofRequest/Replies

1 5 10 20 50 1000.0430

0.0440

0.0450

0.0460

0.0470

0.0480

0.0490f(x) = 0.00248574217681111 ln(x) + 0.0443909462950785R² = 0.912388399154618

Ratio sent/received

Number of Emergency Events Handled

Bytes sent/Bytes

received

1 5 10 20 50 100586062646668707274

f(x) = 4.63871426517637 ln(x) + 65.3229600047783R² = 0.890552692966627

Bytes sent per request

Number of Emergency Events Handled

Bytes / Request

1 5 10 20 50 1001440

1450

1460

1470

1480

1490

1500

1510f(x) = 21.609519344736 ln(x) + 1469.94293011003R² = 0.78393942985229

Bytes received per request

Number of Emergency Events Handled

Bytes/Request

EventManager

79%

EmergencyManager

0%User

Manager21%

Bytes Sent - Server Side

EventManager

33%

EmergencyManager

2%

UserManager

65%

Bytes Received - Server Side

UI Panels

Context

Actions CallbacksObjectQueues

ServiceProxy

EmergencyManager

UserManager

LandmarkManager

Event Manager

SubscriptionManager

EventContainer

SC SC

SC

SC

SC SC

SCDECSClient

DECSServer

UI Panels Context

Actions

Callbacks

ServiceProxy

EmergencyManager

UserManager

LandmarkManager

Event Manager

SubscriptionManager

EventContainer

SC

SC

SC

SC

SC

SC

SC

DECS Client DECS Server

Map Overlays

UnM

PoV

LnM

Users

UnMUnMUnM

PoVPoV

LnMLnM

Users

GuideManager

SC

WebBrowser

UI Panels Context

Actions

Callbacks

ServiceProxy

EmergencyManager

UserManager

LandmarkManager

Event Manager

SubscriptionManager

EventContainer

SC

SC

SC

SC

SC

SC

SC

Client

Server

Map Overlays

GuideManager

SC

WebBrowser

PersistenceManager

UI Panels

Context

Actions Callbacks

Service Proxy

EmergencyManager

UserManager

LandmarkManager

Event Manager

SubscriptionManager

EventContainer

SC SC

SC

SC

SC SC

SC

Client

Server

Map Overlays

GuideManager

SC

Web Browser

PersistenceManager

HTML, JavaScript and Images

GWT Components

Client Context

NetworkRequest/Response

Remote Service Interface

Remote Service Implementation

Server Components

Web AppEngine (JavaEE)

Number of emergency events Created 1 2 5 10 20 50 100 200

1 Total Bytes received (KB) 558 421 2700 7754 11152 36981 73945 1616822 Total Bytes sent (KB) 26 16 119 363 517 1750 3514 77263 Number of request/replies 369 286 1842 5209 7386 24497 48821 1066034 Total distance (Km) : 27,71 26,65 217,13 434,34 554,18 1779,63 3372,87 7319,485 Total duration (min) 46 47 331 735 911 2699 5288 112066 Velocity (Km/h) 36,50 34,02 39,36 35,46 36,50 39,56 38,27 39,197 Total Events fired 342 249 1793 4832 6853 22537 44234 1026788 Total messages in Queue 342 249 1791 4818 6852 22609 44224 102642

1 2 5 10 20 50 100 200 500 1000 2000 5000 100000

20000

40000

60000

80000

100000

120000

140000

160000

180000f(x) = 161.164449790807 exp( 0.877933149418513 x )R² = 0.970180127181308f(x) = 6.78093091447428 exp( 0.895305556785795 x )R² = 0.96313124142183

Data Transmission (Client to Server)

Number of Emergency Events Created

Kilo

Byte

s

1 2 5 10 20 50 100 2000

10000

20000

30000

40000

50000

60000

70000

80000

Data Received from Server

Data

Rec

eive

dIn

KBy

tes

1 2 3 4 5 6 7 80

5000

10000

15000

20000

25000

30000

Data Sent from Client

Data

Sen

tIn

KBy

tes

execute()

onSuccess()

onFailure()

Recommended