org.apache.sling.testing.tools.osgi

## Class WebconsoleClient

- java.lang.Object
- - org.apache.sling.testing.tools.osgi.WebconsoleClient

    public class WebconsoleClient
    extends Object

HTTP Client for the Felix webconsole - simplistic for now

### Field Summary

Fields
`static String` `CONSOLE_BUNDLES_PATH`
`static String` `JSON_KEY_DATA`
`static String` `JSON_KEY_ID`
`static String` `JSON_KEY_STATE`
`static String` `JSON_KEY_VERSION`

### Constructor Summary

Constructors
Constructor and Description
`WebconsoleClient(String slingServerUrl, String username, String password)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `checkBundleInstalled(String symbolicName, int timeoutSeconds)` Check that specified bundle is installed - must be called before other methods that take a symbolicName parameter, in case installBundle was just called and the actual installation hasn't happened yet.
`long` `getBundleId(String symbolicName)` Get bundle id
`String` `getBundleState(String symbolicName)` Get specified bundle state
`String` `getBundleVersion(String symbolicName)` Get bundle version
`void` `installBundle(File f, boolean startBundle)` Install a bundle using the Felix webconsole HTTP interface, with a specific start level
`void` `installBundle(File f, boolean startBundle, int startLevel)` Install a bundle using the Felix webconsole HTTP interface, with a specific start level
`void` `refreshPackages()` Calls PackageAdmin.refreshPackages to enforce re-wiring of all bundles.
`void` `startBundle(String symbolicName)` Start specified bundle
`void` `uninstallBundle(String symbolicName, File f)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### JSON_KEY_ID

    public static final String JSON_KEY_ID

See Also:
  Constant Field Values

#### JSON_KEY_VERSION

    public static final String JSON_KEY_VERSION

See Also:
  Constant Field Values

#### JSON_KEY_DATA

    public static final String JSON_KEY_DATA

See Also:
  Constant Field Values

#### JSON_KEY_STATE

    public static final String JSON_KEY_STATE

See Also:
  Constant Field Values

#### CONSOLE_BUNDLES_PATH

    public static final String CONSOLE_BUNDLES_PATH

See Also:
  Constant Field Values

### Constructor Detail

#### WebconsoleClient

    public WebconsoleClient(String slingServerUrl,
                            String username,
                            String password)

### Method Detail

#### uninstallBundle

    public void uninstallBundle(String symbolicName,
                                File f)
                         throws Exception

Throws:
  `Exception`

#### installBundle

    public void installBundle(File f,
                              boolean startBundle)
                       throws Exception

Install a bundle using the Felix webconsole HTTP interface, with a specific start level

Throws:
  `Exception`

#### installBundle

    public void installBundle(File f,
                              boolean startBundle,
                              int startLevel)
                       throws Exception

Install a bundle using the Felix webconsole HTTP interface, with a specific start level

Throws:
  `Exception`

#### checkBundleInstalled

    public void checkBundleInstalled(String symbolicName,
                                     int timeoutSeconds)

Check that specified bundle is installed - must be called before other methods that take a symbolicName parameter, in case installBundle was just called and the actual installation hasn't happened yet.

#### getBundleId

    public long getBundleId(String symbolicName)
                     throws Exception

Get bundle id

Throws:
  `Exception`

#### getBundleVersion

    public String getBundleVersion(String symbolicName)
                            throws Exception

Get bundle version

Throws:
  `Exception`

#### getBundleState

    public String getBundleState(String symbolicName)
                          throws Exception

Get specified bundle state

Throws:
  `Exception`

#### startBundle

    public void startBundle(String symbolicName)
                     throws Exception

Start specified bundle

Throws:
  `Exception`

#### refreshPackages

    public void refreshPackages()
                         throws Exception

Calls PackageAdmin.refreshPackages to enforce re-wiring of all bundles.

Throws:
  `Exception`