use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logDisconnect.
/**
* {@inheritDoc}
*/
@Override()
public void logDisconnect(@NotNull final LDAPConnectionInfo connectionInfo, @NotNull final String host, final int port, @NotNull final DisconnectType disconnectType, @Nullable final String disconnectMessage, @Nullable final Throwable disconnectCause) {
if (logDisconnects) {
final JSONBuffer buffer = startLogMessage("disconnect", null, connectionInfo, -1);
buffer.appendString("hostname", host);
buffer.appendNumber("port", port);
buffer.appendString("disconnect-type", disconnectType.name());
if (disconnectMessage != null) {
buffer.appendString("disconnect-message", disconnectMessage);
}
if (disconnectCause != null) {
appendException(buffer, "disconnect-cause", disconnectCause);
}
logMessage(buffer, flushAfterDisconnectMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logAbandonRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logAbandonRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, final int messageIDToAbandon, @NotNull final List<Control> requestControls) {
if (logRequests && operationTypes.contains(OperationType.ABANDON)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.ABANDON, connectionInfo, messageID);
buffer.appendNumber("message-id-to-abandon", messageIDToAbandon);
appendControls(buffer, "control-oids", requestControls);
logMessage(buffer, flushAfterRequestMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logConnect.
/**
* {@inheritDoc}
*/
@Override()
public void logConnect(@NotNull final LDAPConnectionInfo connectionInfo, @NotNull final String host, @NotNull final InetAddress inetAddress, final int port) {
if (logConnects) {
final JSONBuffer buffer = startLogMessage("connect", null, connectionInfo, -1);
buffer.appendString("hostname", host);
buffer.appendString("ip-address", inetAddress.getHostAddress());
buffer.appendNumber("port", port);
logMessage(buffer, flushAfterConnectMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logAddRequest.
/**
* {@inheritDoc}
*/
@Override()
public void logAddRequest(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final ReadOnlyAddRequest addRequest) {
if (logRequests && operationTypes.contains(OperationType.ADD)) {
final JSONBuffer buffer = startLogMessage("request", OperationType.ADD, connectionInfo, messageID);
appendDN(buffer, "dn", addRequest.getDN());
if (includeAddAttributeNames) {
appendAttributes(buffer, "attributes", addRequest.getAttributes(), includeAddAttributeValues);
}
appendControls(buffer, "control-oids", addRequest.getControls());
logMessage(buffer, flushAfterRequestMessages);
}
}
use of com.unboundid.util.json.JSONBuffer in project ldapsdk by pingidentity.
the class JSONLDAPConnectionLogger method logIntermediateResponse.
/**
* {@inheritDoc}
*/
@Override()
public void logIntermediateResponse(@NotNull final LDAPConnectionInfo connectionInfo, final int messageID, @NotNull final IntermediateResponse intermediateResponse) {
if (logIntermediateResponses) {
final JSONBuffer buffer = startLogMessage("intermediate-response", null, connectionInfo, messageID);
final String oid = intermediateResponse.getOID();
if (oid != null) {
buffer.appendString("oid", oid);
}
buffer.appendBoolean("has-value", (intermediateResponse.getValue() != null));
appendControls(buffer, "control-oids", intermediateResponse.getControls());
logMessage(buffer, flushAfterRequestMessages);
}
}
Aggregations