Class BundleInfo


  • public class BundleInfo
    extends java.lang.Object
    This object represents information of a bundle.
    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      BundleInfo()
      Create a new BundleInfo object
      BundleInfo​(java.lang.String symbolic, java.lang.String version, java.net.URI location, int startLevel, boolean started)
      Create a new BundleInfo object
      BundleInfo​(java.net.URI location)
      Create a new BundleInfo object
      BundleInfo​(java.net.URI location, int startLevel, boolean started)
      Create a new BundleInfo object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.net.URI getBaseLocation()
      The base location An absolute URI which may be used to resolve relative getLocation() URIs
      long getBundleId()
      Get the bundle id
      java.lang.String getFragmentHost()
      Return the host if this bundle is a fragment
      java.net.URI getLocation()
      The location of this bundle.
      java.lang.String getManifest()
      The manifest for this bundle
      int getStartLevel()
      The start level for this bundle
      java.lang.String getSymbolicName()
      The Bundle-SymbolicName for this bundle.
      java.lang.String getVersion()
      Return the version
      int hashCode()  
      boolean isMarkedAsStarted()
      Whether or not this bundle is marked to be started Default is false
      boolean isResolved()
      Whether or not this bundle is resolved Default is false
      void setBaseLocation​(java.net.URI baseLocation)
      Set a base location against which relative getLocation() URIs may be resolved
      void setBundleId​(long bundleId)
      Set the bundle id.
      void setFragmentHost​(java.lang.String fragmentHost)
      Set the host if this bundle is a fragment
      void setLocation​(java.net.URI location)
      Set the location for this bundle.
      void setManifest​(java.lang.String manifest)
      Set the manifest for this bundle
      void setMarkedAsStarted​(boolean markedAsStarted)
      Set whether or not this bundle should be started
      void setResolved​(boolean resolved)
      Set whether or not the bundle is resolved
      void setStartLevel​(int level)
      Set the start level.
      void setSymbolicName​(java.lang.String symbolicName)
      Set the Bundle-SymbolicName
      void setVersion​(java.lang.String value)
      Set the version, should be a valid Version string
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BundleInfo

        public BundleInfo()
        Create a new BundleInfo object
      • BundleInfo

        public BundleInfo​(java.net.URI location)
        Create a new BundleInfo object
        Parameters:
        location - - the location of the bundle
      • BundleInfo

        public BundleInfo​(java.net.URI location,
                          int startLevel,
                          boolean started)
        Create a new BundleInfo object
        Parameters:
        location - - the location of the bundle
        startLevel - - the start to be used or NO_LEVEL
        started - - whether or not the bundle should be started
      • BundleInfo

        public BundleInfo​(java.lang.String symbolic,
                          java.lang.String version,
                          java.net.URI location,
                          int startLevel,
                          boolean started)
        Create a new BundleInfo object
        Parameters:
        symbolic - The Bundle-SymbolicName name for this bundle
        version - - The version for this bundle, this must be a valid Version string, if null is passed EMPTY_VERSION will be used instead
        location - - the location of the bundle
        startLevel - - the start level of the bundle or NO_LEVEL
        started - - whether or not the bundle should be started
    • Method Detail

      • getBundleId

        public long getBundleId()
        Get the bundle id
        Returns:
        the bundle id or NO_BUNDLEID
      • getBaseLocation

        public java.net.URI getBaseLocation()
        The base location An absolute URI which may be used to resolve relative getLocation() URIs
        Returns:
        absolute URI or null if not set
      • getLocation

        public java.net.URI getLocation()
        The location of this bundle. A location is required if this bundle will be persisted into a configuration file
        Returns:
        URI location or null if not set
      • getManifest

        public java.lang.String getManifest()
        The manifest for this bundle
        Returns:
        the manifest or null if not set
      • getStartLevel

        public int getStartLevel()
        The start level for this bundle
        Returns:
        the start level or NO_LEVEL
      • getSymbolicName

        public java.lang.String getSymbolicName()
        The Bundle-SymbolicName for this bundle. A symbolic name is required if this bundle will be persisted into a configuration file
        Returns:
        the symbolic name or null if not set
      • getVersion

        public java.lang.String getVersion()
        Return the version
        Returns:
        an Version string, or "0.0.0" if not set
      • getFragmentHost

        public java.lang.String getFragmentHost()
        Return the host if this bundle is a fragment
        Returns:
        the host, or null if this is not a fragment
      • isMarkedAsStarted

        public boolean isMarkedAsStarted()
        Whether or not this bundle is marked to be started Default is false
        Returns:
        boolean
      • isResolved

        public boolean isResolved()
        Whether or not this bundle is resolved Default is false
        Returns:
        boolean
      • setBundleId

        public void setBundleId​(long bundleId)
        Set the bundle id.
        Parameters:
        bundleId - The bundle id.
      • setBaseLocation

        public void setBaseLocation​(java.net.URI baseLocation)
        Set a base location against which relative getLocation() URIs may be resolved
        Parameters:
        baseLocation - - an absolute URI
      • setLocation

        public void setLocation​(java.net.URI location)
        Set the location for this bundle.
        Parameters:
        location - The location of the bundle.
      • setManifest

        public void setManifest​(java.lang.String manifest)
        Set the manifest for this bundle
        Parameters:
        manifest - The manifest.
      • setMarkedAsStarted

        public void setMarkedAsStarted​(boolean markedAsStarted)
        Set whether or not this bundle should be started
        Parameters:
        markedAsStarted - Whether the bundle should be started.
      • setResolved

        public void setResolved​(boolean resolved)
        Set whether or not the bundle is resolved
        Parameters:
        resolved - If the bundle is resolved or not.
      • setStartLevel

        public void setStartLevel​(int level)
        Set the start level.
        Parameters:
        level - if a value < 0 is passed, the start level will be set to NO_LEVEL
      • setSymbolicName

        public void setSymbolicName​(java.lang.String symbolicName)
        Set the Bundle-SymbolicName
        Parameters:
        symbolicName - The Bundle-SymbolicName.
      • setVersion

        public void setVersion​(java.lang.String value)
        Set the version, should be a valid Version string
        Parameters:
        value - The version. A valid Version string.
      • setFragmentHost

        public void setFragmentHost​(java.lang.String fragmentHost)
        Set the host if this bundle is a fragment
        Parameters:
        fragmentHost - The host for this fragment.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object