Package org.apache.sling.testing.clients.osgi

# Class OsgiInstanceConfig

java.lang.Object
org.apache.sling.testing.clients.osgi.OsgiInstanceConfig

All Implemented Interfaces:
  `InstanceConfig`

public class OsgiInstanceConfig extends Object implements InstanceConfig

Allows saving and restoring the OSGiConfig to be used before and after altering OSGi configurations for tests

See `InstanceConfig`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected int`
`waitCount`
Deprecated.

## Constructor Summary

Constructors
Constructor
Description
`OsgiInstanceConfig(T client, String configPID)`

## Method Summary

Modifier and Type
Method
Description
`InstanceConfig`
`restore()`
Restore the current OSGi configuration for the PID defined in the constructor
`InstanceConfig`
`save()`
Save the current OSGi configuration for the PID defined in the constructor

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

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

## Field Details

### waitCount

@Deprecated protected int waitCount
Deprecated.

## Constructor Details

### OsgiInstanceConfig

public OsgiInstanceConfig(T client, String configPID) throws ClientException, InstanceConfigException, InterruptedException

Type Parameters:
  `T` - The type of the Granite Client
Parameters:
  `client` - The Granite Client to be used internally
  `configPID` - The PID for the OSGi configuration
Throws:
  `ClientException` - if the client cannot be initialized
  `InstanceConfigException` - if the config cannot be saved
  `InterruptedException` - if interrupted

## Method Details

### save

public InstanceConfig save() throws InstanceConfigException, InterruptedException
Save the current OSGi configuration for the PID defined in the constructor

Specified by:
  `save` in interface `InstanceConfig`
Returns:
  this
Throws:
  `InstanceConfigException` - if the config cannot be saved
  `InterruptedException` - if interrupted

### restore

public InstanceConfig restore() throws InstanceConfigException, InterruptedException
Restore the current OSGi configuration for the PID defined in the constructor

Specified by:
  `restore` in interface `InstanceConfig`
Returns:
  this
Throws:
  `InstanceConfigException` - if the config cannot be restored
  `InterruptedException` - if interrupted