| Method from com.sun.jndi.ldap.LdapClient Detail: |
LdapResult add(LdapEntry entry,
Control[] reqCtls) throws NamingException, IOException {
ensureOpen();
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
if (entry == null || entry.DN == null)
return res;
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
Attribute attr;
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LDAP_REQ_ADD);
ber.encodeString(entry.DN, isLdapv3);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
NamingEnumeration enum_ = entry.attributes.getAll();
while (enum_.hasMore()) {
attr = (Attribute)enum_.next();
// zero values is not permitted
if (hasNoValue(attr)) {
throw new InvalidAttributeValueException(
"'" + attr.getID() + "' has no values.");
} else {
encodeAttribute(ber, attr);
}
}
ber.endSeq();
ber.endSeq();
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId);
return processReply(req, res, LDAP_REP_ADD);
}
|
void addUnsolicited(LdapCtx ctx) {
if (debug > 0) {
System.err.println("LdapClient.addUnsolicited" + ctx);
}
unsolicited.addElement(ctx);
}
|
synchronized LdapResult authenticate(boolean initial,
String name,
Object pw,
int version,
String authMechanism,
Control[] ctls,
Hashtable env) throws NamingException {
authenticateCalled = true;
try {
ensureOpen();
} catch (IOException e) {
NamingException ne = new CommunicationException();
ne.setRootCause(e);
throw ne;
}
switch (version) {
case LDAP_VERSION3_VERSION2:
case LDAP_VERSION3:
isLdapv3 = true;
break;
case LDAP_VERSION2:
isLdapv3 = false;
break;
default:
throw new CommunicationException("Protocol version " + version +
" not supported");
}
LdapResult res = null;
if (authMechanism.equalsIgnoreCase("none") ||
authMechanism.equalsIgnoreCase("anonymous")) {
// Perform LDAP bind if we are reauthenticating, using LDAPv2,
// supporting failover to LDAPv2, or controls have been supplied.
if (!initial ||
(version == LDAP_VERSION2) ||
(version == LDAP_VERSION3_VERSION2) ||
((ctls != null) && (ctls.length > 0))) {
try {
// anonymous bind; update name/pw for LDAPv2 retry
res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
false);
if (res.status == LdapClient.LDAP_SUCCESS) {
conn.setBound();
}
} catch (IOException e) {
NamingException ne =
new CommunicationException("anonymous bind failed: " +
conn.host + ":" + conn.port);
ne.setRootCause(e);
throw ne;
}
} else {
// Skip LDAP bind for LDAPv3 anonymous bind
res = new LdapResult();
res.status = LdapClient.LDAP_SUCCESS;
}
} else if (authMechanism.equalsIgnoreCase("simple")) {
// simple authentication
byte[] encodedPw = null;
try {
encodedPw = encodePassword(pw, isLdapv3);
res = ldapBind(name, encodedPw, ctls, null, false);
if (res.status == LdapClient.LDAP_SUCCESS) {
conn.setBound();
}
} catch (IOException e) {
NamingException ne =
new CommunicationException("simple bind failed: " +
conn.host + ":" + conn.port);
ne.setRootCause(e);
throw ne;
} finally {
// If pw was copied to a new array, clear that array as
// a security precaution.
if (encodedPw != pw && encodedPw != null) {
for (int i = 0; i < encodedPw.length; i++) {
encodedPw[i] = 0;
}
}
}
} else if (isLdapv3) {
// SASL authentication
try {
res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
authMechanism, env, ctls);
if (res.status == LdapClient.LDAP_SUCCESS) {
conn.setBound();
}
} catch (IOException e) {
NamingException ne =
new CommunicationException("SASL bind failed: " +
conn.host + ":" + conn.port);
ne.setRootCause(e);
throw ne;
}
} else {
throw new AuthenticationNotSupportedException(authMechanism);
}
//
// re-try login using v2 if failing over
//
if (initial &&
(res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
(version == LdapClient.LDAP_VERSION3_VERSION2) &&
(authMechanism.equalsIgnoreCase("none") ||
authMechanism.equalsIgnoreCase("anonymous") ||
authMechanism.equalsIgnoreCase("simple"))) {
byte[] encodedPw = null;
try {
isLdapv3 = false;
encodedPw = encodePassword(pw, false);
res = ldapBind(name, encodedPw, ctls, null, false);
if (res.status == LdapClient.LDAP_SUCCESS) {
conn.setBound();
}
} catch (IOException e) {
NamingException ne =
new CommunicationException(authMechanism + ":" +
conn.host + ":" + conn.port);
ne.setRootCause(e);
throw ne;
} finally {
// If pw was copied to a new array, clear that array as
// a security precaution.
if (encodedPw != pw && encodedPw != null) {
for (int i = 0; i < encodedPw.length; i++) {
encodedPw[i] = 0;
}
}
}
}
// principal name not found
// (map NameNotFoundException to AuthenticationException)
// %%% This is a workaround for Netscape servers returning
// %%% no such object when the principal name is not found
// %%% Note that when this workaround is applied, it does not allow
// %%% response controls to be recorded by the calling context
if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
throw new AuthenticationException(
getErrorMessage(res.status, res.errorMessage));
}
conn.setV3(isLdapv3);
return res;
}
|
synchronized boolean authenticateCalled() {
return authenticateCalled;
}
|
void clearSearchReply(LdapResult res,
Control[] ctls) {
if (res != null && conn != null) {
// Only send an LDAP abandon operation when clearing the search
// reply from a one-level or subtree search.
LdapRequest req = conn.findRequest(res.msgId);
if (req == null) {
return;
}
// OK if req got removed after check; double removal attempt
// but otherwise no harm done
// Send an LDAP abandon only if the search operation has not yet
// completed.
if (req.hasSearchCompleted()) {
conn.removeRequest(req);
} else {
conn.abandonRequest(req, ctls);
}
}
}
|
synchronized void close(Control[] reqCtls,
boolean hardClose) {
--referenceCount;
if (debug > 1) {
System.err.println("LdapClient: " + this);
System.err.println("LdapClient: close() called: " + referenceCount);
(new Throwable()).printStackTrace();
}
if (referenceCount < = 0 && conn != null) {
if (debug > 0) System.err.println("LdapClient: closed connection " + this);
if (!pooled) {
// Not being pooled; continue with closing
conn.cleanup(reqCtls, false);
conn = null;
} else {
// Pooled
// Is this a real close or a request to return conn to pool
if (hardClose) {
conn.cleanup(reqCtls, false);
conn = null;
pcb.removePooledConnection(this);
} else {
pcb.releasePooledConnection(this);
}
}
}
}
|
public synchronized void closeConnection() {
forceClose(false); // this is a pool callback so no need to clean pool
}
|
LdapResult compare(String DN,
String type,
String value,
Control[] reqCtls) throws NamingException, IOException {
ensureOpen();
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
if (DN == null || type == null || value == null)
return res;
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LDAP_REQ_COMPARE);
ber.encodeString(DN, isLdapv3);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeString(type, isLdapv3);
// replace any escaped characters in the value
byte[] val = isLdapv3 ?
value.getBytes("UTF8") : value.getBytes("8859_1");
ber.encodeOctetString(
Filter.unescapeFilterValue(val, 0, val.length),
Ber.ASN_OCTET_STR);
ber.endSeq();
ber.endSeq();
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId);
return processReply(req, res, LDAP_REP_COMPARE);
}
|
LdapResult delete(String DN,
Control[] reqCtls) throws NamingException, IOException {
ensureOpen();
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
if (DN == null)
return res;
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.encodeString(DN, LDAP_REQ_DELETE, isLdapv3);
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId);
return processReply(req, res, LDAP_REP_DELETE);
}
|
static void encodeControls(BerEncoder ber,
Control[] reqCtls) throws IOException {
if ((reqCtls == null) || (reqCtls.length == 0)) {
return;
}
byte[] controlVal;
ber.beginSeq(LdapClient.LDAP_CONTROLS);
for (int i = 0; i < reqCtls.length; i++) {
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeString(reqCtls[i].getID(), true); // control OID
if (reqCtls[i].isCritical()) {
ber.encodeBoolean(true); // critical control
}
if ((controlVal = reqCtls[i].getEncodedValue()) != null) {
ber.encodeOctetString(controlVal, Ber.ASN_OCTET_STR);
}
ber.endSeq();
}
ber.endSeq();
}
|
LdapResult extendedOp(String id,
byte[] request,
Control[] reqCtls,
boolean pauseAfterReceipt) throws NamingException, IOException {
ensureOpen();
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
if (id == null)
return res;
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LDAP_REQ_EXTENSION);
ber.encodeString(id,
Ber.ASN_CONTEXT | 0, isLdapv3);//[0]
if (request != null) {
ber.encodeOctetString(request,
Ber.ASN_CONTEXT | 1);//[1]
}
ber.endSeq();
encodeControls(ber, reqCtls); // always v3
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId, pauseAfterReceipt);
BerDecoder rber = conn.readReply(req);
rber.parseSeq(null); // init seq
rber.parseInt(); // msg id
if (rber.parseByte() != LDAP_REP_EXTENSION) {
return res;
}
rber.parseLength();
parseExtResponse(rber, res);
conn.removeRequest(req);
return res; // Done with operation
}
|
protected void finalize() {
if (debug > 0) System.err.println("LdapClient: finalize " + this);
forceClose(pooled);
}
|
static String getErrorMessage(int errorCode,
String errorMessage) {
/*
* Generate an error message from the LDAP error code and error diagnostic.
* The message format is:
*
* "[LDAP: error code < errorCode > - < errorMessage >]"
*
* where < errorCode > is a numeric error code
* and < errorMessage > is a textual description of the error (if available)
*
*/
String message = "[LDAP: error code " + errorCode;
if ((errorMessage != null) && (errorMessage.length() != 0)) {
// append error message from the server
message = message + " - " + errorMessage + "]";
} else {
// append built-in error message
try {
if (ldap_error_message[errorCode] != null) {
message = message + " - " + ldap_error_message[errorCode] +
"]";
}
} catch (ArrayIndexOutOfBoundsException ex) {
message = message + "]";
}
}
return message;
}
|
static LdapClient getInstance(boolean usePool,
String hostname,
int port,
String factory,
int connectTimeout,
int readTimeout,
OutputStream trace,
int version,
String authMechanism,
Control[] ctls,
String protocol,
String user,
Object passwd,
Hashtable env) throws NamingException {
if (usePool) {
if (LdapPoolManager.isPoolingAllowed(factory, trace,
authMechanism, protocol, env)) {
LdapClient answer = LdapPoolManager.getLdapClient(
hostname, port, factory, connectTimeout, readTimeout,
trace, version, authMechanism, ctls, protocol, user,
passwd, env);
answer.referenceCount = 1; // always one when starting out
return answer;
}
}
return new LdapClient(hostname, port, factory, connectTimeout,
readTimeout, trace, null);
}
|
LdapResult getSearchReply(int batchSize,
LdapResult res,
Hashtable binaryAttrs) throws NamingException, IOException {
ensureOpen();
LdapRequest req;
if ((req = conn.findRequest(res.msgId)) == null) {
return null;
}
return getSearchReply(req, batchSize, res, binaryAttrs);
}
|
synchronized void incRefCount() {
++referenceCount;
if (debug > 1) {
System.err.println("LdapClient.incRefCount: " + referenceCount + " " + this);
}
}
|
public synchronized LdapResult ldapBind(String dn,
byte[] toServer,
Control[] bindCtls,
String auth,
boolean pauseAfterReceipt) throws NamingException, IOException {
ensureOpen();
// flush outstanding requests
conn.abandonOutstandingReqs(null);
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
//
// build the bind request.
//
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LdapClient.LDAP_REQ_BIND);
ber.encodeInt(isLdapv3 ? LDAP_VERSION3 : LDAP_VERSION2);
ber.encodeString(dn, isLdapv3);
// if authentication mechanism specified, it is SASL
if (auth != null) {
ber.beginSeq(Ber.ASN_CONTEXT | Ber.ASN_CONSTRUCTOR | 3);
ber.encodeString(auth, isLdapv3); // SASL mechanism
if (toServer != null) {
ber.encodeOctetString(toServer,
Ber.ASN_OCTET_STR);
}
ber.endSeq();
} else {
if (toServer != null) {
ber.encodeOctetString(toServer, Ber.ASN_CONTEXT);
} else {
ber.encodeOctetString(null, Ber.ASN_CONTEXT, 0, 0);
}
}
ber.endSeq();
// Encode controls
if (isLdapv3) {
encodeControls(ber, bindCtls);
}
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId, pauseAfterReceipt);
if (toServer != null) {
ber.reset(); // clear internally-stored password
}
// Read reply
BerDecoder rber = conn.readReply(req);
rber.parseSeq(null); // init seq
rber.parseInt(); // msg id
if (rber.parseByte() != LDAP_REP_BIND) {
return res;
}
rber.parseLength();
parseResult(rber, res, isLdapv3);
// handle server's credentials (if present)
if (isLdapv3 &&
(rber.bytesLeft() > 0) &&
(rber.peekByte() == (Ber.ASN_CONTEXT | 7))) {
res.serverCreds = rber.parseOctetString((Ber.ASN_CONTEXT | 7), null);
}
res.resControls = isLdapv3 ? parseControls(rber) : null;
conn.removeRequest(req);
return res;
}
Sends an LDAP Bind request.
Cannot be private; called by LdapSasl |
LdapResult moddn(String DN,
String newrdn,
boolean deleteOldRdn,
String newSuperior,
Control[] reqCtls) throws NamingException, IOException {
ensureOpen();
boolean changeSuperior = (newSuperior != null &&
newSuperior.length() > 0);
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
if (DN == null || newrdn == null)
return res;
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LDAP_REQ_MODRDN);
ber.encodeString(DN, isLdapv3);
ber.encodeString(newrdn, isLdapv3);
ber.encodeBoolean(deleteOldRdn);
if(isLdapv3 && changeSuperior) {
//System.err.println("changin superior");
ber.encodeString(newSuperior, LDAP_SUPERIOR_DN, isLdapv3);
}
ber.endSeq();
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId);
return processReply(req, res, LDAP_REP_MODRDN);
}
|
LdapResult modify(String dn,
int[] operations,
Attribute[] attrs,
Control[] reqCtls) throws NamingException, IOException {
ensureOpen();
LdapResult res = new LdapResult();
res.status = LDAP_OPERATIONS_ERROR;
if (dn == null || operations.length != attrs.length)
return res;
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LDAP_REQ_MODIFY);
ber.encodeString(dn, isLdapv3);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
for (int i = 0; i < operations.length; i++) {
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(operations[i], LBER_ENUMERATED);
// zero values is not permitted for the add op.
if ((operations[i] == ADD) && hasNoValue(attrs[i])) {
throw new InvalidAttributeValueException(
"'" + attrs[i].getID() + "' has no values.");
} else {
encodeAttribute(ber, attrs[i]);
}
ber.endSeq();
}
ber.endSeq();
ber.endSeq();
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId);
return processReply(req, res, LDAP_REP_MODIFY);
}
|
static Vector parseControls(BerDecoder replyBer) throws IOException {
// handle LDAPv3 controls (if present)
if ((replyBer.bytesLeft() > 0) && (replyBer.peekByte() == LDAP_CONTROLS)) {
Vector ctls = new Vector(4);
String controlOID;
boolean criticality = false; // default
byte[] controlValue = null; // optional
int[] seqlen = new int[1];
replyBer.parseSeq(seqlen);
int endseq = replyBer.getParsePosition() + seqlen[0];
while ((replyBer.getParsePosition() < endseq) &&
(replyBer.bytesLeft() > 0)) {
replyBer.parseSeq(null);
controlOID = replyBer.parseString(true);
if ((replyBer.bytesLeft() > 0) &&
(replyBer.peekByte() == Ber.ASN_BOOLEAN)) {
criticality = replyBer.parseBoolean();
}
if ((replyBer.bytesLeft() > 0) &&
(replyBer.peekByte() == Ber.ASN_OCTET_STR)) {
controlValue =
replyBer.parseOctetString(Ber.ASN_OCTET_STR, null);
}
if (controlOID != null) {
ctls.addElement(
new BasicControl(controlOID, criticality, controlValue));
}
}
return ctls;
} else {
return null;
}
}
|
static void parseResult(BerDecoder replyBer,
LdapResult res,
boolean isLdapv3) throws IOException {
res.status = replyBer.parseEnumeration();
res.matchedDN = replyBer.parseString(isLdapv3);
res.errorMessage = replyBer.parseString(isLdapv3);
// handle LDAPv3 referrals (if present)
if (isLdapv3 &&
(replyBer.bytesLeft() > 0) &&
(replyBer.peekByte() == LDAP_REP_REFERRAL)) {
Vector URLs = new Vector(4);
int[] seqlen = new int[1];
replyBer.parseSeq(seqlen);
int endseq = replyBer.getParsePosition() + seqlen[0];
while ((replyBer.getParsePosition() < endseq) &&
(replyBer.bytesLeft() > 0)) {
URLs.addElement(replyBer.parseString(isLdapv3));
}
if (res.referrals == null) {
res.referrals = new Vector(4);
}
res.referrals.addElement(URLs);
}
}
|
void processConnectionClosure() {
// Notify listeners
if (unsolicited.size() > 0) {
String msg;
if (conn != null) {
msg = conn.host + ":" + conn.port + " connection closed";
} else {
msg = "Connection closed";
}
notifyUnsolicited(new CommunicationException(msg));
}
// Remove from pool
if (pooled) {
pcb.removePooledConnection(this);
}
}
Called by Connection.cleanup(). LdapClient should
notify any unsolicited listeners and removing itself from any pool.
This is almost like forceClose(), except it doesn't call
Connection.cleanup() (because this is called from cleanup()). |
void processUnsolicited(BerDecoder ber) {
if (debug > 0) {
System.err.println("LdapClient.processUnsolicited");
}
synchronized (unsolicited) {
try {
// Parse the response
LdapResult res = new LdapResult();
ber.parseSeq(null); // init seq
ber.parseInt(); // msg id; should be 0; ignored
if (ber.parseByte() != LDAP_REP_EXTENSION) {
throw new IOException(
"Unsolicited Notification must be an Extended Response");
}
ber.parseLength();
parseExtResponse(ber, res);
if (DISCONNECT_OID.equals(res.extensionId)) {
// force closing of connection
forceClose(pooled);
}
if (unsolicited.size() > 0) {
// Create an UnsolicitedNotification using the parsed data
// Need a 'ctx' object because we want to use the context's
// list of provider control factories.
UnsolicitedNotification notice = new UnsolicitedResponseImpl(
res.extensionId,
res.extensionValue,
res.referrals,
res.status,
res.errorMessage,
res.matchedDN,
(res.resControls != null) ?
((LdapCtx)unsolicited.elementAt(0)).convertControls(res.resControls) :
null);
// Fire UnsolicitedNotification events to listeners
notifyUnsolicited(notice);
// If "disconnect" notification,
// notify unsolicited listeners via NamingException
if (DISCONNECT_OID.equals(res.extensionId)) {
notifyUnsolicited(
new CommunicationException("Connection closed"));
}
}
} catch (IOException e) {
if (unsolicited.size() == 0)
return; // no one registered; ignore
NamingException ne = new CommunicationException(
"Problem parsing unsolicited notification");
ne.setRootCause(e);
notifyUnsolicited(ne);
} catch (NamingException e) {
notifyUnsolicited(e);
}
}
}
|
void removeUnsolicited(LdapCtx ctx) {
if (debug > 0) {
System.err.println("LdapClient.removeUnsolicited" + ctx);
}
synchronized (unsolicited) {
if (unsolicited.size() == 0) {
return;
}
unsolicited.removeElement(ctx);
}
}
|
LdapResult search(String dn,
int scope,
int deref,
int sizeLimit,
int timeLimit,
boolean attrsOnly,
String[] attrs,
String filter,
int batchSize,
Control[] reqCtls,
Hashtable binaryAttrs,
boolean waitFirstReply) throws NamingException, IOException {
ensureOpen();
LdapResult res = new LdapResult();
BerEncoder ber = new BerEncoder();
int curMsgId = conn.getMsgId();
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeInt(curMsgId);
ber.beginSeq(LDAP_REQ_SEARCH);
ber.encodeString(dn == null ? "" : dn, isLdapv3);
ber.encodeInt(scope, LBER_ENUMERATED);
ber.encodeInt(deref, LBER_ENUMERATED);
ber.encodeInt(sizeLimit);
ber.encodeInt(timeLimit);
ber.encodeBoolean(attrsOnly);
Filter.encodeFilterString(ber, filter, isLdapv3);
ber.beginSeq(Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
ber.encodeStringArray(attrs, isLdapv3);
ber.endSeq();
ber.endSeq();
if (isLdapv3) encodeControls(ber, reqCtls);
ber.endSeq();
LdapRequest req = conn.writeRequest(ber, curMsgId);
res.msgId = curMsgId;
res.status = LdapClient.LDAP_SUCCESS; //optimistic
if (waitFirstReply) {
// get first reply
res = getSearchReply(req, batchSize, res, binaryAttrs);
}
return res;
}
|
boolean usingSaslStreams() {
return (conn.inStream instanceof SaslInputStream);
}
Determines whether SASL encryption/integrity is in progress.
This check is made prior to reauthentication. You cannot reauthenticate
over an encrypted/integrity-protected SASL channel. You must
close the channel and open a new one. |