Download presentation
Presentation is loading. Please wait.
Published byJeffery Clarke Modified over 9 years ago
1
BETaaS APIs Webinar Adaptation, Service and Extended Service Programming Interfaces 1 H OW TO I NTERACT T HROUGH BET AA S API S
2
BETaaS APIs Webinar 2 Dec 2014 BETaaS: a horizontal platform for IoT Jan 2015 How to interact through BETaaS API Feb 2015 How to use local and remote cloud instances at BETaaS Feb 2015 CoAP Adaptation Plugin Feb 2015 Running apps BETaaS enabled proprietary devices Feb 2015 How to setup security environment in BETaaS W EBINARS A GENDA
3
BETaaS APIs Webinar 3 T HE L AYERED A RCHITECTURE GW
4
BETaaS APIs Webinar 4 E XTERNAL I NTERACTIONS - A DAPTATION Things
5
BETaaS APIs Webinar 5 E XTERNAL I NTERACTIONS - S ERVICE Smartphones, Laptops, etc. Things
6
BETaaS APIs Webinar 6 I NTERACTIONS - E XTENDED S ERVICES Extended Services Things Smartphones, Laptops, etc. Custom Business Logic
7
BETaaS APIs Webinar 7 A DAPTATION I NTERFACE (1/3) To be implemented by every OSGi adaptor bundle Sub-project: betaas-plugins\betaas-adaptation-plugin Once installed, the bundle is automatically exploited by BETaaS Thing Simulator Adaptor Plug-in CoAP Plug-in ETSI Plug-in … Java Interfaces: IAdaptorPlugin
8
BETaaS APIs Webinar 8 A DAPTATION I NTERFACE (2/3) Adaptation bundles are used by BETaaS to: Plug-in Bundle DISCOVER new Things + Context Information GET sensors measurements and/or SUBSCRIBE SET actuators
9
BETaaS APIs Webinar 9 A DAPTATION I NTERFACE (3/3) public Vector > discover() public String getData(String sensorID); public boolean register(String sensorID); public boolean unregister(String sensorID); public String setData(String sensorID, String value); KeyValue ID0323Ar-BTU2-a typePresence …… KeyValue IDMNOS-4520-21 typeHumidity latitude43.192416 …… … public boolean notify(String type, String resourceID, HashMap value); Interface IAdaptorListener (USED) Interface IAdaptorPlugin (IMPLEMENTED) KeyValue measurement7.21 latitude43.192418 ……
10
BETaaS APIs Webinar 10 S ERVICE I NTERFACE (1/2) Used by external applications to: > Request the resources allocation > Get the list of allocated Thing Services > Get and Set data using Thing Services > Retrieve extended services data > Request the execution of background tasks on Thing Services data Sub-project: betaas-service\betaas-service-servicemanager Java Interfaces: ServiceManagerExternalIF Available both through SOAP and REST Services description also available at http:// :8181/cxf
11
BETaaS APIs Webinar 11 S ERVICE I NTERFACE (2/2) public String installApplication( String manifestContent ); public String getApplicationServices( String appID ); public boolean uninstallApplication( String appID, String manifestContent ); public String getThingServiceData( String appID, String serviceID, String token ); public boolean setThingServiceData( String appID, String serviceID, String data, String token ); public String getExtendedServiceData( String appID, String extServUniqueName, String additionalInfo ); public boolean register( String appID, String serviceID, String token ); public boolean unregister( String appID, String serviceID, String token ); public String getTaskData( String appID, String taskID );
12
BETaaS APIs Webinar 12 M ANIFEST – A N E XAMPLE eu.betaas.test.testBETaaSREST MIIGogIBAzCCBlwGCSqGSIb3DQEHAaCCBk[…] http://192.168.31.44:8080/TestBETaaSREST/ STREET LAMP Public 30 43.656998 10.437418 1000.0 betaas.delivery.SET 3 5 15 1
13
BETaaS APIs Webinar 13 S ERVICE I NTERFACE – A N E XAMPLE
14
BETaaS APIs Webinar 14 S ERVICE I NTERFACE – I NTRUSION D ETECTION Uses SOAP service interfaces Allocates one TS for PRESENCE anywhere in the HOME GET TS data (combined value) and requests a simple data TASK presence Private home 1
15
BETaaS APIs Webinar 15 E XTENDED S ERVICE I NTERFACE (1/2) Extended service are OSGi bundles that use Service Layer APIs (ServiceManagerInternalIF) to: > Request the resources allocation > Get and Set data using Thing Services > Request the execution of background tasks on Thing Services data Sub-project: betaas-service\betaas-service-servicemanager Java Interface: IExtendedService Standard Java calls to APIs methods Extended Services must implement an interface
16
BETaaS APIs Webinar 16 E XTENDED S ERVICE I NTERFACE (2/2) public String getUniqueID(); public void notifyInstallation(boolean success, String msg, String extServId, ArrayList servList, ArrayList tokenList); public void notifySLAViolation(String serviceID); public void notifyData(String serviceID, JsonObject data); public String getResult(String additionalInfo); Methods to provide:
17
BETaaS APIs Webinar E XTENDED S ERVICE – LEZ T RAFFIC M GMT Traffic Intensity data Cars position MUNICIPALITY GW Compute dynamic fees User App Adaptation APIs Extended Service APIs Service APIs Discovery of GPS and Traffic sensors Registration to data updates Allocate 2 TS (GPS and Traffic) Registration to data updates Request usage of Extended Service Request data from Extended Service (current fee) 17
18
BETaaS APIs Webinar M OBILE A PP INTERACTION 18 Difficulty to implement a “receptor” service (for PUSH mode) > Use Google Cloud Messaging > Proprietary system > Not free > Vendor lock-in > Use open source queuing tools (RabbitMQ) > Implement your own server > RabbitMQ > Battery consumption > Not possible in some systems > Good luck! Difficulty to interact with SOAP interfaces in mobile development > Complexity > Lack of libraries
19
BETaaS APIs Webinar M OBILE A PP INTERACTION 19 Install App App Id Get services IDs Services IDs Get Data Data Set Data OK/KO Get Data Data Set Data OK/KO Use of the REST interface in PULL mode: loop
20
BETaaS APIs Webinar 20 IntrusionDetection MIIGogIBAzCCBlwGCSqGSIb3DQEHAaCCBk[…] http://localhost:8080/betaasapptester/ presence Private home 1 betaas.delivery.RTPULL 5 5 15 2 M OBILE A PP INTERACTION
21
BETaaS APIs Webinar 21 Install Application: HTTP Method: POST URL: http:// :8181/cfx/sm/application/ Headers: “Content-Type : application/xml” Body: manifest string Returns: :: Get Services IDs: HTTP Method: GET URL: http:// :8181/cfx/sm/application/ Returns: { InstallationInfo: { serviceList : [,...], tokenList : [,...] } } M OBILE A PP INTERACTION – R EST API 1/2
22
BETaaS APIs Webinar 22 Get data: HTTP Method: GET URL: http:// :8181/cfx/sm/data/ / Headers: “token : ” Returns: true/false Uninstall application: HTTP Method: DELETE URL: http:// :8181/cfx/sm/application/ Headers: “token : ” Returns: 200 OK M OBILE A PP INTERACTION – R EST API 2/2 Full specification: http:// :8181/cfx/sm?_wadl
23
BETaaS APIs Webinar 23 M OBILE A PP INTERACTION - S AMPLE GatewayFragment GatewayManager REST server GWCommunicatorREST REST client Mobile App UI Thread AsyncTask (background thread) BETaaS Gateway installApplication(gwId) postResource(appData) POST … 200 OK - 0/1 [200 OK, appId] getResource(app) GET … 200 OK – {InstallationInfo…} [200 OK, {Installatio…}] {, [serv1, serv2], … notifyDataUpdate(res) getPresence(servId) loop getPresence(servId) getResource(servId) GET … 200 OK - appId [200 OK, 0/1] true/false notifyApplicationInstalled(d) loop
24
BETaaS APIs Webinar www.betaas.eu H OW TO USE LOCAL AND REMOTE CLOUD INSTANCES AT BET AA S February 2015 N EXT W EBINAR
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.