SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
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…

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 a 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 a 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
 

Último

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

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 ?