SlideShare una empresa de Scribd logo
1 de 25
Discovering the p2 API Pascal Rapicault Sonatype, p2 Lead © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 1
Who are the p2 committers? © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 2
History 3.4 / 3.5 provisional API 3.6 / Helios is the first official release of the API © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 3
3 levels of API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 4
Graphical User Interface GUI is SWT-based and designed to be reused in RCP / Eclipse applications.  Ease of reuse: Add the p2.ui.sdk bundle, done (if you use IDE) . Add the p2.ui bundle, write a few extensions, done. org.eclipse.equinox.p2.ui org.eclipse.equinox.p2.ui.sdk © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 5
Graphical User Interface © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 6
Reusing individual UI elements	 Most the pages / wizards can be reused Installed dialog    Repository management License manager Install/Update/Uninstall wizard o.e.e.p2.ui.InstalledSoftwarePage o.e.e.p2.ui.RepositoryManipulationPage o.e.e.p2.ui.AcceptLicensesWizardPage o.e.e.p2.ui.ProvisioningUtil#open*Wizard org.eclipse.equinox.p2.ui © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 7
Tweaking the existing UI The Policy class Show / hide repository selection Drill down Show categories Content of the restart dialog  … org.eclipse.equinox.p2.ui.Policy org.eclipse.equinox.p2.ui © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 8
Tweaking the existing UI © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 9
More on UI reuse See examples on the p2 wiki http://wiki.eclipse.org/Equinox/p2/Examples Susan’s and Steffen’s talk http://www.eclipsecon.org/2010/sessions/?page=sessions&id=1205 © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 10
3 levels of API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 11
Headless operations High level operations to install / update / uninstall Focused on the Eclipse / OSGi use cases Encapsulates: Dependency resolution Download Modification of the system Restart org.eclipse.equinox.p2.operations org.eclipse.equinox.p2.operations © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 12
Headless operations example InstallOperation op = newInstallOperation(session, iusToInstall); if (op.resolveModal(newNullProgressMonitor()).isOK()) op.getProvisioningJob(newNullProgressMonitor()).schedule(); © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 13
3 levels of API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 14
Core concepts installable unit/metadata query/ queryable planner repository agent engine profile registry/ profile © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 15
Repositories p2 Update Site Engine Eclipse/OSGi Native/OS Core concepts Metadata repo Artifact repo Data transfer Metadata fetched and constraints analyzed Transports Planner/Director Http/Https File system Volume Mirroring Provisioning operation requested IU install, uninstall, update operations Artifact availability and mirroring IUs configured into runtimes Profile updated Profile registry Runtimes © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 16
How do I get an IU? IUs can be obtained from Querying the metadata repository  Querying the profile Querying … Programmatically created org.eclipse.equinox.p2.metadata.MetadataFactory org.eclipse.equinox.p2.metadata © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 17
Queries / QueryableHow do I query? What is queryable? Almost everything is queryable (repository, repository manager, profile, …) How do I create a query? QueryUtil.create* Domain specific queries (e.g. in eclipse.touchpoint) p2 QL, p2-specific query language http://wiki.eclipse.org/Query_Language_for_p2 org.eclipse.equinox.p2.query.IQueryable org.eclipse.equinox.p2.query.QueryUtil org.eclipse.equinox.p2.metadata org.eclipse.equinox.p2.ql © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 18
The repository managerHow do I get a repository? Artifact / metadata repository manager Addition / removal of repositories Enable / disable repositories Load Artifact / metadata repository Add Remove Query org.eclipse.equinox.p2.repository.IMetadataRepository org.eclipse.equinox.p2.repository.IArtifactRepository o.e.e.p2.repository.IMetadataRepositoryManager o.e.e.p2.repository.IArtifactRepositoryManager org.eclipse.equinox.p2.repository © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 19
Provisioning agentHow do I get a repository manager or p2 components? The agent groups related services together It is the starting point of everything. It is the executable version of the p2 area (e.g the p2 folder in the eclipse install) Several agents can run at once in one VM. Groups the services together. Allows to change some services (see implementations of IAgentServiceFactory) If you are only dealing with the running instance: Obtain the IProvisioningAgent service from the OSGi registry Create it using the IProvisioningContext#createAgent(null) org.eclipse.equinox.p2.core.IProvisioningAgent org.eclipse.equinox.p2.core.IProvisioningAgentProvider org.eclipse.equinox.p2.core © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 20
Profile / profile registryHow do I know what is installed? A profile is the complete description in terms of IUs of what is installed. The profile registry knows about all the profiles in a given p2 area org.eclipse.equinox.p2.engine.IProfile org.eclipse.equinox.p2.engine.IProfileRegistry org.eclipse.equinox.p2.engine org.eclipse.equinox.p2.engine © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 21
What is not API? Repository serialized format Layout of files on disk under the p2 folder © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 22
Summary 3 levels of API tailored for different needs            Simple things should be simple         Complex things should be possible 	  This API is for YOU! Tell us what you think. © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 23
Thank you mailto:p2-dev@eclipse.org http://wiki.eclipse.org/Equinox/p2 © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 24
Code snippet to install © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 25 ProvisioningSession session = null; 		//get the agent ServiceReferencesr = Activator.sContext.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME); IProvisioningAgentProvideragentProvider = null; 		if (sr == null) 			return; agentProvider = (IProvisioningAgentProvider) Activator.sContext.getService(sr); IProvisioningAgent agent = agentProvider.createAgent(new URI("file:/Applications/eclipse63/p2")); 		//get the repo managers IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); IArtifactRepositoryManagerartifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); 		//Loading reppos IMetadataRepositorymetadataRepo = manager.loadRepository(newURI("file:/Users/Pascal/tmp/demo/"), new NullProgressMonitor()); IArtifactRepositoryartifactRepo = artifactManager.loadRepository(newURI("file:/Users/Pascal/tmp/demo/"), new NullProgressMonitor()); 		//Querying 		Collection toInstall = metadataRepo.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.demo.feature.group"), new NullProgressMonitor()).toUnmodifiableSet(); InstallOperationinstallOperation = new InstallOperation(session, toInstall); 		if (installOperation.resolveModal(newNullProgressMonitor()).isOK()) installOperation.getProvisioningJob(newNullProgressMonitor()).schedule(); agent.close()

Más contenido relacionado

La actualidad más candente

Tycho - Building plug-ins with Maven
Tycho - Building plug-ins with MavenTycho - Building plug-ins with Maven
Tycho - Building plug-ins with MavenPascal Rapicault
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in developmentMartin Toshev
 
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013jsievers
 
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your ProductSleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your ProductSubramanyam C
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good PracticesAnkur Sharma
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesJan S. Rellermeyer
 
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAPEclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAPRalf Sternberg
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)jsievers
 
Single Sourcing RCP and RAP
Single Sourcing RCP and RAPSingle Sourcing RCP and RAP
Single Sourcing RCP and RAPChris Aniszczyk
 
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingOSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingChris Aniszczyk
 
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012Benjamin Cabé
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration testsKenneth Poon
 
Managing Change
Managing ChangeManaging Change
Managing ChangeMirko Jahn
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsTeodor Madan
 
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Sergii Shymko
 
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...UA Mobile
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdatedoscon2007
 
Java Programming (M&M)
Java Programming (M&M)Java Programming (M&M)
Java Programming (M&M)mafffffe19
 

La actualidad más candente (20)

Tycho - Building plug-ins with Maven
Tycho - Building plug-ins with MavenTycho - Building plug-ins with Maven
Tycho - Building plug-ins with Maven
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013
 
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your ProductSleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your Product
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good Practices
 
PDE builds or Maven
PDE builds or MavenPDE builds or Maven
PDE builds or Maven
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAPEclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
 
Maven 3 / Tycho
Maven 3 / TychoMaven 3 / Tycho
Maven 3 / Tycho
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
 
Single Sourcing RCP and RAP
Single Sourcing RCP and RAPSingle Sourcing RCP and RAP
Single Sourcing RCP and RAP
 
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingOSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
 
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration tests
 
Managing Change
Managing ChangeManaging Change
Managing Change
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
 
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
 
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Java Programming (M&M)
Java Programming (M&M)Java Programming (M&M)
Java Programming (M&M)
 

Similar a Discovering the p2 API

Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)Pascal Rapicault
 
Orion RESTful git API
Orion RESTful git APIOrion RESTful git API
Orion RESTful git APITomasz Zarna
 
ABC of Platform Workspace
ABC of Platform WorkspaceABC of Platform Workspace
ABC of Platform WorkspaceTomasz Zarna
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解Rex Tsai
 
Eclipse 3.7 : Tips and tricks
Eclipse 3.7 : Tips and tricksEclipse 3.7 : Tips and tricks
Eclipse 3.7 : Tips and tricksTomasz Zarna
 
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in SecondsWSO2
 
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraftstackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with UnikraftNETWAYS
 
Building Eclipse Plugins with Tycho
Building Eclipse Plugins with TychoBuilding Eclipse Plugins with Tycho
Building Eclipse Plugins with Tychojsievers
 
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsMatt Ray
 
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...Ian Choi
 
Webapps development on ubuntu
Webapps development on ubuntuWebapps development on ubuntu
Webapps development on ubuntuXiaoguo Liu
 
Introduction to compose camps.pdf
Introduction to compose camps.pdfIntroduction to compose camps.pdf
Introduction to compose camps.pdfAnkurAgarwal151093
 
CoreOS @ gluecon 2015
CoreOS @ gluecon 2015CoreOS @ gluecon 2015
CoreOS @ gluecon 2015ifup
 
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfKolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfMichal Rostecki
 
Kubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating SystemKubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating Systemmikaelbarbero
 
Isn’t it Ironic that a Redfish is software defining you
Isn’t it Ironic that a Redfish is software defining you Isn’t it Ironic that a Redfish is software defining you
Isn’t it Ironic that a Redfish is software defining you Bruno Cornec
 

Similar a Discovering the p2 API (20)

Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)
 
Open stack nova reverse engineer
Open stack nova reverse engineerOpen stack nova reverse engineer
Open stack nova reverse engineer
 
Orion RESTful git API
Orion RESTful git APIOrion RESTful git API
Orion RESTful git API
 
What's new in p2 (2009)?
What's new in p2 (2009)?What's new in p2 (2009)?
What's new in p2 (2009)?
 
ABC of Platform Workspace
ABC of Platform WorkspaceABC of Platform Workspace
ABC of Platform Workspace
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解
 
Riena on-e4-ese2010
Riena on-e4-ese2010Riena on-e4-ese2010
Riena on-e4-ese2010
 
Eclipse 3.7 : Tips and tricks
Eclipse 3.7 : Tips and tricksEclipse 3.7 : Tips and tricks
Eclipse 3.7 : Tips and tricks
 
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
 
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraftstackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
 
Building Eclipse Plugins with Tycho
Building Eclipse Plugins with TychoBuilding Eclipse Plugins with Tycho
Building Eclipse Plugins with Tycho
 
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
 
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
 
Webapps development on ubuntu
Webapps development on ubuntuWebapps development on ubuntu
Webapps development on ubuntu
 
Introduction to compose camps.pdf
Introduction to compose camps.pdfIntroduction to compose camps.pdf
Introduction to compose camps.pdf
 
CoreOS @ gluecon 2015
CoreOS @ gluecon 2015CoreOS @ gluecon 2015
CoreOS @ gluecon 2015
 
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfKolla - containerizing the cloud itself
Kolla - containerizing the cloud itself
 
Kubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating SystemKubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating System
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
Isn’t it Ironic that a Redfish is software defining you
Isn’t it Ironic that a Redfish is software defining you Isn’t it Ironic that a Redfish is software defining you
Isn’t it Ironic that a Redfish is software defining you
 

Último

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
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"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
 
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
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Último (20)

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)
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"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
 
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
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"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...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Discovering the p2 API

  • 1. Discovering the p2 API Pascal Rapicault Sonatype, p2 Lead © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 1
  • 2. Who are the p2 committers? © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 2
  • 3. History 3.4 / 3.5 provisional API 3.6 / Helios is the first official release of the API © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 3
  • 4. 3 levels of API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 4
  • 5. Graphical User Interface GUI is SWT-based and designed to be reused in RCP / Eclipse applications. Ease of reuse: Add the p2.ui.sdk bundle, done (if you use IDE) . Add the p2.ui bundle, write a few extensions, done. org.eclipse.equinox.p2.ui org.eclipse.equinox.p2.ui.sdk © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 5
  • 6. Graphical User Interface © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 6
  • 7. Reusing individual UI elements Most the pages / wizards can be reused Installed dialog Repository management License manager Install/Update/Uninstall wizard o.e.e.p2.ui.InstalledSoftwarePage o.e.e.p2.ui.RepositoryManipulationPage o.e.e.p2.ui.AcceptLicensesWizardPage o.e.e.p2.ui.ProvisioningUtil#open*Wizard org.eclipse.equinox.p2.ui © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 7
  • 8. Tweaking the existing UI The Policy class Show / hide repository selection Drill down Show categories Content of the restart dialog … org.eclipse.equinox.p2.ui.Policy org.eclipse.equinox.p2.ui © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 8
  • 9. Tweaking the existing UI © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 9
  • 10. More on UI reuse See examples on the p2 wiki http://wiki.eclipse.org/Equinox/p2/Examples Susan’s and Steffen’s talk http://www.eclipsecon.org/2010/sessions/?page=sessions&id=1205 © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 10
  • 11. 3 levels of API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 11
  • 12. Headless operations High level operations to install / update / uninstall Focused on the Eclipse / OSGi use cases Encapsulates: Dependency resolution Download Modification of the system Restart org.eclipse.equinox.p2.operations org.eclipse.equinox.p2.operations © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 12
  • 13. Headless operations example InstallOperation op = newInstallOperation(session, iusToInstall); if (op.resolveModal(newNullProgressMonitor()).isOK()) op.getProvisioningJob(newNullProgressMonitor()).schedule(); © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 13
  • 14. 3 levels of API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 14
  • 15. Core concepts installable unit/metadata query/ queryable planner repository agent engine profile registry/ profile © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 15
  • 16. Repositories p2 Update Site Engine Eclipse/OSGi Native/OS Core concepts Metadata repo Artifact repo Data transfer Metadata fetched and constraints analyzed Transports Planner/Director Http/Https File system Volume Mirroring Provisioning operation requested IU install, uninstall, update operations Artifact availability and mirroring IUs configured into runtimes Profile updated Profile registry Runtimes © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 16
  • 17. How do I get an IU? IUs can be obtained from Querying the metadata repository Querying the profile Querying … Programmatically created org.eclipse.equinox.p2.metadata.MetadataFactory org.eclipse.equinox.p2.metadata © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 17
  • 18. Queries / QueryableHow do I query? What is queryable? Almost everything is queryable (repository, repository manager, profile, …) How do I create a query? QueryUtil.create* Domain specific queries (e.g. in eclipse.touchpoint) p2 QL, p2-specific query language http://wiki.eclipse.org/Query_Language_for_p2 org.eclipse.equinox.p2.query.IQueryable org.eclipse.equinox.p2.query.QueryUtil org.eclipse.equinox.p2.metadata org.eclipse.equinox.p2.ql © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 18
  • 19. The repository managerHow do I get a repository? Artifact / metadata repository manager Addition / removal of repositories Enable / disable repositories Load Artifact / metadata repository Add Remove Query org.eclipse.equinox.p2.repository.IMetadataRepository org.eclipse.equinox.p2.repository.IArtifactRepository o.e.e.p2.repository.IMetadataRepositoryManager o.e.e.p2.repository.IArtifactRepositoryManager org.eclipse.equinox.p2.repository © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 19
  • 20. Provisioning agentHow do I get a repository manager or p2 components? The agent groups related services together It is the starting point of everything. It is the executable version of the p2 area (e.g the p2 folder in the eclipse install) Several agents can run at once in one VM. Groups the services together. Allows to change some services (see implementations of IAgentServiceFactory) If you are only dealing with the running instance: Obtain the IProvisioningAgent service from the OSGi registry Create it using the IProvisioningContext#createAgent(null) org.eclipse.equinox.p2.core.IProvisioningAgent org.eclipse.equinox.p2.core.IProvisioningAgentProvider org.eclipse.equinox.p2.core © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 20
  • 21. Profile / profile registryHow do I know what is installed? A profile is the complete description in terms of IUs of what is installed. The profile registry knows about all the profiles in a given p2 area org.eclipse.equinox.p2.engine.IProfile org.eclipse.equinox.p2.engine.IProfileRegistry org.eclipse.equinox.p2.engine org.eclipse.equinox.p2.engine © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 21
  • 22. What is not API? Repository serialized format Layout of files on disk under the p2 folder © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 22
  • 23. Summary 3 levels of API tailored for different needs Simple things should be simple Complex things should be possible This API is for YOU! Tell us what you think. © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 23
  • 24. Thank you mailto:p2-dev@eclipse.org http://wiki.eclipse.org/Equinox/p2 © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 24
  • 25. Code snippet to install © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 25 ProvisioningSession session = null; //get the agent ServiceReferencesr = Activator.sContext.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME); IProvisioningAgentProvideragentProvider = null; if (sr == null) return; agentProvider = (IProvisioningAgentProvider) Activator.sContext.getService(sr); IProvisioningAgent agent = agentProvider.createAgent(new URI("file:/Applications/eclipse63/p2")); //get the repo managers IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); IArtifactRepositoryManagerartifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); //Loading reppos IMetadataRepositorymetadataRepo = manager.loadRepository(newURI("file:/Users/Pascal/tmp/demo/"), new NullProgressMonitor()); IArtifactRepositoryartifactRepo = artifactManager.loadRepository(newURI("file:/Users/Pascal/tmp/demo/"), new NullProgressMonitor()); //Querying Collection toInstall = metadataRepo.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.demo.feature.group"), new NullProgressMonitor()).toUnmodifiableSet(); InstallOperationinstallOperation = new InstallOperation(session, toInstall); if (installOperation.resolveModal(newNullProgressMonitor()).isOK()) installOperation.getProvisioningJob(newNullProgressMonitor()).schedule(); agent.close()