use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logModifyDNRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logModifyDNRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final ReadOnlyModifyDNRequest modifyDNRequest) {
if (logRequests && operationTypes.contains(OperationType.MODIFY_DN)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.MODIFY_DN, connectionInfo, messageID);
appendDN(buffer, "dn", modifyDNRequest.getDN());
appendDN(buffer, "new-rdn", modifyDNRequest.getNewRDN());
buffer.appendBoolean("delete-old-rdn", modifyDNRequest.deleteOldRDN());
final String newSuperiorDN = modifyDNRequest.getNewSuperiorDN();
if (newSuperiorDN != null) {
appendDN(buffer, "new-superior-dn", newSuperiorDN);
}
appendControls(buffer, "control-oids", modifyDNRequest.getControls());
logMessage(buffer, flushAfterRequestMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logExtendedRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logExtendedRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final ExtendedRequest extendedRequest) {
if (logRequests && operationTypes.contains(OperationType.EXTENDED)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.EXTENDED, connectionInfo, messageID);
buffer.appendString("oid", extendedRequest.getOID());
buffer.appendBoolean("has-value", (extendedRequest.getValue() != null));
appendControls(buffer, "control-oids", extendedRequest.getControls());
logMessage(buffer, flushAfterRequestMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logDeleteRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logDeleteRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final ReadOnlyDeleteRequest deleteRequest) {
if (logRequests && operationTypes.contains(OperationType.DELETE)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.DELETE, connectionInfo, messageID);
appendDN(buffer, "dn", deleteRequest.getDN());
appendControls(buffer, "control-oids", deleteRequest.getControls());
logMessage(buffer, flushAfterRequestMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logSearchRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logSearchRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final ReadOnlySearchRequest searchRequest) {
if (logRequests && operationTypes.contains(OperationType.SEARCH)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.SEARCH, connectionInfo, messageID);
appendDN(buffer, "base-dn", searchRequest.getBaseDN());
buffer.appendString("scope", searchRequest.getScope().getName());
buffer.appendString("dereference-policy", searchRequest.getDereferencePolicy().getName());
buffer.appendNumber("size-limit", searchRequest.getSizeLimit());
buffer.appendNumber("time-limit-seconds", searchRequest.getTimeLimitSeconds());
buffer.appendBoolean("types-only", searchRequest.typesOnly());
buffer.appendString("filter", redactFilter(searchRequest.getFilter()).toString());
buffer.beginArray("requested-attributes");
for (final String attributeName : searchRequest.getAttributeList()) {
buffer.appendString(attributeName);
}
buffer.endArray();
appendControls(buffer, "control-oids", searchRequest.getControls());
logMessage(buffer, flushAfterRequestMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logUnbindRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logUnbindRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final List<Control> requestControls) {
if (logRequests && operationTypes.contains(OperationType.UNBIND)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.UNBIND, connectionInfo, messageID);
appendControls(buffer, "control-oids", requestControls);
logMessage(buffer, flushAfterRequestMessages);
}
}
Aggregations