| | |
| | | } |
| | | |
| | | suppressInternalOperations = config.isSuppressInternalOperations(); |
| | | suppressSynchronizationOperations = |
| | | config.isSuppressSynchronizationOperations(); |
| | | |
| | | currentConfig = config; |
| | | |
| | |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | | |
| | | suppressInternalOperations = config.isSuppressInternalOperations(); |
| | | suppressSynchronizationOperations = |
| | | config.isSuppressSynchronizationOperations(); |
| | | |
| | | File logFile = getFileForPath(config.getLogFile()); |
| | | FileNamingPolicy fnPolicy = new TimeStampNaming(logFile); |
| | |
| | | public void logConnect(ClientConnection clientConnection) |
| | | { |
| | | long connectionID = clientConnection.getConnectionID(); |
| | | |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | { |
| | | return; |
| | |
| | | public void logAbandonRequest(AbandonOperation abandonOperation) |
| | | { |
| | | long connectionID = abandonOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (abandonOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | StringBuilder buffer = new StringBuilder(50); |
| | |
| | | buffer.append(abandonOperation.getMessageID()); |
| | | buffer.append(" idToAbandon="); |
| | | buffer.append(abandonOperation.getIDToAbandon()); |
| | | if (abandonOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logAbandonResult(AbandonOperation abandonOperation) |
| | | { |
| | | long connectionID = abandonOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (abandonOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logAddRequest(AddOperation addOperation) |
| | | { |
| | | long connectionID = addOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (addOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(" dn=\""); |
| | | addOperation.getRawEntryDN().toString(buffer); |
| | | buffer.append("\""); |
| | | if (addOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logAddResponse(AddOperation addOperation) |
| | | { |
| | | long connectionID = addOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (addOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logBindRequest(BindOperation bindOperation) |
| | | { |
| | | long connectionID = bindOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (bindOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(" dn=\""); |
| | | bindOperation.getRawBindDN().toString(buffer); |
| | | buffer.append("\""); |
| | | if (bindOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logBindResponse(BindOperation bindOperation) |
| | | { |
| | | long connectionID = bindOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (bindOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logCompareRequest(CompareOperation compareOperation) |
| | | { |
| | | long connectionID = compareOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (compareOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | compareOperation.getRawEntryDN().toString(buffer); |
| | | buffer.append("\" attr="); |
| | | buffer.append(compareOperation.getAttributeType()); |
| | | if (compareOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logCompareResponse(CompareOperation compareOperation) |
| | | { |
| | | long connectionID = compareOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (compareOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logDeleteRequest(DeleteOperation deleteOperation) |
| | | { |
| | | long connectionID = deleteOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (deleteOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(" dn=\""); |
| | | deleteOperation.getRawEntryDN().toString(buffer); |
| | | buffer.append("\""); |
| | | if (deleteOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | |
| | | public void logDeleteResponse(DeleteOperation deleteOperation) |
| | | { |
| | | long connectionID = deleteOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (deleteOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logExtendedRequest(ExtendedOperation extendedOperation) |
| | | { |
| | | long connectionID = extendedOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (extendedOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(" oid=\""); |
| | | buffer.append(extendedOperation.getRequestOID()); |
| | | buffer.append("\""); |
| | | if (extendedOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logExtendedResponse(ExtendedOperation extendedOperation) |
| | | { |
| | | long connectionID = extendedOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (extendedOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logModifyRequest(ModifyOperation modifyOperation) |
| | | { |
| | | long connectionID = modifyOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (modifyOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(" dn=\""); |
| | | modifyOperation.getRawEntryDN().toString(buffer); |
| | | buffer.append("\""); |
| | | if (modifyOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logModifyResponse(ModifyOperation modifyOperation) |
| | | { |
| | | long connectionID = modifyOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // this is an internal operation |
| | | if (modifyOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logModifyDNRequest(ModifyDNOperation modifyDNOperation) |
| | | { |
| | | long connectionID = modifyDNOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (modifyDNOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(" newSuperior=\""); |
| | | newSuperior.toString(buffer); |
| | | } |
| | | if (modifyDNOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logModifyDNResponse(ModifyDNOperation modifyDNOperation) |
| | | { |
| | | long connectionID = modifyDNOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (modifyDNOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logSearchRequest(SearchOperation searchOperation) |
| | | { |
| | | long connectionID = searchOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (searchOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | |
| | | buffer.append("\""); |
| | | } |
| | | if (searchOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | |
| | | public void logSearchResultDone(SearchOperation searchOperation) |
| | | { |
| | | long connectionID = searchOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (searchOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | public void logUnbind(UnbindOperation unbindOperation) |
| | | { |
| | | long connectionID = unbindOperation.getConnectionID(); |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | if (connectionID < 0) |
| | | { |
| | | return; |
| | | // This is an internal operation. |
| | | if (unbindOperation.isSynchronizationOperation()) |
| | | { |
| | | if (suppressSynchronizationOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | StringBuilder buffer = new StringBuilder(50); |
| | | buffer.append("["); |
| | |
| | | buffer.append(unbindOperation.getOperationID()); |
| | | buffer.append(" msgID="); |
| | | buffer.append(unbindOperation.getMessageID()); |
| | | if (unbindOperation.isSynchronizationOperation()) |
| | | buffer.append(" type=synchronization"); |
| | | |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |