Class CoreRepositorySetupService
- java.lang.Object
-
- com.composum.sling.core.service.impl.CoreRepositorySetupService
-
- All Implemented Interfaces:
RepositorySetupService
public class CoreRepositorySetupService extends Object implements RepositorySetupService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCoreRepositorySetupService.Tracker
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<CoreRepositorySetupService.Tracker>TRACKER-
Fields inherited from interface com.composum.sling.core.service.RepositorySetupService
GROUP_PATH, MEMBER_OF, USER_PATH
-
-
Constructor Summary
Constructors Constructor Description CoreRepositorySetupService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAcList(@NotNull javax.jcr.Session session, @NotNull String path, @NotNull List<Map<String,Object>> list)protected voidaddAclObject(@NotNull javax.jcr.Session session, @NotNull com.google.gson.stream.JsonReader reader)protected voidaddAcRule(@NotNull javax.jcr.Session session, @NotNull String path, @NotNull String principalName, boolean allow, @NotNull String[] privilegeKeys, @NotNull Map<String,Object> restrictionKeys)voidaddJsonAcl(@NotNull javax.jcr.Session session, @NotNull Reader reader, @Nullable Map<String,Object> values)voidaddJsonAcl(@NotNull javax.jcr.Session session, @NotNull String jsonFilePath, @Nullable Map<String,Object> values)adds ACL accordiong to rules declared as JSON file; e.g.protected voiderror(String pattern, Object... args)protected voidinfo(String pattern, Object... args)protected org.apache.jackrabbit.api.security.user.AuthorizablemakeGroupAvailable(@NotNull javax.jcr.Session session, @NotNull String id, @NotNull String intermediatePath)protected voidmakeMemberAvailable(@NotNull javax.jcr.Session session, @NotNull String memberId, @NotNull List<String> groupIds, @Nullable String groupPath)protected javax.jcr.NodemakeNodeAvailable(@NotNull javax.jcr.Session session, @NotNull String path, @NotNull String primaryType)protected org.apache.jackrabbit.api.security.user.AuthorizablemakeUserAvailable(@NotNull javax.jcr.Session session, @NotNull String id, @NotNull String intermediatePath)protected voidremoveAcList(@NotNull javax.jcr.Session session, @NotNull String path, @NotNull List<Map<String,Object>> list)protected voidremoveAclObject(@NotNull javax.jcr.Session session, @NotNull com.google.gson.stream.JsonReader reader)protected voidremoveAcRule(@NotNull javax.jcr.Session session, @NotNull String path, @Nullable String principal)protected voidremoveGroup(@NotNull javax.jcr.Session session, @NotNull String id)voidremoveJsonAcl(@NotNull javax.jcr.Session session, @NotNull Reader reader, @Nullable Map<String,Object> values)voidremoveJsonAcl(@NotNull javax.jcr.Session session, @NotNull String jsonFilePath, @Nullable Map<String,Object> values)revert all changes made by 'addJsonAcl'...protected voidremoveMember(@NotNull javax.jcr.Session session, @NotNull String memberId, @NotNull List<String> groupIds)protected voidremoveNode(@NotNull javax.jcr.Session session, @NotNull String path)protected voidwarn(String pattern, Object... args)
-
-
-
Field Detail
-
TRACKER
public static final ThreadLocal<CoreRepositorySetupService.Tracker> TRACKER
-
-
Method Detail
-
addJsonAcl
public void addJsonAcl(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String jsonFilePath, @Nullable @Nullable Map<String,Object> values) throws javax.jcr.RepositoryException, IOExceptionDescription copied from interface:RepositorySetupServiceadds ACL accordiong to rules declared as JSON file; e.g.- allow read for 'everyone' on root ('/') to walk trough (this node only)
- deny read for 'a-group' on '/apps' and all subnodes and ensure that this folder and the group exists
- make 'everyone' and 'someone' a member of 'a-group' (both principals must exist)
- remove each ACL for 'a-group' from '/conf' and ensure that this group exists
- Specified by:
addJsonAclin interfaceRepositorySetupService- Parameters:
session- the session (not resolver to make it easy usable in install hooks)jsonFilePath- a repository path to the ACL JSON file- Throws:
javax.jcr.RepositoryExceptionIOException
-
addJsonAcl
public void addJsonAcl(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull Reader reader, @Nullable @Nullable Map<String,Object> values) throws javax.jcr.RepositoryException, IOException- Specified by:
addJsonAclin interfaceRepositorySetupService- Throws:
javax.jcr.RepositoryExceptionIOException
-
removeJsonAcl
public void removeJsonAcl(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String jsonFilePath, @Nullable @Nullable Map<String,Object> values) throws javax.jcr.RepositoryException, IOExceptionDescription copied from interface:RepositorySetupServicerevert all changes made by 'addJsonAcl'... - use the same configuration file- Specified by:
removeJsonAclin interfaceRepositorySetupService- Throws:
javax.jcr.RepositoryExceptionIOException
-
removeJsonAcl
public void removeJsonAcl(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull Reader reader, @Nullable @Nullable Map<String,Object> values) throws javax.jcr.RepositoryException, IOException- Specified by:
removeJsonAclin interfaceRepositorySetupService- Throws:
javax.jcr.RepositoryExceptionIOException
-
addAclObject
protected void addAclObject(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull com.google.gson.stream.JsonReader reader) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
removeAclObject
protected void removeAclObject(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull com.google.gson.stream.JsonReader reader) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
addAcList
protected void addAcList(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String path, @NotNull @NotNull List<Map<String,Object>> list) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
removeAcList
protected void removeAcList(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String path, @NotNull @NotNull List<Map<String,Object>> list) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
addAcRule
protected void addAcRule(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String path, @NotNull @NotNull String principalName, boolean allow, @NotNull @NotNull String[] privilegeKeys, @NotNull @NotNull Map<String,Object> restrictionKeys) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
removeAcRule
protected void removeAcRule(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String path, @Nullable @Nullable String principal) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
makeNodeAvailable
protected javax.jcr.Node makeNodeAvailable(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String path, @NotNull @NotNull String primaryType) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
removeNode
protected void removeNode(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String path) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
makeUserAvailable
protected org.apache.jackrabbit.api.security.user.Authorizable makeUserAvailable(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String id, @NotNull @NotNull String intermediatePath) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
makeGroupAvailable
protected org.apache.jackrabbit.api.security.user.Authorizable makeGroupAvailable(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String id, @NotNull @NotNull String intermediatePath) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
removeGroup
protected void removeGroup(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String id) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
makeMemberAvailable
protected void makeMemberAvailable(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String memberId, @NotNull @NotNull List<String> groupIds, @Nullable @Nullable String groupPath) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
removeMember
protected void removeMember(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull String memberId, @NotNull @NotNull List<String> groupIds) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
-