Class BundlesInfo
- java.lang.Object
-
- org.apache.sling.testing.clients.osgi.BundlesInfo
-
public class BundlesInfo extends Object
A simple Wrapper around the returned JSON when requesting the status of /system/console/bundles
-
-
Constructor Summary
Constructors Constructor Description BundlesInfo(com.fasterxml.jackson.databind.JsonNode root)The only constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BundleInfoforId(String id)Return bundle info for a bundle with persistence identifierpidBundleInfoforName(String name)Return bundle info for a bundle with namenameBundleInfoforSymbolicName(String name)Return bundle info for a bundle with symbolic namenameintgetNumBundlesByStatus(Bundle.Status status)Returns number of bundles that are in specified stateStringgetStatusMessage()intgetTotalNumOfBundles()
-
-
-
Constructor Detail
-
BundlesInfo
public BundlesInfo(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
-
getStatusMessage
public String getStatusMessage() throws ClientException
- Returns:
- the status message of the bundle context
- Throws:
ClientException- if the request cannot be completed
-
getTotalNumOfBundles
public int getTotalNumOfBundles()
- Returns:
- total number of bundles.
-
getNumBundlesByStatus
public int getNumBundlesByStatus(Bundle.Status status)
Returns number of bundles that are in specified state- Parameters:
status- the requested status- Returns:
- the number of bundles
-
forId
public BundleInfo forId(String id) throws ClientException
Return bundle info for a bundle with persistence identifierpid- Parameters:
id- the id of the bundle- Returns:
- the BundleInfo
- Throws:
ClientException- if the info could not be retrieved
-
forName
public BundleInfo forName(String name) throws ClientException
Return bundle info for a bundle with namename- Parameters:
name- the name of the requested bundle- Returns:
- the info, or
nullif the bundle is not found - Throws:
ClientException- if the info cannot be retrieved
-
forSymbolicName
public BundleInfo forSymbolicName(String name) throws ClientException
Return bundle info for a bundle with symbolic namename- Parameters:
name- the symbolic name of the requested bundle- Returns:
- the info, or
nullif the bundle is not found - Throws:
ClientException- if the info cannot be retrieved
-
-