SlideShare uma empresa 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()

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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)
 

Semelhante 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
 

Semelhante 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

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Último (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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()