SlideShare a Scribd company logo
Apache Stratos
Hangout VI
RESTful API for Stratos Controller
Pradeep Fernando
Associate Technical Lead, WSO2 Inc.
Outline
● Carbon admin services and how frontend components
interacts with them
● Stratos controller API (existing) and its UI components.
● What it takes to deploy a web-app in Carbon kernel
● Accessing core OSGi services by means of
CarbonContext API
● JAX-RS web-app exposing admin services of Stratos -
big picture
● How Custom web-app frontend/command line tooling
can interact with the deployed REST apis.
Carbon Admin Services
- The component which hosts JSP frontends are known as frontend
component
- Backend engine exposes the API via WS
Carbon Backend
Component - OSGi
services
Web-Services Interface
FrontEnd
Component
Implementation Class and a
Descriptor File
- There is an implementation class A.K.A. web-
service wrapper class.
- Its defined in a metafile called services.xml
Implementation Class
public class RepositoryAdminService {
/**
* Use this method to add a P2 repository to the system.
*
* @param location of the repository to be added
* @param nickName of the repository to be added
* @return true only if the operation is successful
* @throws AxisFault if an exception occurs while adding the repository
*/
public boolean addRepository(String location, String nickName)
/**
* Use this method to update an existing repository
*
* @param prevLocation current location of the repository
* @param prevNickName current name of the repository
* @param updatedLocation new location of the repository
* @param updatedNickName new name of the repository
* @throws AxisFault if an exception occurs while updating the repository
*/
public void updateRepository(String prevLocation, String prevNickName,
String updatedLocation, String updatedNickName)
Service Meta File
<service name="RepositoryAdminService" scope="transportsession">
<schema schemaNamespace="http://org.apache.axis2/xsd" elementFormDefaultQualified="true"/>
<transports>
<transport>https</transport>
</transports>
<module ref="ComponentMgtModule"/>
<description>
To administer all the repositories where the installable features are available.
</description>
<parameter name="ServiceClass">org.wso2.carbon.feature.mgt.services.prov.
RepositoryAdminService</parameter>
Stratos Controller API
- Tenant Registration
- Cartridge Subscription
Deploying a WebApp in Carbon
Kernel
- Kernel packs an embedded Apache Tomcat
- However there is no /webapps directory
- We have to deploy our webapp
programmatically.
- Writing a Deployer would do...
Accessing Carbon Server Runtime
from a Co-Hosted WebApp.
- CarbonContext API allows us to access Carbon Runtime
details.
Carbon Server Runtime (OSGi Services)
Co-Hosted
WebApp
:)
CarbonContext API...
public String getTenantDomain(boolean resolve)
public int getTenantId(boolean resolve)
public Object getOSGiService(Class clazz)
RESTful API for Stratos Backend
Services...
- Using CarbonContext API and co-hosted
external webapp, we retrieve Stratos backend
services.
- We can write a JAX-RS wrapper.
- JAX-RS deployment model is webapp. :)
The Big Picture..
Implementation Details..
- CXF based JAX-RS webapp
- Wink based webapp.
Personally prefer CXF runtime. But open for
discussion..
API Consumers...
- Stratos-CLI can make use of the new API
- Stratos Controller frontend can a webapp
talking to the new API
- The SC frontend can be hosted in a separate
servlet container, or..
- Can be hosted in the same server instance
Securely exposing those APIs...
- BasicAuth
- Has to be integrated with the Carbon user-store for
tenant level authentication
- Multitenancy handled as well using CarbonContext
APIs.
- OAuth ?
Questions/Suggestions…

More Related Content

What's hot (8)

Introduction to Laravel 5.6 new features by perfect web solutions
Introduction to Laravel 5.6 new features by perfect web solutionsIntroduction to Laravel 5.6 new features by perfect web solutions
Introduction to Laravel 5.6 new features by perfect web solutions
 
DotNet Conf Valencia 2019 - Building cloud native apps with .NRT core 3.0 and...
DotNet Conf Valencia 2019 - Building cloud native apps with .NRT core 3.0 and...DotNet Conf Valencia 2019 - Building cloud native apps with .NRT core 3.0 and...
DotNet Conf Valencia 2019 - Building cloud native apps with .NRT core 3.0 and...
 
Readme
ReadmeReadme
Readme
 
hp 2002 annual report (text only)
hp 	2002 annual report (text only)hp 	2002 annual report (text only)
hp 2002 annual report (text only)
 
hp 2004 10-K only
hp 2004 10-K onlyhp 2004 10-K only
hp 2004 10-K only
 
hp HP 2000 annual report
hp HP 2000 annual reporthp HP 2000 annual report
hp HP 2000 annual report
 
Gemlist
GemlistGemlist
Gemlist
 
hey
hey hey
hey
 

Viewers also liked (10)

Smabhsind0304e
Smabhsind0304eSmabhsind0304e
Smabhsind0304e
 
improved analysis presentation
improved analysis presentationimproved analysis presentation
improved analysis presentation
 
Northeast Georgia History Center
Northeast Georgia History CenterNortheast Georgia History Center
Northeast Georgia History Center
 
Article research
Article researchArticle research
Article research
 
Demistifying OSGi
Demistifying OSGiDemistifying OSGi
Demistifying OSGi
 
khalid saeed profile
khalid saeed profilekhalid saeed profile
khalid saeed profile
 
Content analysis media
Content analysis mediaContent analysis media
Content analysis media
 
We don’t look like that!
We don’t look like that!We don’t look like that!
We don’t look like that!
 
Ea tppt 02
Ea tppt 02Ea tppt 02
Ea tppt 02
 
Introduction to OSGi
Introduction to OSGiIntroduction to OSGi
Introduction to OSGi
 

Similar to Apache Stratos Hangout VI

Stratos Grouping
Stratos GroupingStratos Grouping
Stratos Grouping
WSO2
 
ApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache TuscanyApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache Tuscany
Jean-Sebastien Delfino
 
Building RESTful services using SCA and JAX-RS
Building RESTful services using SCA and JAX-RSBuilding RESTful services using SCA and JAX-RS
Building RESTful services using SCA and JAX-RS
Luciano Resende
 

Similar to Apache Stratos Hangout VI (20)

Servlet 3.0
Servlet 3.0Servlet 3.0
Servlet 3.0
 
Stratos Grouping
Stratos GroupingStratos Grouping
Stratos Grouping
 
Using Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your ServicesUsing Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your Services
 
ApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache TuscanyApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache Tuscany
 
Building RESTful services using SCA and JAX-RS
Building RESTful services using SCA and JAX-RSBuilding RESTful services using SCA and JAX-RS
Building RESTful services using SCA and JAX-RS
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Alfresco Web Content Management Roadmap - 3.2 and Beyond
Alfresco Web Content Management Roadmap - 3.2 and BeyondAlfresco Web Content Management Roadmap - 3.2 and Beyond
Alfresco Web Content Management Roadmap - 3.2 and Beyond
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
GE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTGE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoT
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-final
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 

Apache Stratos Hangout VI

  • 1. Apache Stratos Hangout VI RESTful API for Stratos Controller Pradeep Fernando Associate Technical Lead, WSO2 Inc.
  • 2. Outline ● Carbon admin services and how frontend components interacts with them ● Stratos controller API (existing) and its UI components. ● What it takes to deploy a web-app in Carbon kernel ● Accessing core OSGi services by means of CarbonContext API ● JAX-RS web-app exposing admin services of Stratos - big picture ● How Custom web-app frontend/command line tooling can interact with the deployed REST apis.
  • 3. Carbon Admin Services - The component which hosts JSP frontends are known as frontend component - Backend engine exposes the API via WS Carbon Backend Component - OSGi services Web-Services Interface FrontEnd Component
  • 4. Implementation Class and a Descriptor File - There is an implementation class A.K.A. web- service wrapper class. - Its defined in a metafile called services.xml
  • 5. Implementation Class public class RepositoryAdminService { /** * Use this method to add a P2 repository to the system. * * @param location of the repository to be added * @param nickName of the repository to be added * @return true only if the operation is successful * @throws AxisFault if an exception occurs while adding the repository */ public boolean addRepository(String location, String nickName) /** * Use this method to update an existing repository * * @param prevLocation current location of the repository * @param prevNickName current name of the repository * @param updatedLocation new location of the repository * @param updatedNickName new name of the repository * @throws AxisFault if an exception occurs while updating the repository */ public void updateRepository(String prevLocation, String prevNickName, String updatedLocation, String updatedNickName)
  • 6. Service Meta File <service name="RepositoryAdminService" scope="transportsession"> <schema schemaNamespace="http://org.apache.axis2/xsd" elementFormDefaultQualified="true"/> <transports> <transport>https</transport> </transports> <module ref="ComponentMgtModule"/> <description> To administer all the repositories where the installable features are available. </description> <parameter name="ServiceClass">org.wso2.carbon.feature.mgt.services.prov. RepositoryAdminService</parameter>
  • 7. Stratos Controller API - Tenant Registration - Cartridge Subscription
  • 8. Deploying a WebApp in Carbon Kernel - Kernel packs an embedded Apache Tomcat - However there is no /webapps directory - We have to deploy our webapp programmatically. - Writing a Deployer would do...
  • 9. Accessing Carbon Server Runtime from a Co-Hosted WebApp. - CarbonContext API allows us to access Carbon Runtime details. Carbon Server Runtime (OSGi Services) Co-Hosted WebApp :)
  • 10. CarbonContext API... public String getTenantDomain(boolean resolve) public int getTenantId(boolean resolve) public Object getOSGiService(Class clazz)
  • 11. RESTful API for Stratos Backend Services... - Using CarbonContext API and co-hosted external webapp, we retrieve Stratos backend services. - We can write a JAX-RS wrapper. - JAX-RS deployment model is webapp. :)
  • 13. Implementation Details.. - CXF based JAX-RS webapp - Wink based webapp. Personally prefer CXF runtime. But open for discussion..
  • 14. API Consumers... - Stratos-CLI can make use of the new API - Stratos Controller frontend can a webapp talking to the new API - The SC frontend can be hosted in a separate servlet container, or.. - Can be hosted in the same server instance
  • 15. Securely exposing those APIs... - BasicAuth - Has to be integrated with the Carbon user-store for tenant level authentication - Multitenancy handled as well using CarbonContext APIs. - OAuth ?