| | |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.opends.messages.Message; |
| | | import org.opends.messages.MessageBuilder; |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logAbandonIntermediateMessage(AbandonOperation abandonOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(abandonOperation, "ABANDON", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * abandon request associated with the provided abandon operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logAddIntermediateMessage(AddOperation addOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(addOperation, "ADD", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * add request associated with the provided add operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logBindIntermediateMessage(BindOperation bindOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(bindOperation, "BIND", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * bind request associated with the provided bind operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logCompareIntermediateMessage(CompareOperation compareOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(compareOperation, "COMPARE", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * compare request associated with the provided compare operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logConnectIntermediateMessage( |
| | | ClientConnection clientConnection, String category, |
| | | Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(clientConnection, "CONNECT", category, |
| | | content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logDeleteIntermediateMessage(DeleteOperation deleteOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(deleteOperation, "DELETE", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * delete request associated with the provided delete operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logDisconnectIntermediateMessage( |
| | | ClientConnection clientConnection, String category, |
| | | Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(clientConnection, "DISCONNECT", category, |
| | | content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logExtendedIntermediateMessage( |
| | | ExtendedOperation extendedOperation, String category, |
| | | Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(extendedOperation, "EXTENDED", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * extended request associated with the provided extended operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logModifyDNIntermediateMessage( |
| | | ModifyDNOperation modifyDNOperation, String category, |
| | | Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(modifyDNOperation, "MODIFY", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * modify DN request associated with the provided modify DN |
| | | * operation. |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logModifyIntermediateMessage(ModifyOperation modifyOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(modifyOperation, "MODIFY", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * modify request associated with the provided modify operation. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void logSearchIntermediateMessage(SearchOperation searchOperation, |
| | | String category, Map<String, String> content) |
| | | { |
| | | logIntermediateMessage(searchOperation, "SEARCH", category, content); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the access logger with information about the |
| | | * search request associated with the provided search operation. |
| | | * |
| | |
| | | item.toString(builder); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // Writes an intermediate message to the log. |
| | | private void logIntermediateMessage(Operation operation, String opType, |
| | | String category, Map<String, String> content) |
| | | { |
| | | if (!isLoggable(operation)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | StringBuilder buffer = new StringBuilder(100); |
| | | appendHeader(operation, opType, category, buffer); |
| | | |
| | | for (Map.Entry<String, String> entry : content.entrySet()) |
| | | { |
| | | buffer.append(' '); |
| | | buffer.append(entry.getKey()); |
| | | buffer.append('='); |
| | | buffer.append(entry.getValue()); |
| | | } |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | | |
| | | |
| | | |
| | | //Writes an intermediate message to the log. |
| | | private void logIntermediateMessage( |
| | | ClientConnection clientConnection, String type, String category, |
| | | Map<String, String> content) |
| | | { |
| | | long connectionID = clientConnection.getConnectionID(); |
| | | |
| | | if (connectionID < 0 && suppressInternalOperations) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | StringBuilder buffer = new StringBuilder(100); |
| | | |
| | | buffer.append('['); |
| | | buffer.append(TimeThread.getLocalTime()); |
| | | buffer.append("] "); |
| | | buffer.append(type); |
| | | buffer.append(' '); |
| | | buffer.append(category); |
| | | buffer.append(" conn="); |
| | | buffer.append(connectionID); |
| | | |
| | | for (Map.Entry<String, String> entry : content.entrySet()) |
| | | { |
| | | buffer.append(' '); |
| | | buffer.append(entry.getKey()); |
| | | buffer.append('='); |
| | | buffer.append(entry.getValue()); |
| | | } |
| | | |
| | | writer.writeRecord(buffer.toString()); |
| | | } |
| | | } |