Author: reschke
Date: Wed Jul 18 14:14:13 2018
New Revision: 1836171
URL: http://svn.apache.org/viewvc?rev=1836171&view=rev
Log:
OAK-7511: get rid of JSR 305 dependency - use jetbrains nullability annotations
instead - oak-auth-ldap
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/pom.xml
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
Modified: jackrabbit/oak/trunk/oak-auth-ldap/pom.xml
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/pom.xml?rev=1836171&r1=1836170&r2=1836171&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-auth-ldap/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-auth-ldap/pom.xml Wed Jul 18 14:14:13 2018
@@ -185,10 +185,10 @@
<artifactId>slf4j-api</artifactId>
</dependency>
- <!-- Findbugs annotations -->
+ <!-- Nullability annotations -->
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
+ <groupId>org.jetbrains</groupId>
+ <artifactId>annotations</artifactId>
</dependency>
<!-- Test Dependencies -->
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java?rev=1836171&r1=1836170&r2=1836171&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
(original)
+++
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
Wed Jul 18 14:14:13 2018
@@ -18,12 +18,11 @@ package org.apache.jackrabbit.oak.securi
import java.util.Map;
-import javax.annotation.Nonnull;
-
import org.apache.directory.api.ldap.model.entry.Entry;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef;
+import org.jetbrains.annotations.NotNull;
public class LdapGroup extends LdapIdentity implements ExternalGroup {
@@ -33,7 +32,7 @@ public class LdapGroup extends LdapIdent
super(provider, ref, id, path, entry);
}
- @Nonnull
+ @NotNull
@Override
public Iterable<ExternalIdentityRef> getDeclaredMembers() throws
ExternalIdentityException {
if (members == null) {
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java?rev=1836171&r1=1836170&r2=1836171&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
(original)
+++
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
Wed Jul 18 14:14:13 2018
@@ -18,12 +18,11 @@ package org.apache.jackrabbit.oak.securi
import java.util.Map;
-import javax.annotation.Nonnull;
-
import org.apache.directory.api.ldap.model.entry.Entry;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentity;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef;
+import org.jetbrains.annotations.NotNull;
/**
* Implements an identity that is provided by the {@link LdapIdentityProvider}.
@@ -59,7 +58,7 @@ public abstract class LdapIdentity imple
/**
* {@inheritDoc}
*/
- @Nonnull
+ @NotNull
@Override
public ExternalIdentityRef getExternalId() {
return ref;
@@ -68,7 +67,7 @@ public abstract class LdapIdentity imple
/**
* {@inheritDoc}
*/
- @Nonnull
+ @NotNull
@Override
public String getId() {
return id;
@@ -78,7 +77,7 @@ public abstract class LdapIdentity imple
* Returns the DN as principal name.
* @return the DN
*/
- @Nonnull
+ @NotNull
@Override
public String getPrincipalName() {
return ref.getId();
@@ -95,7 +94,7 @@ public abstract class LdapIdentity imple
/**
* {@inheritDoc}
*/
- @Nonnull
+ @NotNull
@Override
public Iterable<ExternalIdentityRef> getDeclaredGroups() throws
ExternalIdentityException {
if (groups == null) {
@@ -107,7 +106,7 @@ public abstract class LdapIdentity imple
/**
* {@inheritDoc}
*/
- @Nonnull
+ @NotNull
@Override
public Map<String, Object> getProperties() {
return properties;
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java?rev=1836171&r1=1836170&r2=1836171&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
(original)
+++
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
Wed Jul 18 14:14:13 2018
@@ -20,8 +20,7 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import org.jetbrains.annotations.Nullable;
/**
* {@code LdapIdentityProperties} implements a case insensitive hash map that
preserves the case of the keys but
@@ -88,7 +87,7 @@ public class LdapIdentityProperties exte
keyMapping.clear();
}
- @CheckForNull
+ @Nullable
private String convert(@Nullable Object obj) {
if (obj == null) {
return null;
@@ -96,4 +95,4 @@ public class LdapIdentityProperties exte
String key = obj instanceof String ? (String) obj :
String.valueOf(obj);
return key.toUpperCase(Locale.ENGLISH).toLowerCase(Locale.ENGLISH);
}
-}
\ No newline at end of file
+}
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java?rev=1836171&r1=1836170&r2=1836171&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
(original)
+++
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
Wed Jul 18 14:14:13 2018
@@ -27,9 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.Credentials;
import javax.jcr.SimpleCredentials;
import javax.net.ssl.SSLContext;
@@ -80,6 +77,8 @@ import org.apache.jackrabbit.oak.spi.sec
import
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser;
import
org.apache.jackrabbit.oak.spi.security.authentication.external.PrincipalNameResolver;
import org.apache.jackrabbit.util.Text;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -142,7 +141,7 @@ public class LdapIdentityProvider implem
* Constructor for non-OSGi cases.
* @param config the configuration
*/
- public LdapIdentityProvider(@Nonnull LdapProviderConfig config) {
+ public LdapIdentityProvider(@NotNull LdapProviderConfig config) {
this.config = config;
init();
}
@@ -185,9 +184,9 @@ public class LdapIdentityProvider implem
}
//----------------------------------------------< PrincipalNameResolver
>---
- @Nonnull
+ @NotNull
@Override
- public String fromExternalIdentityRef(@Nonnull ExternalIdentityRef
externalIdentityRef) throws ExternalIdentityException {
+ public String fromExternalIdentityRef(@NotNull ExternalIdentityRef
externalIdentityRef) throws ExternalIdentityException {
if (!isMyRef(externalIdentityRef)) {
throw new ExternalIdentityException("Foreign IDP " +
externalIdentityRef.getString());
}
@@ -195,14 +194,14 @@ public class LdapIdentityProvider implem
}
//-------------------------------------------< ExternalIdentityProvider
>---
- @Nonnull
+ @NotNull
@Override
public String getName() {
return config.getName();
}
@Override
- public ExternalIdentity getIdentity(@Nonnull ExternalIdentityRef ref)
throws ExternalIdentityException {
+ public ExternalIdentity getIdentity(@NotNull ExternalIdentityRef ref)
throws ExternalIdentityException {
if (!isMyRef(ref)) {
return null;
}
@@ -243,7 +242,7 @@ public class LdapIdentityProvider implem
}
@Override
- public ExternalUser getUser(@Nonnull String userId) throws
ExternalIdentityException {
+ public ExternalUser getUser(@NotNull String userId) throws
ExternalIdentityException {
DebugTimer timer = new DebugTimer();
LdapConnection connection = connect();
timer.mark("connect");
@@ -266,7 +265,7 @@ public class LdapIdentityProvider implem
}
@Override
- public ExternalGroup getGroup(@Nonnull String name) throws
ExternalIdentityException {
+ public ExternalGroup getGroup(@NotNull String name) throws
ExternalIdentityException {
DebugTimer timer = new DebugTimer();
LdapConnection connection = connect();
timer.mark("connect");
@@ -288,7 +287,7 @@ public class LdapIdentityProvider implem
}
}
- @Nonnull
+ @NotNull
@Override
public Iterator<ExternalUser> listUsers() throws ExternalIdentityException
{
try {
@@ -312,7 +311,7 @@ public class LdapIdentityProvider implem
}
}
- @Nonnull
+ @NotNull
@Override
public Iterator<ExternalGroup> listGroups() throws
ExternalIdentityException {
try {
@@ -337,7 +336,7 @@ public class LdapIdentityProvider implem
}
@Override
- public ExternalUser authenticate(@Nonnull Credentials credentials) throws
ExternalIdentityException, LoginException {
+ public ExternalUser authenticate(@NotNull Credentials credentials) throws
ExternalIdentityException, LoginException {
if (!(credentials instanceof SimpleCredentials)) {
log.debug("LDAP IDP can only authenticate SimpleCredentials.");
return null;
@@ -555,7 +554,7 @@ public class LdapIdentityProvider implem
* Creates a new connection config based on the config.
* @return the connection config.
*/
- @Nonnull
+ @NotNull
private LdapConnectionConfig createConnectionConfig() {
LdapConnectionConfig cc = new LdapConnectionConfig();
cc.setLdapHost(config.getHostname());
@@ -575,8 +574,8 @@ public class LdapIdentityProvider implem
return cc;
}
- @CheckForNull
- private Entry getEntry(@Nonnull LdapConnection connection, @Nonnull
LdapProviderConfig.Identity idConfig, @Nonnull String id, @Nonnull String[]
customAttributes)
+ @Nullable
+ private Entry getEntry(@NotNull LdapConnection connection, @NotNull
LdapProviderConfig.Identity idConfig, @NotNull String id, @NotNull String[]
customAttributes)
throws CursorException, LdapException {
String searchFilter = idConfig.getSearchFilter(id);
@@ -632,8 +631,8 @@ public class LdapIdentityProvider implem
}
- @Nonnull
- private SearchResultIterator getEntryIterator(@Nonnull
LdapProviderConfig.Identity idConfig) throws LdapException, CursorException,
ExternalIdentityException {
+ @NotNull
+ private SearchResultIterator getEntryIterator(@NotNull
LdapProviderConfig.Identity idConfig) throws LdapException, CursorException,
ExternalIdentityException {
StringBuilder filter = new StringBuilder();
int num = 0;
for (String objectClass: idConfig.getObjectClasses()) {
@@ -665,8 +664,8 @@ public class LdapIdentityProvider implem
private int pos = -1;
public SearchResultIterator(
- @Nonnull String searchFilter,
- @Nonnull LdapProviderConfig.Identity idConfig) throws
LdapException, CursorException, ExternalIdentityException {
+ @NotNull String searchFilter,
+ @NotNull LdapProviderConfig.Identity idConfig) throws
LdapException, CursorException, ExternalIdentityException {
this.searchFilter = searchFilter;
this.idConfig = idConfig;
findNextEntry();
@@ -700,7 +699,7 @@ public class LdapIdentityProvider implem
//-------------------------------------------------------< internal
>---
- private SearchRequest createSearchRequest(LdapConnection connection,
byte[] cookie, @Nonnull String[] userAttributes) throws LdapException {
+ private SearchRequest createSearchRequest(LdapConnection connection,
byte[] cookie, @NotNull String[] userAttributes) throws LdapException {
SearchRequest req = new SearchRequestImpl();
req.setScope(SearchScope.SUBTREE);
if (userAttributes.length == 0) {
@@ -788,20 +787,20 @@ public class LdapIdentityProvider implem
}
}
- @Nonnull
- private ExternalUser createUser(@Nonnull Entry entry, @CheckForNull String
id)
+ @NotNull
+ private ExternalUser createUser(@NotNull Entry entry, @Nullable String id)
throws LdapInvalidAttributeValueException {
return (ExternalUser) createIdentity(entry, id, false);
}
- @Nonnull
- private ExternalGroup createGroup(@Nonnull Entry entry, @CheckForNull
String id)
+ @NotNull
+ private ExternalGroup createGroup(@NotNull Entry entry, @Nullable String
id)
throws LdapInvalidAttributeValueException {
return (ExternalGroup) createIdentity(entry, id, true);
}
- @Nonnull
- private ExternalIdentity createIdentity(@Nonnull Entry entry,
@CheckForNull String id, boolean isGroup)
+ @NotNull
+ private ExternalIdentity createIdentity(@NotNull Entry entry, @Nullable
String id, boolean isGroup)
throws LdapInvalidAttributeValueException {
LdapProviderConfig.Identity cfg = isGroup ? config.getGroupConfig() :
config.getUserConfig();
if (id == null) {
@@ -845,7 +844,7 @@ public class LdapIdentityProvider implem
}
}
- @Nonnull
+ @NotNull
private LdapConnection connect() throws ExternalIdentityException {
try {
if (adminPool == null) {
@@ -874,7 +873,7 @@ public class LdapIdentityProvider implem
}
}
- private boolean isMyRef(@Nonnull ExternalIdentityRef ref) {
+ private boolean isMyRef(@NotNull ExternalIdentityRef ref) {
final String refProviderName = ref.getProviderName();
return refProviderName == null || refProviderName.isEmpty() ||
getName().equals(refProviderName);
}
@@ -895,9 +894,9 @@ public class LdapIdentityProvider implem
return path.toString();
}
- private static ExternalIdentityException lookupFailedException(@Nonnull
Exception e, @CheckForNull DebugTimer timer) {
+ private static ExternalIdentityException lookupFailedException(@NotNull
Exception e, @Nullable DebugTimer timer) {
String msg = "Error during ldap lookup. ";
log.error(msg + ((timer != null) ? timer.getString() : ""), e);
return new ExternalIdentityException(msg, e);
}
-}
\ No newline at end of file
+}
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java?rev=1836171&r1=1836170&r2=1836171&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
(original)
+++
jackrabbit/oak/trunk/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
Wed Jul 18 14:14:13 2018
@@ -20,14 +20,12 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.apache.directory.api.util.Strings;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Configuration of the ldap provider.
@@ -459,7 +457,7 @@ public class LdapProviderConfig {
* Configures the base DN for searches of this kind of identity
* @return the base DN
*/
- @Nonnull
+ @NotNull
public String getBaseDN() {
return baseDN;
}
@@ -470,8 +468,8 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getBaseDN()
*/
- @Nonnull
- public Identity setBaseDN(@Nonnull String baseDN) {
+ @NotNull
+ public Identity setBaseDN(@NotNull String baseDN) {
this.baseDN = baseDN;
return this;
}
@@ -481,7 +479,7 @@ public class LdapProviderConfig {
* @return an array of object classes
* @see #getSearchFilter(String) for more detail about searching and
filtering
*/
- @Nonnull
+ @NotNull
public String[] getObjectClasses() {
return objectClasses;
}
@@ -492,8 +490,8 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getObjectClasses()
*/
- @Nonnull
- public Identity setObjectClasses(@Nonnull String ... objectClasses) {
+ @NotNull
+ public Identity setObjectClasses(@NotNull String ... objectClasses) {
this.objectClasses = objectClasses;
filterTemplate = null;
memberOfFilterTemplate = null;
@@ -507,7 +505,7 @@ public class LdapProviderConfig {
* @return the id attribute name
* @see #getSearchFilter(String) for more detail about searching and
filtering
*/
- @Nonnull
+ @NotNull
public String getIdAttribute() {
return idAttribute;
}
@@ -518,8 +516,8 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getIdAttribute()
*/
- @Nonnull
- public Identity setIdAttribute(@Nonnull String idAttribute) {
+ @NotNull
+ public Identity setIdAttribute(@NotNull String idAttribute) {
this.idAttribute = idAttribute;
filterTemplate = null;
memberOfFilterTemplate = null;
@@ -532,7 +530,7 @@ public class LdapProviderConfig {
*
* @return the extra filter
*/
- @CheckForNull
+ @Nullable
public String getExtraFilter() {
return extraFilter;
}
@@ -543,7 +541,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getExtraFilter()
*/
- @Nonnull
+ @NotNull
public Identity setExtraFilter(@Nullable String extraFilter) {
this.extraFilter = extraFilter;
filterTemplate = null;
@@ -566,7 +564,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #makeDnPath()
*/
- @Nonnull
+ @NotNull
public Identity setMakeDnPath(boolean makeDnPath) {
this.makeDnPath = makeDnPath;
return this;
@@ -585,8 +583,8 @@ public class LdapProviderConfig {
* @param id the id value
* @return the search filter
*/
- @Nonnull
- public String getSearchFilter(@Nonnull String id) {
+ @NotNull
+ public String getSearchFilter(@NotNull String id) {
if (filterTemplate == null) {
StringBuilder filter = new StringBuilder("(&(")
.append(idAttribute)
@@ -650,7 +648,7 @@ public class LdapProviderConfig {
* @param maxActive the new upper limit of the pool size
* @return this
*/
- @Nonnull
+ @NotNull
public PoolConfig setMaxActive(int maxActive) {
this.maxActiveSize = maxActive;
return this;
@@ -674,7 +672,7 @@ public class LdapProviderConfig {
* @param lookupOnValidate the new value of the lookup on validate flag
* @return this
*/
- @Nonnull
+ @NotNull
public PoolConfig setLookupOnValidate(boolean lookupOnValidate) {
this.lookupOnValidate = lookupOnValidate;
return this;
@@ -791,7 +789,7 @@ public class LdapProviderConfig {
*
* @return the name.
*/
- @Nonnull
+ @NotNull
public String getName() {
return name;
}
@@ -802,8 +800,8 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getName()
*/
- @Nonnull
- public LdapProviderConfig setName(@Nonnull String name) {
+ @NotNull
+ public LdapProviderConfig setName(@NotNull String name) {
this.name = name;
return this;
}
@@ -814,7 +812,7 @@ public class LdapProviderConfig {
*
* @return the hostname
*/
- @Nonnull
+ @NotNull
public String getHostname() {
return hostname;
}
@@ -825,8 +823,8 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getHostname()
*/
- @Nonnull
- public LdapProviderConfig setHostname(@Nonnull String hostname) {
+ @NotNull
+ public LdapProviderConfig setHostname(@NotNull String hostname) {
this.hostname = hostname;
return this;
}
@@ -847,7 +845,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getPort()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setPort(int port) {
this.port = port;
return this;
@@ -869,7 +867,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #useSSL()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setUseSSL(boolean useSSL) {
this.useSSL = useSSL;
return this;
@@ -891,7 +889,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #useTLS()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setUseTLS(boolean useTLS) {
this.useTLS = useTLS;
return this;
@@ -913,7 +911,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #noCertCheck()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setNoCertCheck(boolean noCertCheck) {
this.noCertCheck = noCertCheck;
return this;
@@ -924,7 +922,7 @@ public class LdapProviderConfig {
* anonymous connections are used.
* @return the bind DN or {@code null}.
*/
- @CheckForNull
+ @Nullable
public String getBindDN() {
return bindDN;
}
@@ -935,7 +933,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getBindDN()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setBindDN(@Nullable String bindDN) {
this.bindDN = bindDN;
return this;
@@ -945,7 +943,7 @@ public class LdapProviderConfig {
* Configures the password that is used to bind to the LDAP server. This
value is not used for anonymous binds.
* @return the password.
*/
- @CheckForNull
+ @Nullable
public String getBindPassword() {
return bindPassword;
}
@@ -956,7 +954,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getBindPassword()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setBindPassword(@Nullable String bindPassword) {
this.bindPassword = bindPassword;
return this;
@@ -978,7 +976,7 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getSearchTimeout()
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setSearchTimeout(long searchTimeout) {
this.searchTimeout = searchTimeout;
return this;
@@ -990,7 +988,7 @@ public class LdapProviderConfig {
*
* @return the group member attribute
*/
- @Nonnull
+ @NotNull
public String getGroupMemberAttribute() {
return groupMemberAttribute;
}
@@ -1001,8 +999,8 @@ public class LdapProviderConfig {
* @return {@code this}
* @see #getGroupMemberAttribute()
*/
- @Nonnull
- public LdapProviderConfig setGroupMemberAttribute(@Nonnull String
groupMemberAttribute) {
+ @NotNull
+ public LdapProviderConfig setGroupMemberAttribute(@NotNull String
groupMemberAttribute) {
this.groupMemberAttribute = groupMemberAttribute;
return this;
}
@@ -1012,7 +1010,7 @@ public class LdapProviderConfig {
*
* @return true iff the value of the user id (resp. group name) attribute
will be used to create external identifiers
*/
- @Nonnull
+ @NotNull
public boolean getUseUidForExtId() {
return useUidForExtId;
}
@@ -1024,7 +1022,7 @@ public class LdapProviderConfig {
* @param useUidForExtId the new value of #useUidForExtId
* @return {@code this}
*/
- @Nonnull
+ @NotNull
public LdapProviderConfig setUseUidForExtId(boolean useUidForExtId) {
this.useUidForExtId = useUidForExtId;
return this;
@@ -1036,7 +1034,7 @@ public class LdapProviderConfig {
*
* @return an array of attribute names. The empty array indicates that all
attributes will be retrieved.
*/
- @Nonnull
+ @NotNull
public String[] getCustomAttributes() {
return customAttributes;
}
@@ -1047,8 +1045,8 @@ public class LdapProviderConfig {
* @param customAttributes an array of attribute names
* @return the Identity instance
*/
- @Nonnull
- public LdapProviderConfig setCustomAttributes(@Nonnull String[]
customAttributes) {
+ @NotNull
+ public LdapProviderConfig setCustomAttributes(@NotNull String[]
customAttributes) {
this.customAttributes = this.removeEmptyStrings(customAttributes);
return this;
}
@@ -1067,7 +1065,7 @@ public class LdapProviderConfig {
* @param dn the dn of the identity to search for
* @return the search filter
*/
- public String getMemberOfSearchFilter(@Nonnull String dn) {
+ public String getMemberOfSearchFilter(@NotNull String dn) {
if (memberOfFilterTemplate == null) {
StringBuilder filter = new StringBuilder("(&(")
.append(groupMemberAttribute)
@@ -1090,7 +1088,7 @@ public class LdapProviderConfig {
* Returns the user specific configuration.
* @return the user config.
*/
- @Nonnull
+ @NotNull
public Identity getUserConfig() {
return userConfig;
}
@@ -1099,7 +1097,7 @@ public class LdapProviderConfig {
* Returns the group specific configuration.
* @return the groups config.
*/
- @Nonnull
+ @NotNull
public Identity getGroupConfig() {
return groupConfig;
}
@@ -1108,7 +1106,7 @@ public class LdapProviderConfig {
* Returns the admin connection pool configuration.
* @return admin pool config
*/
- @Nonnull
+ @NotNull
public PoolConfig getAdminPoolConfig() {
return adminPoolConfig;
}
@@ -1117,7 +1115,7 @@ public class LdapProviderConfig {
* Returns the user connection pool configuration.
* @return user pool config
*/
- @Nonnull
+ @NotNull
public PoolConfig getUserPoolConfig() {
return userPoolConfig;
}
@@ -1175,7 +1173,7 @@ public class LdapProviderConfig {
}
//OAK-5490
- private String[] removeEmptyStrings(@Nonnull String[] params) {
+ private String[] removeEmptyStrings(@NotNull String[] params) {
List<String> list = Arrays.asList(params);
if (!list.contains(Strings.EMPTY_STRING)) {
return params;