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

# Class ServicesInfo

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

public class ServicesInfo extends Object
A simple Wrapper around the returned JSON when requesting the status of /system/console/services

## Constructor Summary

Constructors
Constructor
Description
`ServicesInfo(com.fasterxml.jackson.databind.JsonNode root)`
The only constructor.

## Method Summary

Modifier and Type
Method
Description
`ServiceInfo`
`forId(String id)`
Return service info for a service with given id
`Collection<ServiceInfo>`
`forType(String type)`
Return service infos for a bundle with name `name`
`int`
`getTotalNumOfServices()`

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

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

## Constructor Details

### ServicesInfo

public ServicesInfo(com.fasterxml.jackson.databind.JsonNode root) throws TestingValidationException
The only constructor.

Parameters:
  `root` - the root JSON node of the bundles info.
Throws:
  `TestingValidationException` - if the json does not contain the proper info

## Method Details

### getTotalNumOfServices

public int getTotalNumOfServices()

Returns:
  total number of bundles.

### forId

public ServiceInfo forId(String id) throws TestingValidationException
Return service info for a service with given id

Parameters:
  `id` - the id of the service
Returns:
  the BundleInfo
Throws:
  `TestingValidationException` - if the info could not be retrieved

### forType

public Collection<ServiceInfo> forType(String type) throws TestingValidationException
Return service infos for a bundle with name `name`

Parameters:
  `type` - the type of the service
Returns:
  a Collection of `ServiceInfo`s of all services with the given type. Might be empty, never `null`
Throws:
  `TestingValidationException` - if the info cannot be retrieved