Author: rombert
Date: Fri Aug  4 07:40:20 2017
New Revision: 1804073

URL: http://svn.apache.org/viewvc?rev=1804073&view=rev
Log:
SLING-7029 - Extension - adding method to stop a bundle

method to stop a bundle added.

public void stopBundle(String symbolicName)

Submitted-By: Andreea Dieaconu <[email protected]>

Closes #249

Modified:
    
sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java

Modified: 
sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java?rev=1804073&r1=1804072&r2=1804073&view=diff
==============================================================================
--- 
sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java
 (original)
+++ 
sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java
 Fri Aug  4 07:40:20 2017
@@ -563,6 +563,18 @@ public class OsgiConsoleClient extends S
         LOG.info("Starting bundle {} via {}", symbolicName, path);
         this.doPost(path, FormEntityBuilder.create().addParameter("action", 
"start").build(), SC_OK);
     }
+    
+    /**
+     * Stop a bundle
+     * @param symbolicName the name of the bundle
+     * @throws ClientException
+     */
+    public void stopBundle(String symbolicName) throws ClientException {
+        // To stop the bundle we POST action=stop to its URL
+        final String path = getBundlePath(symbolicName);
+        LOG.info("Stopping bundle {} via {}", symbolicName, path);
+        this.doPost(path, FormEntityBuilder.create().addParameter("action", 
"stop").build(), SC_OK);
+    }
 
 
     /**
@@ -731,4 +743,4 @@ public class OsgiConsoleClient extends S
             return config;
         }
     }
-}
\ No newline at end of file
+}


Reply via email to