Search in sources :

Example 66 with Nonnull

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));
}
Also used : PrivilegeBits(org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeBits) PropertyState(org.apache.jackrabbit.oak.api.PropertyState) Nonnull(javax.annotation.Nonnull)

Example 67 with Nonnull

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;
}
Also used : HashSet(java.util.HashSet) PropertyState(org.apache.jackrabbit.oak.api.PropertyState) Nonnull(javax.annotation.Nonnull)

Example 68 with Nonnull

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);
    }
}
Also used : PrincipalProvider(org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider) UserConfiguration(org.apache.jackrabbit.oak.spi.security.user.UserConfiguration) Nonnull(javax.annotation.Nonnull)

Example 69 with Nonnull

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);
}
Also used : SecureRandom(java.security.SecureRandom) Random(java.util.Random) SecureRandom(java.security.SecureRandom) Nonnull(javax.annotation.Nonnull)

Example 70 with Nonnull

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;
}
Also used : Restriction(org.apache.jackrabbit.oak.spi.security.authorization.restriction.Restriction) RestrictionImpl(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionImpl) HashSet(java.util.HashSet) PropertyState(org.apache.jackrabbit.oak.api.PropertyState) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)2624 Nullable (javax.annotation.Nullable)338 ArrayList (java.util.ArrayList)336 ItemStack (net.minecraft.item.ItemStack)327 List (java.util.List)305 Map (java.util.Map)229 Layer (com.simiacryptus.mindseye.lang.Layer)188 Tensor (com.simiacryptus.mindseye.lang.Tensor)185 Arrays (java.util.Arrays)182 Collectors (java.util.stream.Collectors)169 IOException (java.io.IOException)165 JsonObject (com.google.gson.JsonObject)156 HashMap (java.util.HashMap)145 IntStream (java.util.stream.IntStream)145 Test (org.junit.Test)143 LoggerFactory (org.slf4j.LoggerFactory)138 Logger (org.slf4j.Logger)137 Result (com.simiacryptus.mindseye.lang.Result)130 TensorList (com.simiacryptus.mindseye.lang.TensorList)123 DeltaSet (com.simiacryptus.mindseye.lang.DeltaSet)111