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 ServiceInfoforId(String id)Return service info for a service with given idCollection<ServiceInfo>forType(String type)Return service infos for a bundle with namenameintgetTotalNumOfServices()
-
-
-
Constructor Detail
-
ServicesInfo
public ServicesInfo(com.fasterxml.jackson.databind.JsonNode root) throws ClientExceptionThe only constructor.- Parameters:
root- the root JSON node of the bundles info.- Throws:
ClientException- 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 ClientException
Return service info for a service with given id- Parameters:
id- the id of the service- Returns:
- the BundleInfo
- Throws:
ClientException- if the info could not be retrieved
-
forType
public Collection<ServiceInfo> forType(String type) throws ClientException
Return service infos for a bundle with namename- Parameters:
type- the type of the service- Returns:
- a Collection of
ServiceInfos of all services with the given type. Might be empty, nevernull - Throws:
ClientException- if the info cannot be retrieved
-
-