create LDAP API

This commit is contained in:
Jörg Prante 2024-08-06 13:56:33 +02:00
parent bdb39ae448
commit 644b28b1ee
356 changed files with 1451 additions and 1537 deletions

View file

@ -114,7 +114,7 @@ public class DERPath {
continue;
}
// Normalize node names to upper case
nodeStack.add(toNode(LdapUtils.toUpperCaseAscii(node)));
nodeStack.add(toNode(Utils.toUpperCaseAscii(node)));
}
}
@ -207,7 +207,7 @@ public class DERPath {
return true;
}
if (o instanceof DERPath v) {
return LdapUtils.areEqual(
return Utils.areEqual(
nodeStack != null ? nodeStack.toArray() : null,
v.nodeStack != null ? v.nodeStack.toArray() : null);
}
@ -312,8 +312,8 @@ public class DERPath {
return true;
}
if (o instanceof Node v) {
return LdapUtils.areEqual(name, v.name) &&
LdapUtils.areEqual(childIndex, v.childIndex);
return Utils.areEqual(name, v.name) &&
Utils.areEqual(childIndex, v.childIndex);
}
return false;
}

View file

@ -1,508 +0,0 @@
package org.xbib.asn1;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Queue;
import java.util.regex.Pattern;
/**
* Provides utility methods for this package.
*
*/
public final class LdapUtils {
/**
* Size of buffer in bytes to use when reading files.
*/
private static final int READ_BUFFER_SIZE = 128;
/**
* Prime number to assist in calculating hash codes.
*/
private static final int HASH_CODE_PRIME = 113;
/**
* Pattern to match ipv4 addresses.
*/
private static final Pattern IPV4_PATTERN = Pattern.compile(
"^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)" +
"(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$");
/**
* Pattern to match ipv6 addresses.
*/
private static final Pattern IPV6_STD_PATTERN = Pattern.compile("^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$");
/**
* Pattern to match ipv6 hex compressed addresses.
*/
private static final Pattern IPV6_HEX_COMPRESSED_PATTERN = Pattern.compile(
"^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::" +
"((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$");
/**
* Pattern that matches control characters.
*/
private static final Pattern CNTRL_PATTERN = Pattern.compile("\\p{Cntrl}");
/**
* Default constructor.
*/
private LdapUtils() {
}
/**
* This will convert the supplied value to a base64 encoded string. Returns null if the supplied byte array is null.
*
* @param value to base64 encode
* @return base64 encoded value
*/
public static String base64Encode(final byte... value) {
return value != null ? new String(Base64.getEncoder().encode(value), StandardCharsets.UTF_8) : null;
}
/**
* This will convert the supplied value to a base64 encoded string. Returns null if the supplied string is null.
*
* @param value to base64 encode
* @return base64 encoded value
*/
public static String base64Encode(final String value) {
return value != null ? base64Encode(value.getBytes(StandardCharsets.UTF_8)) : null;
}
/**
* This will convert the supplied value to a UTF-8 encoded string. Returns null if the supplied byte array is null.
*
* @param value to UTF-8 encode
* @return UTF-8 encoded value
*/
public static String utf8Encode(final byte[] value) {
return utf8Encode(value, true);
}
/**
* This will convert the supplied value to a UTF-8 encoded string.
*
* @param value to UTF-8 encode
* @param allowNull whether to throw {@link NullPointerException} if value is null
* @return UTF-8 encoded value
* @throws NullPointerException if allowNull is false and value is null
*/
public static String utf8Encode(final byte[] value, final boolean allowNull) {
if (!allowNull && value == null) {
throw new NullPointerException("Cannot UTF-8 encode null value");
}
return value != null ? new String(value, StandardCharsets.UTF_8) : null;
}
/**
* This will convert the supplied value to a UTF-8 encoded byte array. Returns null if the supplied string is null.
*
* @param value to UTF-8 encode
* @return UTF-8 encoded value
*/
public static byte[] utf8Encode(final String value) {
return utf8Encode(value, true);
}
/**
* This will convert the supplied value to a UTF-8 encoded byte array.
*
* @param value to UTF-8 encode
* @param allowNull whether to throw {@link NullPointerException} if value is null
* @return UTF-8 encoded value
* @throws NullPointerException if allowNull is false and value is null
*/
public static byte[] utf8Encode(final String value, final boolean allowNull) {
if (!allowNull && value == null) {
throw new NullPointerException("Cannot UTF-8 encode null value");
}
return value != null ? value.getBytes(StandardCharsets.UTF_8) : null;
}
/**
* Removes the space character from both the beginning and end of the supplied value.
*
* @param value to trim space character from
* @return trimmed value or same value if no trim was performed
*/
public static String trimSpace(final String value) {
if (value == null || value.isEmpty()) {
return value;
}
int startIndex = 0;
int endIndex = value.length();
while (startIndex < endIndex && value.charAt(startIndex) == ' ') {
startIndex++;
}
while (startIndex < endIndex && value.charAt(endIndex - 1) == ' ') {
endIndex--;
}
if (startIndex == 0 && endIndex == value.length()) {
return value;
}
return value.substring(startIndex, endIndex);
}
/**
* Changes the supplied value by replacing multiple spaces with a single space.
*
* @param value to compress spaces
* @param trim whether to remove any leading or trailing space characters
* @return normalized value or value if no compress was performed
*/
public static String compressSpace(final String value, final boolean trim) {
if (value == null || value.isEmpty()) {
return value;
}
final StringBuilder sb = new StringBuilder();
boolean foundSpace = false;
for (int i = 0; i < value.length(); i++) {
final char ch = value.charAt(i);
if (ch == ' ') {
if (i == value.length() - 1) {
// last char is a space
sb.append(ch);
}
foundSpace = true;
} else {
if (foundSpace) {
sb.append(' ');
}
sb.append(ch);
foundSpace = false;
}
}
if (sb.length() == 0 && foundSpace) {
return trim ? "" : " ";
}
if (trim) {
if (sb.length() > 0 && sb.charAt(0) == ' ') {
sb.deleteCharAt(0);
}
if (sb.length() > 0 && sb.charAt(sb.length() - 1) == ' ') {
sb.deleteCharAt(sb.length() - 1);
}
}
return sb.toString();
}
/**
* This will decode the supplied value as a base64 encoded string to a byte[]. Returns null if the supplied string is
* null.
*
* @param value to base64 decode
* @return base64 decoded value
*/
public static byte[] base64Decode(final String value) {
try {
return value != null ? Base64.getDecoder().decode(value.getBytes(StandardCharsets.UTF_8)) : null;
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Error decoding value: " + value, e);
}
}
/**
* Converts the supplied string to lower case. If the string contains non-ascii characters, {@link Locale#ROOT} is
* used.
*
* @param s to lower case
* @return new lower case string
*/
public static String toLowerCase(final String s) {
if (s == null || s.isEmpty()) {
return s;
}
// CheckStyle:MagicNumber OFF
// if string contains non-ascii, use locale specific lowercase
if (s.chars().anyMatch(c -> c > 0x7F)) {
return s.toLowerCase(Locale.ROOT);
}
return toLowerCaseAscii(s);
}
/**
* Converts the characters A-Z to a-z.
*
* @param s to lower case
* @return new string with lower case alphabetical characters
* @throws IllegalArgumentException if the supplied string contains non-ascii characters
*/
public static String toLowerCaseAscii(final String s) {
if (s == null || s.isEmpty()) {
return s;
}
// mutate A-Z to a-z
// CheckStyle:MagicNumber OFF
final char[] chars = s.toCharArray();
for (int i = 0; i < chars.length; i++) {
if (chars[i] > 0x7F) {
throw new IllegalArgumentException("String contains non-ascii characters: " + s);
} else if (chars[i] >= 'A' && chars[i] <= 'Z') {
chars[i] = (char) (chars[i] + 32);
}
}
// CheckStyle:MagicNumber ON
return new String(chars);
}
/**
* Converts the supplied string to upper case. If the string contains non-ascii characters, {@link Locale#ROOT} is
* used.
*
* @param s to upper case
* @return new upper case string
*/
public static String toUpperCase(final String s) {
if (s == null || s.isEmpty()) {
return s;
}
// CheckStyle:MagicNumber OFF
// if string contains non-ascii, use locale specific uppercase
if (s.chars().anyMatch(c -> c > 0x7F)) {
return s.toUpperCase(Locale.ROOT);
}
return toUpperCaseAscii(s);
}
/**
* Converts the characters a-z to A-Z.
*
* @param s to upper case
* @return new string with upper case alphabetical characters
* @throws IllegalArgumentException if the supplied string contains non-ascii characters
*/
public static String toUpperCaseAscii(final String s) {
if (s == null || s.isEmpty()) {
return s;
}
// mutate a-z to A-Z
// CheckStyle:MagicNumber OFF
final char[] chars = s.toCharArray();
for (int i = 0; i < chars.length; i++) {
if (chars[i] > 0x7F) {
throw new IllegalArgumentException("String contains non-ascii characters: " + s);
} else if (chars[i] >= 'a' && chars[i] <= 'z') {
chars[i] = (char) (chars[i] - 32);
}
}
// CheckStyle:MagicNumber ON
return new String(chars);
}
/**
* Reads the data in the supplied stream and returns it as a byte array.
*
* @param is stream to read
* @return bytes read from the stream
* @throws IOException if an error occurs reading data
*/
public static byte[] readInputStream(final InputStream is)
throws IOException {
final ByteArrayOutputStream data = new ByteArrayOutputStream();
try (is; data) {
final byte[] buffer = new byte[READ_BUFFER_SIZE];
int length;
while ((length = is.read(buffer)) != -1) {
data.write(buffer, 0, length);
}
}
return data.toByteArray();
}
/**
* Concatenates multiple arrays together.
*
* @param <T> type of array
* @param first array to concatenate. Cannot be null.
* @param rest of the arrays to concatenate. May be null.
* @return array containing the concatenation of all parameters
*/
@SuppressWarnings("unchecked")
public static <T> T[] concatArrays(final T[] first, final T[]... rest) {
int totalLength = first.length;
for (T[] array : rest) {
if (array != null) {
totalLength += array.length;
}
}
final T[] result = Arrays.copyOf(first, totalLength);
int offset = first.length;
for (T[] array : rest) {
if (array != null) {
System.arraycopy(array, 0, result, offset, array.length);
offset += array.length;
}
}
return result;
}
/**
* Determines equality of the supplied objects. Array types are automatically detected.
*
* @param o1 to test equality of
* @param o2 to test equality of
* @return whether o1 equals o2
*/
public static boolean areEqual(final Object o1, final Object o2) {
if (o1 == o2) {
return true;
}
final boolean areEqual;
if (o1 instanceof boolean[] && o2 instanceof boolean[]) {
areEqual = Arrays.equals((boolean[]) o1, (boolean[]) o2);
} else if (o1 instanceof byte[] && o2 instanceof byte[]) {
areEqual = Arrays.equals((byte[]) o1, (byte[]) o2);
} else if (o1 instanceof char[] && o2 instanceof char[]) {
areEqual = Arrays.equals((char[]) o1, (char[]) o2);
} else if (o1 instanceof double[] && o2 instanceof double[]) {
areEqual = Arrays.equals((double[]) o1, (double[]) o2);
} else if (o1 instanceof float[] && o2 instanceof float[]) {
areEqual = Arrays.equals((float[]) o1, (float[]) o2);
} else if (o1 instanceof int[] && o2 instanceof int[]) {
areEqual = Arrays.equals((int[]) o1, (int[]) o2);
} else if (o1 instanceof long[] && o2 instanceof long[]) {
areEqual = Arrays.equals((long[]) o1, (long[]) o2);
} else if (o1 instanceof short[] && o2 instanceof short[]) {
areEqual = Arrays.equals((short[]) o1, (short[]) o2);
} else if (o1 instanceof Object[] && o2 instanceof Object[]) {
areEqual = Arrays.deepEquals((Object[]) o1, (Object[]) o2);
} else {
areEqual = o1 != null && o1.equals(o2);
}
return areEqual;
}
/**
* Computes a hash code for the supplied objects using the supplied seed. If a Collection type is found it is iterated
* over.
*
* @param seed odd/prime number
* @param objects to calculate hashCode for
* @return hash code for the supplied objects
*/
public static int computeHashCode(final int seed, final Object... objects) {
if (objects == null || objects.length == 0) {
return seed * HASH_CODE_PRIME;
}
int hc = seed;
for (Object object : objects) {
hc = HASH_CODE_PRIME * hc;
if (object != null) {
if (object instanceof List<?> || object instanceof Queue<?>) {
int index = 1;
for (Object o : (Collection<?>) object) {
hc += computeHashCode(o) * index++;
}
} else if (object instanceof Collection<?>) {
for (Object o : (Collection<?>) object) {
hc += computeHashCode(o);
}
} else {
hc += computeHashCode(object);
}
}
}
return hc;
}
/**
* Computes a hash code for the supplied object. Checks for arrays of primitives and Objects then delegates to the
* {@link Arrays} class. Otherwise {@link Object#hashCode()} is invoked.
*
* @param object to calculate hash code for
* @return hash code
*/
private static int computeHashCode(final Object object) {
int hc = 0;
if (object instanceof boolean[]) {
hc += Arrays.hashCode((boolean[]) object);
} else if (object instanceof byte[]) {
hc += Arrays.hashCode((byte[]) object);
} else if (object instanceof char[]) {
hc += Arrays.hashCode((char[]) object);
} else if (object instanceof double[]) {
hc += Arrays.hashCode((double[]) object);
} else if (object instanceof float[]) {
hc += Arrays.hashCode((float[]) object);
} else if (object instanceof int[]) {
hc += Arrays.hashCode((int[]) object);
} else if (object instanceof long[]) {
hc += Arrays.hashCode((long[]) object);
} else if (object instanceof short[]) {
hc += Arrays.hashCode((short[]) object);
} else if (object instanceof Object[]) {
hc += Arrays.deepHashCode((Object[]) object);
} else {
hc += object.hashCode();
}
return hc;
}
/**
* Returns whether the supplied string represents an IP address. Matches both IPv4 and IPv6 addresses.
*
* @param s to match
* @return whether the supplied string represents an IP address
*/
public static boolean isIPAddress(final String s) {
return
s != null &&
(IPV4_PATTERN.matcher(s).matches() || IPV6_STD_PATTERN.matcher(s).matches() ||
IPV6_HEX_COMPRESSED_PATTERN.matcher(s).matches());
}
/**
* Looks for the supplied system property value and loads a class with that name. The default constructor for that
* class is then returned.
*
* @param property whose value is a class
* @return class constructor or null if no system property was found
* @throws IllegalArgumentException if an error occurs instantiating the constructor
*/
public static Constructor<?> createConstructorFromProperty(final String property) {
final String clazz = System.getProperty(property);
if (clazz != null) {
try {
return Class.forName(clazz).getDeclaredConstructor();
} catch (Exception e) {
throw new IllegalArgumentException("Error getting declared constructor for " + clazz, e);
}
}
return null;
}
}

View file

@ -19,7 +19,7 @@ public class OctetStringType extends AbstractDERType implements DEREncoder {
* @param item to DER encode
*/
public OctetStringType(final String item) {
this(LdapUtils.utf8Encode(item, false));
this(Utils.utf8Encode(item, false));
}
@ -42,7 +42,7 @@ public class OctetStringType extends AbstractDERType implements DEREncoder {
* @throws IllegalArgumentException if the der tag is constructed
*/
public OctetStringType(final DERTag tag, final String item) {
this(tag, LdapUtils.utf8Encode(item, false));
this(tag, Utils.utf8Encode(item, false));
}
@ -70,7 +70,7 @@ public class OctetStringType extends AbstractDERType implements DEREncoder {
* @return decoded bytes as an string
*/
public static String decode(final DERBuffer encoded) {
return LdapUtils.utf8Encode(encoded.getRemainingBytes(), false);
return Utils.utf8Encode(encoded.getRemainingBytes(), false);
}
/**
@ -80,7 +80,7 @@ public class OctetStringType extends AbstractDERType implements DEREncoder {
* @return byte array
*/
public static byte[] toBytes(final String s) {
return LdapUtils.utf8Encode(s, false);
return Utils.utf8Encode(s, false);
}
@Override

View file

@ -0,0 +1,241 @@
package org.xbib.asn1;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collection;
import java.util.List;
import java.util.Queue;
/**
* Provides utility methods for this package.
*
*/
public final class Utils {
/**
* Prime number to assist in calculating hash codes.
*/
private static final int HASH_CODE_PRIME = 113;
/**
* Default constructor.
*/
private Utils() {
}
/**
* This will convert the supplied value to a base64 encoded string. Returns null if the supplied byte array is null.
*
* @param value to base64 encode
* @return base64 encoded value
*/
public static String base64Encode(final byte... value) {
return value != null ? new String(Base64.getEncoder().encode(value), StandardCharsets.UTF_8) : null;
}
/**
* This will convert the supplied value to a base64 encoded string. Returns null if the supplied string is null.
*
* @param value to base64 encode
* @return base64 encoded value
*/
public static String base64Encode(final String value) {
return value != null ? base64Encode(value.getBytes(StandardCharsets.UTF_8)) : null;
}
/**
* This will convert the supplied value to a UTF-8 encoded string. Returns null if the supplied byte array is null.
*
* @param value to UTF-8 encode
* @return UTF-8 encoded value
*/
public static String utf8Encode(final byte[] value) {
return utf8Encode(value, true);
}
/**
* This will convert the supplied value to a UTF-8 encoded string.
*
* @param value to UTF-8 encode
* @param allowNull whether to throw {@link NullPointerException} if value is null
* @return UTF-8 encoded value
* @throws NullPointerException if allowNull is false and value is null
*/
public static String utf8Encode(final byte[] value, final boolean allowNull) {
if (!allowNull && value == null) {
throw new NullPointerException("Cannot UTF-8 encode null value");
}
return value != null ? new String(value, StandardCharsets.UTF_8) : null;
}
/**
* This will convert the supplied value to a UTF-8 encoded byte array. Returns null if the supplied string is null.
*
* @param value to UTF-8 encode
* @return UTF-8 encoded value
*/
public static byte[] utf8Encode(final String value) {
return utf8Encode(value, true);
}
/**
* This will convert the supplied value to a UTF-8 encoded byte array.
*
* @param value to UTF-8 encode
* @param allowNull whether to throw {@link NullPointerException} if value is null
* @return UTF-8 encoded value
* @throws NullPointerException if allowNull is false and value is null
*/
public static byte[] utf8Encode(final String value, final boolean allowNull) {
if (!allowNull && value == null) {
throw new NullPointerException("Cannot UTF-8 encode null value");
}
return value != null ? value.getBytes(StandardCharsets.UTF_8) : null;
}
/**
* Converts the characters a-z to A-Z.
*
* @param s to upper case
* @return new string with upper case alphabetical characters
* @throws IllegalArgumentException if the supplied string contains non-ascii characters
*/
public static String toUpperCaseAscii(final String s) {
if (s == null || s.isEmpty()) {
return s;
}
// mutate a-z to A-Z
// CheckStyle:MagicNumber OFF
final char[] chars = s.toCharArray();
for (int i = 0; i < chars.length; i++) {
if (chars[i] > 0x7F) {
throw new IllegalArgumentException("String contains non-ascii characters: " + s);
} else if (chars[i] >= 'a' && chars[i] <= 'z') {
chars[i] = (char) (chars[i] - 32);
}
}
// CheckStyle:MagicNumber ON
return new String(chars);
}
/**
* Concatenates multiple arrays together.
*
* @param <T> type of array
* @param first array to concatenate. Cannot be null.
* @param rest of the arrays to concatenate. May be null.
* @return array containing the concatenation of all parameters
*/
@SuppressWarnings("unchecked")
public static <T> T[] concatArrays(final T[] first, final T[]... rest) {
int totalLength = first.length;
for (T[] array : rest) {
if (array != null) {
totalLength += array.length;
}
}
final T[] result = Arrays.copyOf(first, totalLength);
int offset = first.length;
for (T[] array : rest) {
if (array != null) {
System.arraycopy(array, 0, result, offset, array.length);
offset += array.length;
}
}
return result;
}
/**
* Determines equality of the supplied objects. Array types are automatically detected.
*
* @param o1 to test equality of
* @param o2 to test equality of
* @return whether o1 equals o2
*/
public static boolean areEqual(final Object o1, final Object o2) {
if (o1 == o2) {
return true;
}
return switch (o1) {
case boolean[] booleans when o2 instanceof boolean[] -> Arrays.equals(booleans, (boolean[]) o2);
case byte[] bytes when o2 instanceof byte[] -> Arrays.equals(bytes, (byte[]) o2);
case char[] chars when o2 instanceof char[] -> Arrays.equals(chars, (char[]) o2);
case double[] doubles when o2 instanceof double[] -> Arrays.equals(doubles, (double[]) o2);
case float[] floats when o2 instanceof float[] -> Arrays.equals(floats, (float[]) o2);
case int[] ints when o2 instanceof int[] -> Arrays.equals(ints, (int[]) o2);
case long[] longs when o2 instanceof long[] -> Arrays.equals(longs, (long[]) o2);
case short[] shorts when o2 instanceof short[] -> Arrays.equals(shorts, (short[]) o2);
case Object[] objects when o2 instanceof Object[] -> Arrays.deepEquals(objects, (Object[]) o2);
case null, default -> o1 != null && o1.equals(o2);
};
}
/**
* Computes a hash code for the supplied objects using the supplied seed. If a Collection type is found it is iterated
* over.
*
* @param seed odd/prime number
* @param objects to calculate hashCode for
* @return hash code for the supplied objects
*/
public static int computeHashCode(final int seed, final Object... objects) {
if (objects == null || objects.length == 0) {
return seed * HASH_CODE_PRIME;
}
int hc = seed;
for (Object object : objects) {
hc = HASH_CODE_PRIME * hc;
if (object != null) {
if (object instanceof List<?> || object instanceof Queue<?>) {
int index = 1;
for (Object o : (Collection<?>) object) {
hc += computeHashCode(o) * index++;
}
} else if (object instanceof Collection<?>) {
for (Object o : (Collection<?>) object) {
hc += computeHashCode(o);
}
} else {
hc += computeHashCode(object);
}
}
}
return hc;
}
/**
* Computes a hash code for the supplied object. Checks for arrays of primitives and Objects then delegates to the
* {@link Arrays} class. Otherwise {@link Object#hashCode()} is invoked.
*
* @param object to calculate hash code for
* @return hash code
*/
private static int computeHashCode(final Object object) {
int hc = 0;
switch (object) {
case boolean[] booleans -> hc += Arrays.hashCode(booleans);
case byte[] bytes -> hc += Arrays.hashCode(bytes);
case char[] chars -> hc += Arrays.hashCode(chars);
case double[] doubles -> hc += Arrays.hashCode(doubles);
case float[] floats -> hc += Arrays.hashCode(floats);
case int[] ints -> hc += Arrays.hashCode(ints);
case long[] longs -> hc += Arrays.hashCode(longs);
case short[] shorts -> hc += Arrays.hashCode(shorts);
case Object[] objects -> hc += Arrays.deepHashCode(objects);
case null -> hc += 0;
default -> hc += object.hashCode();
}
return hc;
}
}

View file

@ -0,0 +1,3 @@
dependencies {
api project(':asn1')
}

View file

@ -0,0 +1,11 @@
module org.xbib.net.ldap.api {
requires org.xbib.net.ldap.asnone;
exports org.xbib.net.ldap.api;
exports org.xbib.net.ldap.api.ad.control;
exports org.xbib.net.ldap.api.auth;
exports org.xbib.net.ldap.api.control;
exports org.xbib.net.ldap.api.dn;
exports org.xbib.net.ldap.api.extended;
exports org.xbib.net.ldap.api.filter;
exports org.xbib.net.ldap.api.handler;
}

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.ApplicationDERTag;
import org.xbib.asn1.DEREncoder;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Provides common implementations for configuration objects.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.ArrayList;
import java.util.Collections;
@ -12,8 +12,8 @@ import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.control.ControlFactory;
import org.xbib.net.ldap.control.ResponseControl;
import org.xbib.net.ldap.api.control.ControlFactory;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* LDAP message envelope defined as:

View file

@ -1,15 +1,15 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.Arrays;
import org.xbib.net.ldap.handler.ExceptionHandler;
import org.xbib.net.ldap.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.handler.ReferralHandler;
import org.xbib.net.ldap.handler.RequestHandler;
import org.xbib.net.ldap.handler.ResponseControlHandler;
import org.xbib.net.ldap.handler.ResultHandler;
import org.xbib.net.ldap.handler.ResultPredicate;
import org.xbib.net.ldap.handler.UnsolicitedNotificationHandler;
import org.xbib.net.ldap.api.handler.ExceptionHandler;
import org.xbib.net.ldap.api.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.api.handler.ReferralHandler;
import org.xbib.net.ldap.api.handler.RequestHandler;
import org.xbib.net.ldap.api.handler.ResponseControlHandler;
import org.xbib.net.ldap.api.handler.ResultHandler;
import org.xbib.net.ldap.api.handler.ResultPredicate;
import org.xbib.net.ldap.api.handler.UnsolicitedNotificationHandler;
/**
* Base class for operations.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.time.Duration;
import java.util.Arrays;
@ -9,7 +9,7 @@ import org.xbib.asn1.ContextDERTag;
import org.xbib.asn1.DEREncoder;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.control.RequestControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* LDAP message envelope defined as:

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.ArrayList;
import java.util.Collections;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.time.Instant;
import java.util.concurrent.atomic.AtomicInteger;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.Arrays;
import java.util.Collection;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* LDAP modification defined as:

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* LDAP bind request defined as:
@ -22,7 +22,6 @@ package org.xbib.net.ldap;
* </pre>
*
*/
// CheckStyle:InterfaceIsType OFF
public interface BindRequest extends Request {
/**
@ -35,4 +34,3 @@ public interface BindRequest extends Request {
*/
int VERSION = 3;
}
// CheckStyle:InterfaceIsType ON

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;

View file

@ -1,15 +1,15 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.net.ldap.handler.CompareValueHandler;
import org.xbib.net.ldap.handler.CompleteHandler;
import org.xbib.net.ldap.handler.ExceptionHandler;
import org.xbib.net.ldap.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.handler.ReferralHandler;
import org.xbib.net.ldap.handler.ResponseControlHandler;
import org.xbib.net.ldap.handler.ResultHandler;
import org.xbib.net.ldap.handler.ResultPredicate;
import org.xbib.net.ldap.handler.UnsolicitedNotificationHandler;
import org.xbib.net.ldap.api.handler.CompareValueHandler;
import org.xbib.net.ldap.api.handler.CompleteHandler;
import org.xbib.net.ldap.api.handler.ExceptionHandler;
import org.xbib.net.ldap.api.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.api.handler.ReferralHandler;
import org.xbib.net.ldap.api.handler.ResponseControlHandler;
import org.xbib.net.ldap.api.handler.ResultHandler;
import org.xbib.net.ldap.api.handler.ResultPredicate;
import org.xbib.net.ldap.api.handler.UnsolicitedNotificationHandler;
/**
* Handle that notifies on the components of a compare request.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.ApplicationDERTag;
import org.xbib.asn1.ConstructedDEREncoder;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;

View file

@ -1,15 +1,14 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.net.ldap.control.RequestControl;
import org.xbib.net.ldap.extended.ExtendedOperationHandle;
import org.xbib.net.ldap.extended.ExtendedRequest;
import org.xbib.net.ldap.sasl.DefaultSaslClientRequest;
import org.xbib.net.ldap.sasl.SaslClientRequest;
import org.xbib.net.ldap.api.control.RequestControl;
import org.xbib.net.ldap.api.extended.ExtendedOperationHandle;
import org.xbib.net.ldap.api.extended.ExtendedRequest;
//import org.xbib.net.ldap.sasl.DefaultSaslClientRequest;
//import org.xbib.net.ldap.sasl.SaslClientRequest;
/**
* Interface for connection implementations.
*
*/
public interface Connection extends AutoCloseable {
@ -102,7 +101,7 @@ public interface Connection extends AutoCloseable {
* @return operation result
* @throws LdapException if the operation fails or another bind is in progress
*/
BindResponse operation(SaslClientRequest request) throws LdapException;
//BindResponse operation(SaslClientRequest request) throws LdapException;
/**
@ -113,7 +112,7 @@ public interface Connection extends AutoCloseable {
* @return operation result
* @throws LdapException if the operation fails or another bind is in progress
*/
BindResponse operation(DefaultSaslClientRequest request) throws LdapException;
//BindResponse operation(DefaultSaslClientRequest request) throws LdapException;
/**

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Interface for connection factories.
@ -14,8 +14,7 @@ public interface ConnectionFactory {
* @return connection
* @throws LdapException if a connection cannot be returned
*/
Connection getConnection()
throws LdapException;
Connection getConnection() throws LdapException;
/**
@ -23,7 +22,7 @@ public interface ConnectionFactory {
*
* @return connection config
*/
ConnectionConfig getConnectionConfig();
//ConnectionConfig getConnectionConfig();
/**

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.function.Predicate;
@ -16,8 +16,8 @@ public interface ConnectionStrategy extends Iterable<LdapURL> {
*
* @param urls Space-delimited string of URLs describing the LDAP hosts to connect to. The URLs in the string
* are commonly {@code ldap://} or {@code ldaps://} URLs that directly describe the hosts to connect to,
* but may also describe a resource from which to obtain LDAP connection URLs as is the case for
* {@link DnsSrvConnectionStrategy} that use URLs with the scheme {@code dns:}.
* but may also describe a resource from which to obtain LDAP connection URLs
* that use URLs with the scheme {@code dns:}.
* @param urlSet LDAP URL set to populate.
*/
void populate(String urls, LdapURLSet urlSet);

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.ApplicationDERTag;
import org.xbib.asn1.DEREncoder;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Enum to define how aliases are dereferenced.

View file

@ -1,10 +1,10 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.xbib.net.ldap.filter.FilterUtils;
import org.xbib.net.ldap.api.filter.FilterUtils;
/**
* Class for producing an LDAP search filter from a filter template. Templates can use either index based parameters or

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.io;
package org.xbib.net.ldap.api;
import java.util.Arrays;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.nio.ByteBuffer;
import java.util.Arrays;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@ -16,7 +16,7 @@ import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.dn.Dn;
import org.xbib.net.ldap.api.dn.Dn;
/**
* LDAP search result entry defined as:
@ -221,7 +221,7 @@ public class LdapEntry extends AbstractMessage {
}
/**
* Returns the parsed ldap DN. Parsing is performed using {@link org.xbib.net.ldap.dn.DefaultDnParser}.
* Returns the parsed ldap DN.
*
* @return parsed ldap DN or null if {@link #ldapDn} is null or could not be parsed
*/
@ -230,8 +230,7 @@ public class LdapEntry extends AbstractMessage {
}
/**
* Returns the normalized ldap DN. Normalization is performed using {@link org.xbib.net.ldap.dn.DefaultRDnNormalizer}.
*
* Returns the normalized ldap DN.
* @return normalized ldap DN or null if {@link #ldapDn} is null or could not be parsed
*/
public String getNormalizedDn() {

View file

@ -1,23 +1,18 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Base exception for all ldap related exceptions.
*
*/
@SuppressWarnings("serial")
public class LdapException extends Exception {
/**
* serialVersionUID.
*/
private static final long serialVersionUID = 6812614366508784841L;
/**
* Optional result code associated with this exception.
*/
private final ResultCode resultCode;
/**
* Creates a new ldap exception based on the supplied result.
*

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.net.InetAddress;
import java.util.Arrays;
@ -367,7 +367,7 @@ public class LdapURL {
*
* @return metadata describing retry attempts for connections made this URL.
*/
LdapURLRetryMetadata getRetryMetadata() {
public LdapURLRetryMetadata getRetryMetadata() {
return retryMetadata;
}
@ -376,7 +376,7 @@ public class LdapURL {
*
* @param metadata retry metadata
*/
void setRetryMetadata(final LdapURLRetryMetadata metadata) {
public void setRetryMetadata(final LdapURLRetryMetadata metadata) {
retryMetadata = metadata;
}
@ -385,21 +385,21 @@ public class LdapURL {
*
* @return true if this URL can be connected to, false otherwise.
*/
boolean isActive() {
public boolean isActive() {
return active;
}
/**
* Marks this URL as active.
*/
void activate() {
public void activate() {
active = true;
}
/**
* Marks this URL as inactive.
*/
void deactivate() {
public void deactivate() {
active = false;
}
@ -417,7 +417,7 @@ public class LdapURL {
*
* @param address IP address for this URL
*/
void setInetAddress(final InetAddress address) {
public void setInetAddress(final InetAddress address) {
inetAddress = address;
}

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Retry metadata used by {@link LdapURL}.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.ArrayList;
import java.util.Collections;
@ -98,7 +98,7 @@ public class LdapURLSet {
*
* @param ldapUrls LDAP URLs to add to this set.
*/
protected synchronized void populate(final List<LdapURL> ldapUrls) {
public synchronized void populate(final List<LdapURL> ldapUrls) {
// Copy activity state from any URLs currently in the set that match new entries
for (LdapURL url : urls) {
final LdapURL match = ldapUrls.stream().filter(u -> u.equals(url)).findFirst().orElse(null);

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@ -14,7 +14,6 @@ import java.util.Locale;
import java.util.Queue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.xbib.net.ldap.io.Hex;
/**
* Provides utility methods for this package.

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.net.ldap.control.ResponseControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* LDAP protocol response.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.ApplicationDERTag;
import org.xbib.asn1.BooleanType;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.Arrays;
import java.util.Collection;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Operation interface.

View file

@ -1,16 +1,16 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.time.Instant;
import org.xbib.net.ldap.extended.ExtendedOperationHandle;
import org.xbib.net.ldap.handler.CompleteHandler;
import org.xbib.net.ldap.handler.ExceptionHandler;
import org.xbib.net.ldap.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.handler.ReferralHandler;
import org.xbib.net.ldap.handler.ResponseControlHandler;
import org.xbib.net.ldap.handler.ResultHandler;
import org.xbib.net.ldap.handler.ResultPredicate;
import org.xbib.net.ldap.handler.UnsolicitedNotificationHandler;
import org.xbib.net.ldap.api.extended.ExtendedOperationHandle;
import org.xbib.net.ldap.api.handler.CompleteHandler;
import org.xbib.net.ldap.api.handler.ExceptionHandler;
import org.xbib.net.ldap.api.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.api.handler.ReferralHandler;
import org.xbib.net.ldap.api.handler.ResponseControlHandler;
import org.xbib.net.ldap.api.handler.ResultHandler;
import org.xbib.net.ldap.api.handler.ResultPredicate;
import org.xbib.net.ldap.api.handler.UnsolicitedNotificationHandler;
/**
* Handle that notifies on the components of an LDAP operation request.
@ -133,7 +133,7 @@ public interface OperationHandle<Q extends Request, S extends Result> {
/**
* Cancels this operation. See {@link org.xbib.net.ldap.extended.CancelRequest}.
* Cancels this operation.
*
* @return extended operation handle
* @throws IllegalStateException if the request has not been sent to the server

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* LDAP protocol request.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* LDAP protocol result.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Enum to define ldap result codes.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.time.Instant;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.Arrays;

View file

@ -1,12 +1,13 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.Arrays;
import org.xbib.net.ldap.filter.Filter;
import org.xbib.net.ldap.filter.FilterParser;
import org.xbib.net.ldap.handler.LdapEntryHandler;
import org.xbib.net.ldap.handler.SearchReferenceHandler;
import org.xbib.net.ldap.handler.SearchResultHandler;
import org.xbib.net.ldap.api.filter.Filter;
import org.xbib.net.ldap.api.filter.FilterParseException;
import org.xbib.net.ldap.api.filter.FilterParser;
import org.xbib.net.ldap.api.handler.LdapEntryHandler;
import org.xbib.net.ldap.api.handler.SearchReferenceHandler;
import org.xbib.net.ldap.api.handler.SearchResultHandler;
/**
* Executes an ldap search operation.
@ -197,7 +198,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
*
* @param filter search filter
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(final String filter)
@ -210,7 +211,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
*
* @param template filter template
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(final FilterTemplate template)
@ -236,7 +237,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param filter search filter
* @param returnAttributes attributes to return
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(final String filter, final String... returnAttributes)
@ -250,7 +251,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param template filter template
* @param returnAttributes attributes to return
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(final FilterTemplate template, final String... returnAttributes)
@ -278,7 +279,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(
@ -296,7 +297,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(
@ -332,7 +333,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(
@ -352,7 +353,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search operation handle
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchOperationHandle send(
@ -439,7 +440,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
*
* @param filter search filter
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(final String filter)
@ -452,7 +453,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
*
* @param template filter template
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(final FilterTemplate template)
@ -478,7 +479,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param filter search filter
* @param returnAttributes attributes to return
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(final String filter, final String... returnAttributes)
@ -492,7 +493,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param template filter template
* @param returnAttributes attributes to return
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(final FilterTemplate template, final String... returnAttributes)
@ -520,7 +521,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(
@ -538,7 +539,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(
@ -574,7 +575,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(
@ -594,7 +595,7 @@ public class SearchOperation extends AbstractOperation<SearchRequest, SearchResp
* @param returnAttributes attributes to return
* @param handlers entry handlers
* @return search result
* @throws org.xbib.net.ldap.filter.FilterParseException if the filter cannot be parsed
* @throws FilterParseException if the filter cannot be parsed
* @throws LdapException if the connection cannot be opened
*/
public SearchResponse execute(

View file

@ -1,17 +1,17 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import org.xbib.net.ldap.handler.CompleteHandler;
import org.xbib.net.ldap.handler.ExceptionHandler;
import org.xbib.net.ldap.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.handler.LdapEntryHandler;
import org.xbib.net.ldap.handler.ReferralHandler;
import org.xbib.net.ldap.handler.ResponseControlHandler;
import org.xbib.net.ldap.handler.ResultHandler;
import org.xbib.net.ldap.handler.ResultPredicate;
import org.xbib.net.ldap.handler.SearchReferenceHandler;
import org.xbib.net.ldap.handler.SearchResultHandler;
import org.xbib.net.ldap.handler.UnsolicitedNotificationHandler;
import org.xbib.net.ldap.api.handler.CompleteHandler;
import org.xbib.net.ldap.api.handler.ExceptionHandler;
import org.xbib.net.ldap.api.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.api.handler.LdapEntryHandler;
import org.xbib.net.ldap.api.handler.ReferralHandler;
import org.xbib.net.ldap.api.handler.ResponseControlHandler;
import org.xbib.net.ldap.api.handler.ResultHandler;
import org.xbib.net.ldap.api.handler.ResultPredicate;
import org.xbib.net.ldap.api.handler.SearchReferenceHandler;
import org.xbib.net.ldap.api.handler.SearchResultHandler;
import org.xbib.net.ldap.api.handler.UnsolicitedNotificationHandler;
/**
* Handle that notifies on the components of a search request.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.time.Duration;
import java.util.Arrays;
@ -12,10 +12,10 @@ import org.xbib.asn1.DEREncoder;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.filter.Filter;
import org.xbib.net.ldap.filter.FilterParseException;
import org.xbib.net.ldap.filter.FilterParser;
import org.xbib.net.ldap.filter.PresenceFilter;
import org.xbib.net.ldap.api.filter.Filter;
import org.xbib.net.ldap.api.filter.FilterParseException;
import org.xbib.net.ldap.api.filter.FilterParser;
import org.xbib.net.ldap.api.filter.PresenceFilter;
/**
* LDAP search request defined as:

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.ArrayList;
import java.util.Collection;
@ -13,7 +13,7 @@ import java.util.stream.Stream;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.net.ldap.dn.Dn;
import org.xbib.net.ldap.api.dn.Dn;
/**
* Response that encapsulates the result elements of a search request. This class formally decodes the SearchResultDone

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
import java.util.ArrayList;
import java.util.Collection;

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap;
package org.xbib.net.ldap.api;
/**
* Enum to define the type of search scope.

View file

@ -1,8 +1,8 @@
package org.xbib.net.ldap.ad.control;
package org.xbib.net.ldap.api.ad.control;
import java.math.BigInteger;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.DERBuffer;
@ -11,9 +11,9 @@ import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.control.AbstractControl;
import org.xbib.net.ldap.control.RequestControl;
import org.xbib.net.ldap.control.ResponseControl;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Request/response control for active directory synchronization. Control is defined as:

View file

@ -1,18 +1,18 @@
package org.xbib.net.ldap.ad.control;
package org.xbib.net.ldap.api.ad.control;
import java.util.HashMap;
import java.util.Map;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.control.AbstractControl;
import org.xbib.net.ldap.control.RequestControl;
import org.xbib.net.ldap.control.ResponseControl;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Request/response control for active directory servers to return statistics along with search results. This

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.auth;
package org.xbib.net.ldap.api.auth;
import java.time.ZonedDateTime;
import java.util.Arrays;

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Base class for ldap controls.

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Request control for authorization identity. See RFC 3829.

View file

@ -1,9 +1,11 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control for authorization identity. See RFC 3829. Control value contains the authorizationId.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
/**
* Marker interface for ldap controls.

View file

@ -1,9 +1,9 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.ad.control.DirSyncControl;
import org.xbib.net.ldap.ad.control.GetStatsControl;
import org.xbib.asn1.DERBuffer;
import org.xbib.net.ldap.api.ad.control.DirSyncControl;
import org.xbib.net.ldap.api.ad.control.GetStatsControl;
/**
* Utility class for creating controls.

View file

@ -1,13 +1,15 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control for persistent search. See http://tools.ietf.org/id/draft-ietf-ldapext-psearch-03.txt. Control is

View file

@ -1,8 +1,11 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.DERBuffer;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* LDAP control defined as:

View file

@ -1,7 +1,9 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for ManageDsaIT. See RFC 3296.

View file

@ -1,17 +1,17 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import java.util.Arrays;
import java.util.stream.Stream;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.DEREncoder;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.filter.ExtensibleFilter;
import org.xbib.net.ldap.filter.Filter;
import org.xbib.net.ldap.filter.FilterParseException;
import org.xbib.net.ldap.filter.FilterParser;
import org.xbib.net.ldap.filter.FilterSet;
import org.xbib.net.ldap.api.filter.ExtensibleFilter;
import org.xbib.net.ldap.api.filter.Filter;
import org.xbib.net.ldap.api.filter.FilterParseException;
import org.xbib.net.ldap.api.filter.FilterParser;
import org.xbib.net.ldap.api.filter.FilterSet;
/**
* Request control for limiting the attribute values returned by a search request.

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.DERBuffer;
@ -10,6 +10,9 @@ import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Request/response control for PagedResults. See RFC 2696. Control is defined as:

View file

@ -1,9 +1,11 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control indicating an expired password. See http://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00.

View file

@ -1,9 +1,11 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control indicating a password that will expire. See

View file

@ -1,18 +1,18 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import javax.security.auth.login.AccountException;
import javax.security.auth.login.AccountLockedException;
import javax.security.auth.login.CredentialException;
import javax.security.auth.login.CredentialExpiredException;
import javax.security.auth.login.LoginException;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.net.ldap.auth.AccountState;
import org.xbib.net.ldap.api.auth.AccountState;
/**
* Request/response control for password policy. See http://tools.ietf.org/html/draft-behera-ldap-password-policy-11.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
/**
* The set of change types available for use with the {@link PersistentSearchRequestControl} and returned by the {@link

View file

@ -1,12 +1,14 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import java.util.EnumSet;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.BooleanType;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for persistent search. See http://tools.ietf.org/id/draft-ietf-ldapext-psearch-03.txt. Control is

View file

@ -1,8 +1,10 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for proxy authorization. See RFC 4370. Control is defined as:

View file

@ -1,7 +1,9 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Relax request control. See https://tools.ietf.org/html/draft-zeilenga-ldap-relax-03.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
/**
* Marker interface for ldap request controls.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.asn1.DERBuffer;

View file

@ -1,9 +1,9 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import java.util.ArrayList;
import java.util.List;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.DERBuffer;
@ -12,6 +12,9 @@ import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Request/response control for session tracking. See https://tools.ietf.org/html/draft-wahl-ldap-session-03.

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Used by {@link SortRequestControl} to declare how sorting should occur. See RFC 3698 for the definition of

View file

@ -1,15 +1,17 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.ContextType;
import org.xbib.asn1.DEREncoder;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for server side sorting. See RFC 2891. Control is defined as:

View file

@ -1,14 +1,16 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.ResultCode;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.net.ldap.api.ResultCode;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control for server side sorting. See RFC 2891. Control is defined as:

View file

@ -1,12 +1,14 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.BooleanType;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control for ldap content synchronization. See RFC 4533. Control is defined as:

View file

@ -1,12 +1,14 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.BooleanType;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for ldap content synchronization. See RFC 4533. Control is defined as:

View file

@ -1,14 +1,16 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import java.util.UUID;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.UuidType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control for ldap content synchronization. See RFC 4533. Control is defined as:

View file

@ -1,7 +1,9 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for TreeDelete. See draft-armijo-ldap-treedelete.

View file

@ -1,15 +1,17 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import java.util.ArrayList;
import java.util.List;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.ContextDERTag;
import org.xbib.asn1.DEREncoder;
import org.xbib.asn1.IntegerType;
import org.xbib.asn1.OctetStringType;
import org.xbib.asn1.UniversalDERTag;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.RequestControl;
/**
* Request control for virtual list view. See http://tools.ietf.org/html/draft-ietf-ldapext-ldapv3-vlv-09. Control is

View file

@ -1,13 +1,15 @@
package org.xbib.net.ldap.control;
package org.xbib.net.ldap.api.control;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.ResultCode;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.net.ldap.api.ResultCode;
import org.xbib.asn1.AbstractParseHandler;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;
import org.xbib.asn1.IntegerType;
import org.xbib.net.ldap.api.control.AbstractControl;
import org.xbib.net.ldap.api.control.ResponseControl;
/**
* Response control for virtual list view. See http://tools.ietf.org/html/draft-ietf-ldapext-ldapv3-vlv-09. Control is

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Escapes an attribute value per RFC 4514 section 2.4. Implementations must decide how to handle unspecified

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
/**
* Interface for escaping attribute values.

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Escapes an attribute value per RFC 4514 section 2.4. ASCII control characters and all non-ASCII data is HEX encoded.

View file

@ -1,10 +1,10 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
import org.xbib.asn1.DERBuffer;
import org.xbib.asn1.DERParser;
import org.xbib.asn1.DERPath;

View file

@ -1,12 +1,12 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Normalizes a RDN by performing the following operations:

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import java.util.ArrayList;
import java.util.Arrays;
@ -7,7 +7,7 @@ import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Distinguished name containing zero or more relative distinguished names. RDNs are ordered from left to right such

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import java.util.List;

View file

@ -1,7 +1,7 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Escapes an attribute value per RFC 4514 section 2.4. ASCII control characters and all non-ASCII data is not encoded.

View file

@ -1,9 +1,9 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import java.nio.ByteBuffer;
import java.util.function.Function;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Container for a RDN name value pair.

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
import java.util.Collection;
import java.util.Collections;
@ -9,7 +9,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.xbib.net.ldap.LdapUtils;
import org.xbib.net.ldap.api.LdapUtils;
/**
* Relative distinguished name containing one or more name value pairs. Name value pairs are ordered from left to right

View file

@ -1,5 +1,5 @@
package org.xbib.net.ldap.dn;
package org.xbib.net.ldap.api.dn;
/**
* Interface for normalizing RDNs.

View file

@ -1,13 +1,13 @@
package org.xbib.net.ldap.extended;
package org.xbib.net.ldap.api.extended;
import java.util.Arrays;
import org.xbib.net.ldap.AbstractOperation;
import org.xbib.net.ldap.Connection;
import org.xbib.net.ldap.ConnectionFactory;
import org.xbib.net.ldap.LdapException;
import org.xbib.net.ldap.OperationHandle;
import org.xbib.net.ldap.handler.ExtendedValueHandler;
import org.xbib.net.ldap.api.AbstractOperation;
import org.xbib.net.ldap.api.Connection;
import org.xbib.net.ldap.api.ConnectionFactory;
import org.xbib.net.ldap.api.LdapException;
import org.xbib.net.ldap.api.OperationHandle;
import org.xbib.net.ldap.api.handler.ExtendedValueHandler;
/**
* Executes an ldap extended operation.

View file

@ -1,17 +1,17 @@
package org.xbib.net.ldap.extended;
package org.xbib.net.ldap.api.extended;
import org.xbib.net.ldap.LdapException;
import org.xbib.net.ldap.OperationHandle;
import org.xbib.net.ldap.handler.CompleteHandler;
import org.xbib.net.ldap.handler.ExceptionHandler;
import org.xbib.net.ldap.handler.ExtendedValueHandler;
import org.xbib.net.ldap.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.handler.ReferralHandler;
import org.xbib.net.ldap.handler.ResponseControlHandler;
import org.xbib.net.ldap.handler.ResultHandler;
import org.xbib.net.ldap.handler.ResultPredicate;
import org.xbib.net.ldap.handler.UnsolicitedNotificationHandler;
import org.xbib.net.ldap.api.LdapException;
import org.xbib.net.ldap.api.OperationHandle;
import org.xbib.net.ldap.api.handler.CompleteHandler;
import org.xbib.net.ldap.api.handler.ExceptionHandler;
import org.xbib.net.ldap.api.handler.ExtendedValueHandler;
import org.xbib.net.ldap.api.handler.IntermediateResponseHandler;
import org.xbib.net.ldap.api.handler.ReferralHandler;
import org.xbib.net.ldap.api.handler.ResponseControlHandler;
import org.xbib.net.ldap.api.handler.ResultHandler;
import org.xbib.net.ldap.api.handler.ResultPredicate;
import org.xbib.net.ldap.api.handler.UnsolicitedNotificationHandler;
/**
* Handle that notifies on the components of an extended request.

View file

@ -1,8 +1,8 @@
package org.xbib.net.ldap.extended;
package org.xbib.net.ldap.api.extended;
import java.util.Arrays;
import org.xbib.net.ldap.AbstractRequestMessage;
import org.xbib.net.ldap.api.AbstractRequestMessage;
import org.xbib.asn1.ApplicationDERTag;
import org.xbib.asn1.ConstructedDEREncoder;
import org.xbib.asn1.ContextDERTag;

Some files were not shown because too many files have changed in this diff Show more