TextAuditLogPublisher.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* 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 legal-notices/CDDLv1_0.txt
* 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 legal-notices/CDDLv1_0.txt.
* 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-2015 ForgeRock AS.
*/
/**
* This class provides the implementation of the audit logger used by
* the directory server.
*/
public final class TextAuditLogPublisher extends
{
private TextWriter writer;
private FileBasedAuditLogPublisherCfg cfg;
/**
* {@inheritDoc}
*/
{
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.
}
{
ccr.setAdminActionRequired(true);
}
}
}
catch (Exception e)
{
}
return ccr;
}
/**
* {@inheritDoc}
*/
protected void close0()
{
}
/**
* {@inheritDoc}
*/
{
try
{
&& !cfg.isAsynchronous();
// Validate retention and rotation policies.
{
}
{
}
if (cfg.isAsynchronous())
{
}
else
{
}
}
catch (DirectoryException e)
{
throw new InitializationException(
}
catch (IOException e)
{
throw new InitializationException(
}
}
/**
* {@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}
*/
{
if (!isLoggable(addOperation))
{
return;
}
{
}
{
{
}
}
.values())
{
{
}
}
}
/**
* {@inheritDoc}
*/
{
if (!isLoggable(deleteOperation))
{
return;
}
}
/**
* {@inheritDoc}
*/
{
if (!isLoggable(modifyDNOperation))
{
return;
}
if (modifyDNOperation.deleteOldRDN())
{
}
else
{
}
if (newSuperior != null)
{
}
}
/**
* {@inheritDoc}
*/
{
if (!isLoggable(modifyOperation))
{
return;
}
boolean first = true;
{
if (first)
{
first = false;
}
else
{
}
{
case ADD:
break;
case DELETE:
break;
case REPLACE:
break;
case INCREMENT:
break;
default:
continue;
}
}
}
{
for (ByteString v : a)
{
encodeValue(v, buffer);
}
}
// 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);
}
}
}