Class KarServiceImpl

  • All Implemented Interfaces:
    KarService

    public class KarServiceImpl
    extends Object
    implements KarService
    Implementation of the KAR service.
    • Constructor Summary

      Constructors 
      Constructor Description
      KarServiceImpl​(String karafBase, String karStorage, org.apache.karaf.features.FeaturesService featuresService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void create​(String repoName, List<String> features, PrintStream console)
      Create a kar from the given feature and repo names.
      void install​(URI karUri)
      Install KAR from a given URI Resources will be copied to the karaf base dir Repository contents will be copied to a subdir in the karaf data directory
      void install​(URI karUri, boolean noAutoStartBundles)
      Install KAR from a given URI
      void install​(URI karUri, boolean noAutoStartBundles, boolean noAutoRefreshBundles)
      Install KAR from a given URI
      void install​(URI karUri, File repoDir, File resourceDir)
      Install a kar with manually given repository and resource directories.
      void install​(URI karUri, File repoDir, File resourceDir, boolean noAutoStartBundles)
      Install a kar with manually given repository and resource directories.
      void install​(URI karUri, File repoDir, File resourceDir, boolean noAutoStartBundles, boolean noAutoRefreshBundles)
      Install a kar with manually given repository and resource directories.
      List<String> list()
      List the KAR stored in the data folder.
      void setNoAutoRefreshBundles​(boolean noAutoRefreshBundles)  
      void setNoAutoStartBundles​(boolean noAutoStartBundles)  
      void uninstall​(String karName)
      Uninstall the given KAR
      void uninstall​(String karName, boolean noAutoRefreshBundles)
      Uninstall the given KAR
    • Constructor Detail

      • KarServiceImpl

        public KarServiceImpl​(String karafBase,
                              String karStorage,
                              org.apache.karaf.features.FeaturesService featuresService)
    • Method Detail

      • install

        public void install​(URI karUri)
                     throws Exception
        Description copied from interface: KarService
        Install KAR from a given URI Resources will be copied to the karaf base dir Repository contents will be copied to a subdir in the karaf data directory
        Specified by:
        install in interface KarService
        Parameters:
        karUri - Uri of the kar to be installed
        Throws:
        Exception - in case of installation failure.
      • install

        public void install​(URI karUri,
                            boolean noAutoStartBundles)
                     throws Exception
        Description copied from interface: KarService
        Install KAR from a given URI
        Specified by:
        install in interface KarService
        Parameters:
        karUri - URI of the kar to install
        noAutoStartBundles - true to not start automatically the bundles, false else
        Throws:
        Exception - in case of installation failure
      • install

        public void install​(URI karUri,
                            boolean noAutoStartBundles,
                            boolean noAutoRefreshBundles)
                     throws Exception
        Description copied from interface: KarService
        Install KAR from a given URI
        Specified by:
        install in interface KarService
        Parameters:
        karUri - URI of the kar to install
        noAutoStartBundles - true to not start automatically the bundles, false else
        noAutoRefreshBundles - true to not refresh automatically the bundles, false else
        Throws:
        Exception - in case of installation failure
      • install

        public void install​(URI karUri,
                            File repoDir,
                            File resourceDir)
                     throws Exception
        Description copied from interface: KarService
        Install a kar with manually given repository and resource directories.
        Specified by:
        install in interface KarService
        Parameters:
        karUri - Uri of the kar to be installed
        repoDir - destination for the repository contents of the kar
        resourceDir - destination for the resource contents of the kar
        Throws:
        Exception - in case of installation failure
      • install

        public void install​(URI karUri,
                            File repoDir,
                            File resourceDir,
                            boolean noAutoStartBundles)
                     throws Exception
        Description copied from interface: KarService
        Install a kar with manually given repository and resource directories.
        Specified by:
        install in interface KarService
        Parameters:
        karUri - Uri of the kar to be installed.
        repoDir - destination for the repository contents of the kar
        resourceDir - destination for the resource contents of the kar
        noAutoStartBundles - true to not start automatically the bundles, false else
        Throws:
        Exception - in case of installation failure
      • install

        public void install​(URI karUri,
                            File repoDir,
                            File resourceDir,
                            boolean noAutoStartBundles,
                            boolean noAutoRefreshBundles)
                     throws Exception
        Description copied from interface: KarService
        Install a kar with manually given repository and resource directories.
        Specified by:
        install in interface KarService
        Parameters:
        karUri - Uri of the kar to be installed.
        repoDir - destination for the repository contents of the kar
        resourceDir - destination for the resource contents of the kar
        noAutoStartBundles - true to not start automatically the bundles, false else
        noAutoRefreshBundles - true to not refresh automatically the bundles, false else
        Throws:
        Exception - in case of installation failure
      • uninstall

        public void uninstall​(String karName)
                       throws Exception
        Description copied from interface: KarService
        Uninstall the given KAR
        Specified by:
        uninstall in interface KarService
        Parameters:
        karName - the name of the KAR
        Throws:
        Exception - in case of failure
      • uninstall

        public void uninstall​(String karName,
                              boolean noAutoRefreshBundles)
                       throws Exception
        Description copied from interface: KarService
        Uninstall the given KAR
        Specified by:
        uninstall in interface KarService
        Parameters:
        karName - the name of the KAR
        noAutoRefreshBundles - true to not automatically refresh bundles, false else.
        Throws:
        Exception - in case of failure
      • list

        public List<String> list()
                          throws Exception
        Description copied from interface: KarService
        List the KAR stored in the data folder.
        Specified by:
        list in interface KarService
        Returns:
        the list of KAR stored.
        Throws:
        Exception - in case of listing failure.
      • create

        public void create​(String repoName,
                           List<String> features,
                           PrintStream console)
        Description copied from interface: KarService
        Create a kar from the given feature and repo names. Each named feature including all transitive deps will be added. For each named repo all features in the repo and their transitive deps will be added.
        Specified by:
        create in interface KarService
        Parameters:
        repoName - the feature repository to use to create the kar.
        features - the list of features to include in the created kar.
        console - the console stream where to print details.
      • setNoAutoRefreshBundles

        public void setNoAutoRefreshBundles​(boolean noAutoRefreshBundles)
      • setNoAutoStartBundles

        public void setNoAutoStartBundles​(boolean noAutoStartBundles)