Interface ResourceResolverTypeAdapter
public interface ResourceResolverTypeAdapter
SPI interface for resource resolver type implementations to provide a mock
resource resolver factory.
Supported constructors for implementing classes:
- Empty constructor
- Constructor with
BundleContext
parameter
-
Method Summary
Modifier and TypeMethodDescription@Nullable org.apache.sling.api.resource.ResourceResolverFactory
Gets resource resolver factory instance.@Nullable org.apache.sling.jcr.api.SlingRepository
Get SlingRepository instance.default org.apache.sling.jcr.api.SlingRepository
newSlingRepositoryFromSnapshot
(Object snapshot) Get a SlingRepository instance based on a snapshot taken from another repository.default @Nullable Object
snapshot
(org.apache.sling.jcr.api.SlingRepository repository) Make a snapshot of the current state of the given repository, or return null if snapshots are not supported.
-
Method Details
-
newResourceResolverFactory
@Nullable @Nullable org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory()Gets resource resolver factory instance. Can be null if only a SlingRepository is provided, in this case the methodnewSlingRepository()
has to return a value.- Returns:
- Resource resolver factory instance or null
-
newSlingRepository
@Nullable @Nullable org.apache.sling.jcr.api.SlingRepository newSlingRepository()Get SlingRepository instance. Can be null if a resource resolver factory is provided, in this case the methodnewResourceResolverFactory()
has to return a value.- Returns:
- Sling repository instance or null
-
snapshot
Make a snapshot of the current state of the given repository, or return null if snapshots are not supported. Returning non-null implies that callingnewSlingRepositoryFromSnapshot(Object)
with the same object will succeed when called on objects of the same implementation type. The returned object must capture the whole state of the repository, and must not reflect any future changes made to the repository after this method returns.- Parameters:
repository
- The repository to snapshot.- Returns:
- A snapshot object.
-
newSlingRepositoryFromSnapshot
Get a SlingRepository instance based on a snapshot taken from another repository.- Parameters:
snapshot
- A snapshot object, returned by an earlier call tosnapshot(SlingRepository)
.- Returns:
- A Sling repository instance.
-