Class DiscoveryLiteDescriptor
- java.lang.Object
-
- org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteDescriptor
-
public class DiscoveryLiteDescriptor extends java.lang.Object
Simplifies access to the underlying JSON-backed oak discovery-lite descriptor
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OAK_DISCOVERYLITE_CLUSTERVIEW
TODO: avoid hardcoding the constant here but use an Oak constant class instead if possible
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
getActiveIds()
Returns the 'active' field of the discovery-lite descriptorint[]
getDeactivatingIds()
Returns the 'deactivating' field of the discovery-lite descriptorstatic DiscoveryLiteDescriptor
getDescriptorFrom(ResourceResolver resourceResolver)
{"seq":8,"final":true,"id":"aae34e9a-b08d-409e-be10-9ff4106e5387","me":4,"active":[4],"deactivating":[],"inactive":[1,2,3]}java.lang.String
getDescriptorStr()
Returns the raw toString of the underlying descriptorint
getMyId()
Returns the 'me' field of the discovery-lite descriptorjava.lang.Long
getSeqNum()
java.lang.String
getViewId()
Returns the 'id' field of the discovery-lite descriptorboolean
isFinal()
java.lang.String
toString()
-
-
-
Field Detail
-
OAK_DISCOVERYLITE_CLUSTERVIEW
public static final java.lang.String OAK_DISCOVERYLITE_CLUSTERVIEW
TODO: avoid hardcoding the constant here but use an Oak constant class instead if possible- See Also:
- Constant Field Values
-
-
Method Detail
-
getDescriptorFrom
public static DiscoveryLiteDescriptor getDescriptorFrom(ResourceResolver resourceResolver) throws java.lang.Exception
{"seq":8,"final":true,"id":"aae34e9a-b08d-409e-be10-9ff4106e5387","me":4,"active":[4],"deactivating":[],"inactive":[1,2,3]}- Throws:
java.lang.Exception
-
getMyId
public int getMyId() throws java.lang.Exception
Returns the 'me' field of the discovery-lite descriptor- Returns:
- the 'me' field of the discovery-lite descriptor
- Throws:
java.lang.Exception
- if anything in the descriptor is wrongly formatted
-
getDeactivatingIds
public int[] getDeactivatingIds() throws java.lang.Exception
Returns the 'deactivating' field of the discovery-lite descriptor- Returns:
- the 'deactivating' field of the discovery-lite descriptor
- Throws:
java.lang.Exception
- if anything in the descriptor is wrongly formatted
-
getActiveIds
public int[] getActiveIds() throws java.lang.Exception
Returns the 'active' field of the discovery-lite descriptor- Returns:
- the 'active' field of the discovery-lite descriptor
- Throws:
java.lang.Exception
- if anything in the descriptor is wrongly formatted
-
getViewId
public java.lang.String getViewId() throws java.lang.Exception
Returns the 'id' field of the discovery-lite descriptor- Returns:
- the 'id' field of the discovery-lite descriptor
- Throws:
java.lang.Exception
- if anything in the descriptor is wrongly formatted
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDescriptorStr
public java.lang.String getDescriptorStr()
Returns the raw toString of the underlying descriptor- Returns:
- the raw toString of the underlying descriptor
-
getSeqNum
public java.lang.Long getSeqNum() throws java.lang.Exception
- Throws:
java.lang.Exception
-
isFinal
public boolean isFinal() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-