Class AbstractRepository<T>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractRepository​(IProvisioningAgent agent, java.lang.String name, java.lang.String type, java.lang.String version, java.net.URI location, java.lang.String description, java.lang.String provider, java.util.Map<java.lang.String,​java.lang.String> properties)
      Creates a new repository with the given attributes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void assertModifiable()
      Asserts that this repository is modifiable, throwing a runtime exception if it is not.
      java.lang.String getDescription()
      Returns a brief description of the repository.
      java.net.URI getLocation()
      Returns the location of this repository.
      java.lang.String getName()
      Returns the name of the repository.
      java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Returns a read-only collection of the properties of the repository.
      java.lang.String getProperty​(java.lang.String key)
      Returns the repository property with the given key, or null if no such property is defined
      java.lang.String getProvider()
      Returns the name of the provider of the repository.
      IProvisioningAgent getProvisioningAgent()
      Returns the provisioning agent used by this repository
      java.lang.String getType()
      Returns a string representing the type of the repository.
      java.lang.String getVersion()
      Returns a string representing the version for the repository type.
      boolean isModifiable()
      Returns true if this repository can be modified, and false otherwise.
      void setDescription​(java.lang.String description)
      Sets the description of this repository
      protected void setLocation​(java.net.URI location)
      Sets the location of this repository
      void setName​(java.lang.String value)
      Sets the name of this repository
      protected void setProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
      Sets the properties of this repository
      java.lang.String setProperty​(java.lang.String key, java.lang.String value)
      Sets the value of the property with the given key.
      java.lang.String setProperty​(java.lang.String key, java.lang.String value, IProgressMonitor monitor)
      Sets the value of the property with the given key.
      void setProvider​(java.lang.String provider)
      Sets the provider of this repository
      protected void setType​(java.lang.String type)
      Sets the type of this repository
      protected void setVersion​(java.lang.String version)
      Sets the version of this repository
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable

        query
    • Constructor Detail

      • AbstractRepository

        protected AbstractRepository​(IProvisioningAgent agent,
                                     java.lang.String name,
                                     java.lang.String type,
                                     java.lang.String version,
                                     java.net.URI location,
                                     java.lang.String description,
                                     java.lang.String provider,
                                     java.util.Map<java.lang.String,​java.lang.String> properties)
        Creates a new repository with the given attributes.
        Parameters:
        agent - the provisioning agent to be used by this repository
        name - the repository name
        type - the repository type
        version - the repository version
        location - the repository location
        description - the repository description
        provider - the repository provider
        properties - the repository properties
    • Method Detail

      • assertModifiable

        protected void assertModifiable()
        Asserts that this repository is modifiable, throwing a runtime exception if it is not. This is suitable for use by subclasses when an attempt is made to write to a repository.
      • getDescription

        public java.lang.String getDescription()
        Returns a brief description of the repository.
        Specified by:
        getDescription in interface IRepository<T>
        Returns:
        the description of the repository.
      • getLocation

        public java.net.URI getLocation()
        Returns the location of this repository.
        Specified by:
        getLocation in interface IRepository<T>
        Returns:
        the URI of the repository.
      • getName

        public java.lang.String getName()
        Returns the name of the repository.
        Specified by:
        getName in interface IRepository<T>
        Returns:
        the name of the repository.
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Returns a read-only collection of the properties of the repository.
        Specified by:
        getProperties in interface IRepository<T>
        Returns:
        the properties of this repository.
      • getProperty

        public java.lang.String getProperty​(java.lang.String key)
        Description copied from interface: IRepository
        Returns the repository property with the given key, or null if no such property is defined
        Specified by:
        getProperty in interface IRepository<T>
        Parameters:
        key - the property key
        Returns:
        the property value, or null
      • getProvider

        public java.lang.String getProvider()
        Returns the name of the provider of the repository.
        Specified by:
        getProvider in interface IRepository<T>
        Returns:
        the provider of this repository.
      • getType

        public java.lang.String getType()
        Returns a string representing the type of the repository.
        Specified by:
        getType in interface IRepository<T>
        Returns:
        the type of the repository.
      • getVersion

        public java.lang.String getVersion()
        Returns a string representing the version for the repository type.
        Specified by:
        getVersion in interface IRepository<T>
        Returns:
        the version of the type of the repository.
      • isModifiable

        public boolean isModifiable()
        Description copied from interface: IRepository
        Returns true if this repository can be modified, and false otherwise. Attempts to change the contents of an unmodifiable repository will fail.
        Specified by:
        isModifiable in interface IRepository<T>
        Returns:
        whether or not this repository can be modified
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description of this repository
        Parameters:
        description - the repository description
      • setName

        public void setName​(java.lang.String value)
        Sets the name of this repository
        Parameters:
        value - the repository name
      • setProperty

        public java.lang.String setProperty​(java.lang.String key,
                                            java.lang.String value,
                                            IProgressMonitor monitor)
        Description copied from interface: IRepository
        Sets the value of the property with the given key. Returns the old property associated with that key, if any. Setting a value of null will remove the corresponding key from the properties of this repository.
        Specified by:
        setProperty in interface IRepository<T>
        Parameters:
        key - The property key
        value - The new property value, or null to remove the key
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Returns:
        The old property value, or null if there was no old value
        Since:
        2.1
      • setProperty

        public java.lang.String setProperty​(java.lang.String key,
                                            java.lang.String value)
        Description copied from interface: IRepository
        Sets the value of the property with the given key. Returns the old property associated with that key, if any. Setting a value of null will remove the corresponding key from the properties of this repository.
        Specified by:
        setProperty in interface IRepository<T>
        Parameters:
        key - The property key
        value - The new property value, or null to remove the key
        Returns:
        The old property value, or null if there was no old value
      • setProvider

        public void setProvider​(java.lang.String provider)
        Sets the provider of this repository
        Parameters:
        provider - the repository provider
      • setType

        protected void setType​(java.lang.String type)
        Sets the type of this repository
        Parameters:
        type - the repository type
      • setLocation

        protected void setLocation​(java.net.URI location)
        Sets the location of this repository
        Parameters:
        location - the repository location
      • setVersion

        protected void setVersion​(java.lang.String version)
        Sets the version of this repository
        Parameters:
        version - the repository version
      • setProperties

        protected void setProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
        Sets the properties of this repository
        Parameters:
        properties - the repository provider