Class BundlesInfo
java.lang.Object
org.apache.sling.testing.clients.osgi.BundlesInfo
A simple Wrapper around the returned JSON when requesting the status of /system/console/bundles
-
Constructor Summary
ConstructorsConstructorDescriptionBundlesInfo
(com.fasterxml.jackson.databind.JsonNode root) The only constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturn bundle info for a bundle with persistence identifierpid
Return bundle info for a bundle with namename
forSymbolicName
(String name) Return bundle info for a bundle with symbolic namename
int
getNumBundlesByStatus
(Bundle.Status status) Returns number of bundles that are in specified stateint
-
Constructor Details
-
BundlesInfo
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
-
getStatusMessage
- Returns:
- the status message of the bundle context
- Throws:
TestingValidationException
- if the request cannot be completed
-
getTotalNumOfBundles
public int getTotalNumOfBundles()- Returns:
- total number of bundles.
-
getNumBundlesByStatus
Returns number of bundles that are in specified state- Parameters:
status
- the requested status- Returns:
- the number of bundles
-
forId
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
Return bundle info for a bundle with namename
- Parameters:
name
- the name of the requested bundle- Returns:
- the info, or
null
if the bundle is not found - Throws:
ClientException
- if the info cannot be retrieved
-
forSymbolicName
Return bundle info for a bundle with symbolic namename
- Parameters:
name
- the symbolic name of the requested bundle- Returns:
- the info, or
null
if the bundle is not found - Throws:
ClientException
- if the info cannot be retrieved
-