/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions copyright 2011-2013 ForgeRock AS.
*/
/**
* This class provides the implementation of the audit logger used by
* the directory server.
*/
public final class TextAuditLogPublisher extends
{
/**
* {@inheritDoc}
*/
{
// Default result code.
boolean adminActionRequired = false;
try
{
&& !config.isAsynchronous();
// Determine the writer we are using. If we were writing
// asynchronously,
// we need to modify the underlying writer.
if (writer instanceof AsynchronousTextWriter)
{
}
else
{
}
if (currentWriter instanceof MultifileTextWriter)
{
{
}
{
}
if (writer instanceof AsynchronousTextWriter
&& !config.isAsynchronous())
{
// The asynronous setting is being turned off.
asyncWriter.shutdown(false);
}
if (!(writer instanceof AsynchronousTextWriter)
&& config.isAsynchronous())
{
// The asynchronous setting is being turned on.
writer = new AsynchronousTextWriter(
"Asynchronous Text Writer for " +
}
{
adminActionRequired = true;
}
}
}
catch (Exception e)
{
.toString(), stackTraceToSingleLineString(e));
}
}
/**
* {@inheritDoc}
*/
@Override()
protected void close0()
{
}
/**
* {@inheritDoc}
*/
@Override()
{
try
{
&& !cfg.isAsynchronous();
// Validate retention and rotation policies.
{
}
{
}
if (cfg.isAsynchronous())
{
.isAutoFlush(), writer);
}
else
{
}
}
catch (DirectoryException e)
{
throw new InitializationException(message, e);
}
catch (IOException e)
{
throw new InitializationException(message, e);
}
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationAcceptable(
{
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationChangeAcceptable(
{
// Make sure the permission is valid.
try
{
if (!filePerm.isOwnerWritable())
{
return false;
}
}
catch (DirectoryException e)
{
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@Override()
{
if (!isLoggable(addOperation))
{
return;
}
{
}
{
{
for (AttributeValue v : a)
{
}
}
}
.values())
{
{
for (AttributeValue v : a)
{
}
}
}
}
/**
* {@inheritDoc}
*/
@Override()
{
if (!isLoggable(deleteOperation))
{
return;
}
}
/**
* {@inheritDoc}
*/
@Override()
{
if (!isLoggable(modifyDNOperation))
{
return;
}
if (modifyDNOperation.deleteOldRDN())
{
}
else
{
}
if (newSuperior != null)
{
}
}
/**
* {@inheritDoc}
*/
@Override()
{
if (!isLoggable(modifyOperation))
{
return;
}
boolean first = true;
{
if (first)
{
first = false;
}
else
{
}
switch (mod.getModificationType())
{
case ADD:
break;
case DELETE:
break;
case REPLACE:
break;
case INCREMENT:
break;
default:
continue;
}
for (AttributeValue v : a)
{
}
}
}
// Appends the common log header information to the provided buffer.
{
}
/**
* Appends the appropriately-encoded attribute value to the provided
* buffer.
*
* @param str
* The ASN.1 octet string containing the value to append.
* @param buffer
* The buffer to which to append the value.
*/
{
{
}
else
{
}
}
/**
* Appends the appropriately-encoded attribute value to the provided
* buffer.
*
* @param str
* The string containing the value to append.
* @param buffer
* The buffer to which to append the value.
*/
{
{
}
else
{
}
}
// Determines whether the provided operation should be logged.
{
{
return false;
}
else
{
return isResponseLoggable(operation);
}
}
}