Adobe Experience Manager Sites Developer Expert Ad0 E134 · Free Practice Question Medium
Question 2
A developer creates an OSGi service to access JCR content. Refer to the code snippet from the OSGi service below. Which set of steps should the developer take to make sure that the code works?
- public class AccessRepository {
- private static final String SERVICE_ACCOUNT_IDENTIFIER = "sample-service";
- private final String getServiceUser() {
- final Map < string, object = "" > authInfo = Collections.singletonMap(
- ResourceResolverFactory.SUBSERVICE,
- (Object) SERVICE_ACCOUNT_IDENTIFIER);
- ResourceResolver serviceResolver = resourceResolverFactory
- .getServiceResourceResolver(authInfo))
- ...
- }
- }
- Bundle ID = com.adobe.aem.samples-bundle
-
A
1. Create an AEM User called systemUser with appropriate ACLs
2. Modify the Apache Sling Service User Mapper Service
3. Set user.default to com.adobe.aem.samples-bundle:sample-service=systemUser
-
B
1. Create a System User called systemUser with appropriate ACLs
2. Modify the Apache Sling Service User Mapper Service Amendment
3. Set user.default to com.adobe.aem.samples-bundle:sample-service=systemUser
-
C
1. Create a System User called systemUser with appropriate ACLs
2. Modify the Apache Sling Service User Mapper Service
3. Set user.default to com.adobe.aem.samples-bundle:sample-service=systemUser
-
D
1. Create an AEM User called systemUser with appropriate ACLs
2. Modify the Apache Sling Service User Mapper Service Amendment
3. Set user.default to com.adobe.aem.samples-bundle:sample-service=systemUser
Reveal correct answer
Correct answer: C
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
