use of javax.annotation.Nonnull in project jackrabbit-oak by apache.
the class PermissionStoreImpl method createPermissionEntry.
@Nonnull
private PermissionEntry createPermissionEntry(@Nonnull String path, @Nonnull Tree entryTree) {
PropertyState ps = entryTree.getProperty(REP_PRIVILEGE_BITS);
PrivilegeBits bits = (isJcrAll(ps)) ? allBits : PrivilegeBits.getInstance(ps);
boolean isAllow = TreeUtil.getBoolean(entryTree, REP_IS_ALLOW);
return new PermissionEntry(path, isAllow, Integer.parseInt(entryTree.getName()), bits, restrictionProvider.getPattern(path, entryTree));
}
use of javax.annotation.Nonnull in project jackrabbit-oak by apache.
the class ImpersonationImpl method getImpersonatorNames.
@Nonnull
private Set<String> getImpersonatorNames(@Nonnull Tree userTree) {
Set<String> princNames = new HashSet<String>();
PropertyState impersonators = userTree.getProperty(REP_IMPERSONATORS);
if (impersonators != null) {
for (String v : impersonators.getValue(STRINGS)) {
princNames.add(v);
}
}
return princNames;
}
use of javax.annotation.Nonnull in project jackrabbit-oak by apache.
the class PrincipalConfigurationImpl method getPrincipalProvider.
@Nonnull
@Override
public PrincipalProvider getPrincipalProvider(Root root, NamePathMapper namePathMapper) {
UserConfiguration uc = getSecurityProvider().getConfiguration(UserConfiguration.class);
PrincipalProvider principalProvider = uc.getUserPrincipalProvider(root, namePathMapper);
if (principalProvider != null) {
// use user-implementation specific principal provider implementation
return principalProvider;
} else {
// use default implementation acting on user management API
return new PrincipalProviderImpl(root, uc, namePathMapper);
}
}
use of javax.annotation.Nonnull in project jackrabbit-oak by apache.
the class RandomAuthorizableNodeName method generateNodeName.
@Nonnull
@Override
public String generateNodeName(@Nonnull String authorizableId) {
Random random = new SecureRandom();
char[] chars = new char[length];
for (int i = 0; i < length; i++) {
chars[i] = VALID_CHARS[random.nextInt(VALID_CHARS.length)];
}
return new String(chars);
}
use of javax.annotation.Nonnull in project jackrabbit-oak by apache.
the class PrincipalRestrictionProvider method readRestrictions.
@Nonnull
@Override
public Set<Restriction> readRestrictions(@Nullable String oakPath, @Nonnull Tree aceTree) {
Set<Restriction> restrictions = new HashSet<Restriction>(base.readRestrictions(oakPath, aceTree));
String value = (oakPath == null) ? "" : oakPath;
PropertyState nodePathProp = PropertyStates.createProperty(REP_NODE_PATH, value, Type.PATH);
restrictions.add(new RestrictionImpl(nodePathProp, true));
return restrictions;
}
Aggregations