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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceInfo
forId(String id)
Return service info for a service with given idCollection<ServiceInfo>
forType(String type)
Return service infos for a bundle with namename
int
getTotalNumOfServices()
-
-
-
Constructor Detail
-
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 Detail
-
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 namename
- Parameters:
type
- the type of the service- Returns:
- a Collection of
ServiceInfo
s of all services with the given type. Might be empty, nevernull
- Throws:
TestingValidationException
- if the info cannot be retrieved
-
-