SlideShare a Scribd company logo
1 of 16
Download to read offline
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

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 solutionsImran Qasim
 
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...Alberto Diaz Martin
 

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

improved analysis presentation
improved analysis presentationimproved analysis presentation
improved analysis presentationorlabraiden
 
Northeast Georgia History Center
Northeast Georgia History CenterNortheast Georgia History Center
Northeast Georgia History Centerhhardwick
 
Article research
Article researchArticle research
Article researchorlabraiden
 
Demistifying OSGi
Demistifying OSGiDemistifying OSGi
Demistifying OSGipradeepfn
 
khalid saeed profile
khalid saeed profilekhalid saeed profile
khalid saeed profilekashiflucknow
 
Content analysis media
Content analysis mediaContent analysis media
Content analysis mediaorlabraiden
 
We don’t look like that!
We don’t look like that!We don’t look like that!
We don’t look like that!skmcdaniel88
 
Introduction to OSGi
Introduction to OSGiIntroduction to OSGi
Introduction to OSGipradeepfn
 

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 GroupingWSO2
 
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 ServicesAlcide
 
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 TuscanyJean-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-RSLuciano Resende
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
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 2010Arun Gupta
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoasZeid Hassan
 
JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0Arun Gupta
 
(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...Amazon Web Services
 
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 TuscanyLuciano Resende
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3Ben Abdallah Helmi
 
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 BeyondAlfresco Software
 
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.0Eugenio Romano
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3Ben Abdallah Helmi
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
GE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTGE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTKai Zhao
 
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-finalRuslan Meshenberg
 

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

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

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 ?