Class ModuleMetadataRepository

  • All Implemented Interfaces:
    org.eclipse.core.runtime.IAdaptable, org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IInstallableUnit>, org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IInstallableUnit>, org.eclipse.equinox.p2.repository.metadata.IMetadataRepository

    class ModuleMetadataRepository
    extends AbstractMetadataRepository2
    A p2 metadata repository implementation which is persisted in a p2content.xml. The p2content.xml is the file that is deployed to Maven repositories alongside with the built Tycho artifact.
    See Also:
    RepositoryLayoutHelper.FILE_NAME_P2_METADATA
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String REPOSITORY_TYPE
      Type string for this repository type.
      private java.io.File storage  
      private java.util.Set<org.eclipse.equinox.p2.metadata.IInstallableUnit> units  
      • Fields inherited from interface org.eclipse.equinox.p2.repository.IRepository

        ENABLED, NONE, PREFERENCE_NODE, PROP_COMPRESSED, PROP_DESCRIPTION, PROP_MIRRORS_BASE_URL, PROP_MIRRORS_URL, PROP_NAME, PROP_NICKNAME, PROP_PASSWORD, PROP_SYSTEM, PROP_TIMESTAMP, PROP_USERNAME, TYPE_ARTIFACT, TYPE_METADATA
    • Constructor Summary

      Constructors 
      Constructor Description
      ModuleMetadataRepository​(org.eclipse.equinox.p2.core.IProvisioningAgent agent, java.io.File location)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addInstallableUnits​(java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> installableUnits)  
      (package private) static boolean canAttemptRead​(java.io.File repositoryDir)  
      private static java.lang.String generateName​(java.io.File location)  
      (package private) java.io.File getPersistenceFile()  
      private static java.io.File getStorageFile​(java.io.File repositoryDir)  
      boolean isModifiable()  
      private void load()  
      org.eclipse.equinox.p2.query.IQueryResult<org.eclipse.equinox.p2.metadata.IInstallableUnit> query​(org.eclipse.equinox.p2.query.IQuery<org.eclipse.equinox.p2.metadata.IInstallableUnit> query, org.eclipse.core.runtime.IProgressMonitor monitor)  
      void removeAll()  
      boolean removeInstallableUnits​(java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> installableUnits)  
      private void storeOrThrowProvisioningException()  
      private void storeOrThrowRuntimeException()  
      private void storeWithoutExceptionHandling()  
      • Methods inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository

        assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
      • Methods inherited from class org.eclipse.core.runtime.PlatformObject

        getAdapter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.core.runtime.IAdaptable

        getAdapter
      • Methods inherited from interface org.eclipse.equinox.p2.repository.IRepository

        getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, setProperty, setProperty
    • Field Detail

      • REPOSITORY_TYPE

        public static final java.lang.String REPOSITORY_TYPE
        Type string for this repository type. This value needs to be passed to IMetadataRepositoryManager.createRepository(URI, String, String, Map) in order to create a repository of type ModuleMetadataRepository.
        See Also:
        Constant Field Values
      • storage

        private java.io.File storage
      • units

        private java.util.Set<org.eclipse.equinox.p2.metadata.IInstallableUnit> units
    • Constructor Detail

      • ModuleMetadataRepository

        public ModuleMetadataRepository​(org.eclipse.equinox.p2.core.IProvisioningAgent agent,
                                        java.io.File location)
                                 throws org.eclipse.equinox.p2.core.ProvisionException
        Throws:
        org.eclipse.equinox.p2.core.ProvisionException
    • Method Detail

      • generateName

        private static java.lang.String generateName​(java.io.File location)
      • load

        private void load()
                   throws org.eclipse.equinox.p2.core.ProvisionException
        Throws:
        org.eclipse.equinox.p2.core.ProvisionException
      • storeOrThrowProvisioningException

        private void storeOrThrowProvisioningException()
                                                throws org.eclipse.equinox.p2.core.ProvisionException
        Throws:
        org.eclipse.equinox.p2.core.ProvisionException
      • storeOrThrowRuntimeException

        private void storeOrThrowRuntimeException()
      • storeWithoutExceptionHandling

        private void storeWithoutExceptionHandling()
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • query

        public org.eclipse.equinox.p2.query.IQueryResult<org.eclipse.equinox.p2.metadata.IInstallableUnit> query​(org.eclipse.equinox.p2.query.IQuery<org.eclipse.equinox.p2.metadata.IInstallableUnit> query,
                                                                                                                 org.eclipse.core.runtime.IProgressMonitor monitor)
      • isModifiable

        public boolean isModifiable()
        Specified by:
        isModifiable in interface org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IInstallableUnit>
        Overrides:
        isModifiable in class org.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IInstallableUnit>
      • addInstallableUnits

        public void addInstallableUnits​(java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> installableUnits)
      • removeInstallableUnits

        public boolean removeInstallableUnits​(java.util.Collection<org.eclipse.equinox.p2.metadata.IInstallableUnit> installableUnits)
      • removeAll

        public void removeAll()
      • getPersistenceFile

        java.io.File getPersistenceFile()
      • canAttemptRead

        static boolean canAttemptRead​(java.io.File repositoryDir)
      • getStorageFile

        private static java.io.File getStorageFile​(java.io.File repositoryDir)