Package org.apache.sling.discovery.commons.providers.spi.base

# Class DiscoveryLiteDescriptor

java.lang.Object
org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteDescriptor

public class DiscoveryLiteDescriptor extends Object
Simplifies access to the underlying JSON-backed oak discovery-lite descriptor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`OAK_DISCOVERYLITE_CLUSTERVIEW`
TODO: avoid hardcoding the constant here but use an Oak constant class instead if possible

## Method Summary

Modifier and Type
Method
Description
`int[]`
`getActiveIds()`
Returns the 'active' field of the discovery-lite descriptor
`int[]`
`getDeactivatingIds()`
Returns the 'deactivating' field of the discovery-lite descriptor
`static DiscoveryLiteDescriptor`
`getDescriptorFrom(org.apache.sling.api.resource.ResourceResolver resourceResolver)`
{"seq":8,"final":true,"id":"aae34e9a-b08d-409e-be10-9ff4106e5387","me":4,"active":[4],"deactivating":[],"inactive":[1,2,3]}
`String`
`getDescriptorStr()`
Returns the raw toString of the underlying descriptor
`int`
`getMyId()`
Returns the 'me' field of the discovery-lite descriptor
`Long`
`getSeqNum()`
`String`
`getViewId()`
Returns the 'id' field of the discovery-lite descriptor
`boolean`
`isFinal()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### OAK_DISCOVERYLITE_CLUSTERVIEW

public static final 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 Details

### getDescriptorFrom

public static DiscoveryLiteDescriptor getDescriptorFrom(org.apache.sling.api.resource.ResourceResolver resourceResolver) throws Exception
{"seq":8,"final":true,"id":"aae34e9a-b08d-409e-be10-9ff4106e5387","me":4,"active":[4],"deactivating":[],"inactive":[1,2,3]}

Throws:
  `Exception`

### getMyId

public int getMyId() throws Exception
Returns the 'me' field of the discovery-lite descriptor

Returns:
  the 'me' field of the discovery-lite descriptor
Throws:
  `Exception` - if anything in the descriptor is wrongly formatted

### getDeactivatingIds

public int[] getDeactivatingIds() throws Exception
Returns the 'deactivating' field of the discovery-lite descriptor

Returns:
  the 'deactivating' field of the discovery-lite descriptor
Throws:
  `Exception` - if anything in the descriptor is wrongly formatted

### getActiveIds

public int[] getActiveIds() throws Exception
Returns the 'active' field of the discovery-lite descriptor

Returns:
  the 'active' field of the discovery-lite descriptor
Throws:
  `Exception` - if anything in the descriptor is wrongly formatted

### getViewId

public String getViewId() throws Exception
Returns the 'id' field of the discovery-lite descriptor

Returns:
  the 'id' field of the discovery-lite descriptor
Throws:
  `Exception` - if anything in the descriptor is wrongly formatted

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getDescriptorStr

public String getDescriptorStr()
Returns the raw toString of the underlying descriptor

Returns:
  the raw toString of the underlying descriptor

### getSeqNum

public Long getSeqNum() throws Exception

Throws:
  `Exception`

### isFinal

public boolean isFinal() throws Exception

Throws:
  `Exception`